8000 removed verbose/debugging code · GitHubToolbox/github-ripper@b528584 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit b528584

Browse files
committed
removed verbose/debugging code
1 parent 201ddb9 commit b528584

File tree

15 files changed

+10
-105
lines changed

15 files changed

+10
-105
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/ab-results*
22
Gemfile.lock
33
.rspec_status
4+
*.gem

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file.
55

66
This changelog was automatically generated using [Caretaker](https://github.com/DevelopersToolbox/caretaker) by [Wolf Software](https://github.com/WolfSoftware)
77

8+
### [v0.1.3](https://github.com/DevelopersToolbox/github-ripper/compare/v0.1.2...v0.1.3)
9+
10+
> Released on May, 20th 2022
11+
12+
- removed verbose/debugging code [`[head]`](https://github.com/DevelopersToolbox/github-ripper/commit/)
13+
814
### [v0.1.2](https://github.com/DevelopersToolbox/github-ripper/compare/v0.1.1...v0.1.2)
915

1016
> Released on May, 20th 2022
1117
12-
- Better debugging and cleaner error handling [`[head]`](https://github.com/DevelopersToolbox/github-ripper/commit/)
18+
- Better debugging and cleaner error handling [`[201ddb9]`](https://github.com/DevelopersToolbox/github-ripper/commit/201ddb96cee1388f570991410d871a05d0ff4d77)
1319

1420
- rebrand [`[5c46d9c]`](https://github.com/DevelopersToolbox/github-ripper/commit/5c46d9c7fe28dc3be562c7534438fe8163633f52)
1521

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.2
1+
0.1.3

exe/ghrip

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,13 @@ def add_flag_parameters(parser, options)
5454
[parser, options]
5555
end
5656

57-
# This method reeks of :reek:UtilityFunction, :reek:TooManyStatements
58-
def add_debug_flag_parameters(parser, options)
59-
parser.separator ''
60-
parser.separator 'Flags (Debugging):'
61-
parser.on('-D', '--debug', 'Enable debugging') { |_debug| options[:debug] = true }
62-
parser.on('-v', '--verbose', 'Verbose Output') { |_verbose| options[:verbose] = true }
63-
[parser, options]
64-
end
65-
6657
def create_parser
6758
options = DEFAULT_VALUES.dup
6859

6960
parser = init_default_parser
7061
parser, options = add_parameters(parser, options)
7162
parser, options = add_repo_flag_parameters(parser, options)
7263
parser, options = add_flag_parameters(parser, options)
73-
parser, options = add_debug_flag_parameters(parser, options)
7464

7565
[parser, options]
7666
end

lib/github-ripper.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require 'rainbow'
66
require 'terminal-table'
77

8-
require_relative 'github-ripper/debugging'
98
require_relative 'github-ripper/function-maps'
109
require_relative 'github-ripper/git'
1110
require_relative 'github-ripper/report'
@@ -28,13 +27,7 @@ def rip(options = {})
2827
options[:use_slugs] = true
2928
options[:base_dir] = "#{File.expand_path('~')}/Downloads/Repos" unless get_option(options, :base_dir)
3029

31-
verbose(options, 'Verbose mode enabled')
32-
debug(options, 'Debug mode enabled')
33-
34-
verbose(options, 'Getting repo list')
3530
repos = get_repo_list(options)
36-
37-
verbose(options, 'Ripping repos')
3831
results = rip_repos(options, repos)
3932

4033
results, repo_count, error_count = process_results(results, options)

lib/github-ripper/debugging.rb

Lines changed: 0 additions & 20 deletions
This file was deleted.

lib/github-ripper/function-maps.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class << self
2020
private
2121

2222
def function_map_lookup(options)
23-
debug(options, "Function: #{__method__}")
24-
2523
return FUNCTION_MAP[:user_repos] if flag_set?(options, :user_repos) || get_option(options, :user)
2624
return FUNCTION_MAP[:org_members_repos] if flag_set?(options, :org_members_repos)
2725
return FUNCTION_MAP[:all_repos] if flag_set?(options, :all_repos)

lib/github-ripper/git.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class << self
1414
private
1515

1616
def get_clone_type(options)
17-
debug(options, "Function: #{__method__}")
18-
1917
return 'git clone git@github.com:' if flag_set?(options, :use_git)
2018

2119
return "git clone https://#{options[:token]}@github.com/" if get_option(options, :token)
@@ -24,20 +22,14 @@ def get_clone_type(options)
2422
end
2523

2624
def repo_full_path(options, repo)
27-
debug(options, "Function: #{__method__}")
28-
2925
"#{options[:base_dir]}/#{repo}"
3026
end
3127

3228
def repo_exists?(repo_path)
33-
debug(options, "Function: #{__method__}")
34-
3529
File.directory?(repo_path)
3630
end
3731

3832
def execute_command(command)
39-
debug(options, "Function: #{__method__}")
40-
4133
error_string = ''
4234
return_code = 0
4335

@@ -50,8 +42,6 @@ def execute_command(command)
5042
end
5143

5244
def clone_repo(options, repo, repo_path)
53-
debug(options, "Function: #{__method__}")
54-
5545
return { :repo => repo, :path => repo_path, :status => 'Dry Run', :when => 'git clone', :info => '' } if flag_set?(options, :dry_run)
5646

5747
FileUtils.mkdir_p repo_path
@@ -66,8 +56,6 @@ def clone_repo(options, repo, repo_path)
6656
end
6757

6858
def update_repo(options, repo, repo_path)
69-
debug(options, "Function: #{__method__}")
70-
7159
return { :repo => repo, :path => repo_path, :status => 'Dry Run', :when => 'git clone', :info => '' } if flag_set?(options, :dry_run)
7260

7361
olddir = Dir.pwd
@@ -83,8 +71,6 @@ def update_repo(options, repo, repo_path)
8371
end
8472

8573
def clone_repo_wrapper(options, repo)
86-
debug(options, "Function: #{__method__}")
87-
8874
repo_path = repo_full_path(options, repo)
8975

9076
return update_repo(options, repo, repo_path) if repo_exists?(repo_path)

lib/github-ripper/report.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ class << self
1010
private
1111

1212
def display_table?(error_count, options)
13-
debug(options, "Function: #{__method__}")
14-
1513
# Dry run - force display of all
1614
return true if flag_set?(options, :dry_run)
1715

@@ -29,8 +27,6 @@ def display_table?(error_count, options)
2927
# This method smells of :reek:LongParameterList, :reek:DuplicateMethodCall
3028
#
3129
def draw_report(results, repo_count, error_count, options)
32-
debug(options, "Function: #{__method__}")
33-
3430
return unless display_table?(error_count, options)
3531

3632
table = create_table

lib/github-ripper/repos.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class << self
1212
# rubocop:disable Metrics/CyclomaticComplexity
1313
# This method smells of :reek:NilCheck
1414
def handle_required_parameters(options)
15-
debug(options, "Function: #{__method__}")
16-
1715
return if get_option(options, :token)
1816

1917
raise StandardError.new('Please supply a username (-u) or a token (-t)') if (flag_set?(options, :user_repos) || flag_set?(options, :org_members_repos) || flag_set?(options, :all_repos)) && get_option(options, :user).nil?
@@ -26,8 +24,6 @@ def handle_required_parameters(options)
2624
# docs go here
2725
#
2826
def get_repo_list(options)
29-
debug(options, "Function: #{__method__}")
30-
3127
handle_required_parameters(options)
3228

3329
function = function_map_lookup(options)
@@ -41,8 +37,6 @@ def get_repo_list(options)
4137
# This method smells of :reek:DuplicateMethodCall
4238
#
4339
def rip_repos(options, repos)
44-
debug(options, "Function: #{__method__}")
45-
4640
repo_count = repos.size
4741

4842
results = if flag_set?(options, :silent)
@@ -54,8 +48,6 @@ def rip_repos(options, repos)
5448
end
5549

5650
def process_results(results, options)
57-
debug(options, "Function: #{__method__}")
58-
5951
repo_count = count_repos(results)
6052
error_count = count_errors(results)
6153
results = filter_results(results, options)

0 commit comments

Comments
 (0)
0