rubocopter 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubocopter/cli.rb +11 -10
- data/lib/rubocopter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d389ad55ac88f097d06e82294ec6e668d05bd20d
|
4
|
+
data.tar.gz: a3a157cc49c7edcadcd86abc4fcf9c1a041cabc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9dd5171972debabbf28376ac45e7603fa2f643219d71d7108f3813899fdb965c9e7907f5aeb8797beed8ed1fe50cab2e90171e24b406aacc8f487dfc008de79
|
7
|
+
data.tar.gz: eb58d30c831d4c9fcd138bf2f5f40845d82be3f2ce85d0a42cba42091cfa7e323c99cce70a78d163e9144cdddc1f0a52875141540a3f22f03b21ce0bc0a20263
|
data/lib/rubocopter/cli.rb
CHANGED
@@ -2,6 +2,7 @@ require 'optparse'
|
|
2
2
|
require 'shellwords'
|
3
3
|
require 'rubocop'
|
4
4
|
require 'pathname'
|
5
|
+
require_relative 'version'
|
5
6
|
|
6
7
|
RuboCopter::Options = Struct.new(:hash, :debug)
|
7
8
|
|
@@ -84,7 +85,7 @@ class RuboCopter::CLI
|
|
84
85
|
@options = RuboCopter::Options.new('master', false)
|
85
86
|
|
86
87
|
opt_parser = OptionParser.new do |opts|
|
87
|
-
opts.banner = "
|
88
|
+
opts.banner = "Rubocopter v:#{RuboCopter::VERSION}\nUsage: rubocopter [options]"
|
88
89
|
|
89
90
|
opts.on('-c HASH', '--commit HASH', 'git hash to compare against') do |hash|
|
90
91
|
@options.hash = hash
|
@@ -112,15 +113,15 @@ class RuboCopter::CLI
|
|
112
113
|
end
|
113
114
|
|
114
115
|
def install_git_hooks(hook)
|
115
|
-
working_dir_git_hooks = Pathname.new(Dir.pwd).join('.git', 'hooks')
|
116
|
+
working_dir_git_hooks = Pathname.new(Dir.pwd).join('.git', 'hooks').to_s
|
116
117
|
current_path = Pathname.new(File.dirname(__FILE__))
|
117
118
|
if hook == 'commit'
|
118
|
-
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-commit'), working_dir_git_hooks]))
|
119
|
+
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-commit').to_s, working_dir_git_hooks]))
|
119
120
|
elsif hook == 'push'
|
120
|
-
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-push'), working_dir_git_hooks]))
|
121
|
+
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-push').to_s, working_dir_git_hooks]))
|
121
122
|
elsif hook == 'all'
|
122
|
-
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-commit'), working_dir_git_hooks]))
|
123
|
-
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-push'), working_dir_git_hooks]))
|
123
|
+
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-commit').to_s, working_dir_git_hooks]))
|
124
|
+
system(Shellwords.join(['cp', current_path.join('../../git_hooks', 'pre-push').to_s, working_dir_git_hooks]))
|
124
125
|
end
|
125
126
|
exit(0)
|
126
127
|
end
|
@@ -128,12 +129,12 @@ class RuboCopter::CLI
|
|
128
129
|
def remove_git_hooks(hook)
|
129
130
|
working_dir_git_hooks = Pathname.new(Dir.pwd).join('.git', 'hooks')
|
130
131
|
if hook == 'commit'
|
131
|
-
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-commit')]))
|
132
|
+
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-commit').to_s]))
|
132
133
|
elsif hook == 'push'
|
133
|
-
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-push')]))
|
134
|
+
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-push').to_s]))
|
134
135
|
elsif hook == 'all'
|
135
|
-
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-commit')]))
|
136
|
-
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-push')]))
|
136
|
+
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-commit').to_s]))
|
137
|
+
system(Shellwords.join(['rm', working_dir_git_hooks.join('pre-push').to_s]))
|
137
138
|
end
|
138
139
|
exit(0)
|
139
140
|
end
|
data/lib/rubocopter/version.rb
CHANGED