mini_cli 0.2.0 → 0.2.1
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/Gemfile.lock +20 -6
- data/lib/mini_cli/base_module.rb +1 -1
- data/lib/mini_cli/version.rb +1 -1
- data/mini_cli.gemspec +1 -0
- data/spec/mini_cli/base_spec.rb +34 -12
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7a4ea81e90dcbba4f6dc56ec6fd7951483009d7
|
4
|
+
data.tar.gz: c7870a9b8255d0247b29ae8fb158193891025362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62f6adc87996a0dd8aee972d1806165cef651f754268ba69d09c25e774bdafedec4801a59d6c23c704ebdf2b57a1d17986530fe8d33d4bff53434b2bb7100ed1
|
7
|
+
data.tar.gz: 5197e541818536e1dcb88cea2a3a25a6bb602d9ac03ae61d807db94763a238c7c67cde64066ef570d63af8c992023f86d0ca3f7f39df422d8e5efa2379e67f39
|
data/Gemfile.lock
CHANGED
@@ -1,36 +1,42 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mini_cli (0.1
|
4
|
+
mini_cli (0.2.1)
|
5
5
|
puma (> 2.10, < 4.0.0)
|
6
6
|
rerun (~> 0.10)
|
7
|
+
rubocop
|
7
8
|
thor (~> 0.19)
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
13
|
+
ast (2.3.0)
|
12
14
|
coderay (1.1.0)
|
13
15
|
diff-lcs (1.2.5)
|
14
16
|
ffi (1.9.10)
|
15
17
|
gem-release (0.7.3)
|
16
18
|
json (1.8.1)
|
17
|
-
listen (3.0.
|
18
|
-
rb-fsevent (>= 0.9.
|
19
|
-
rb-inotify (>= 0.9)
|
19
|
+
listen (3.0.8)
|
20
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
21
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
20
22
|
method_source (0.8.2)
|
21
23
|
mini_check (0.2.0)
|
22
24
|
json
|
25
|
+
parser (2.3.1.2)
|
26
|
+
ast (~> 2.2)
|
27
|
+
powerpack (0.1.1)
|
23
28
|
pry (0.10.1)
|
24
29
|
coderay (~> 1.1.0)
|
25
30
|
method_source (~> 0.8.1)
|
26
31
|
slop (~> 3.4)
|
27
|
-
puma (3.
|
32
|
+
puma (3.4.0)
|
28
33
|
rack (1.5.2)
|
29
34
|
rack-test (0.6.2)
|
30
35
|
rack (>= 1.0)
|
36
|
+
rainbow (2.1.0)
|
31
37
|
rake (10.4.2)
|
32
38
|
rb-fsevent (0.9.7)
|
33
|
-
rb-inotify (0.9.
|
39
|
+
rb-inotify (0.9.7)
|
34
40
|
ffi (>= 0.5.0)
|
35
41
|
rerun (0.11.0)
|
36
42
|
listen (~> 3.0)
|
@@ -46,8 +52,16 @@ GEM
|
|
46
52
|
rspec-mocks (3.1.3)
|
47
53
|
rspec-support (~> 3.1.0)
|
48
54
|
rspec-support (3.1.2)
|
55
|
+
rubocop (0.41.1)
|
56
|
+
parser (>= 2.3.1.1, < 3.0)
|
57
|
+
powerpack (~> 0.1)
|
58
|
+
rainbow (>= 1.99.1, < 3.0)
|
59
|
+
ruby-progressbar (~> 1.7)
|
60
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
61
|
+
ruby-progressbar (1.8.1)
|
49
62
|
slop (3.6.0)
|
50
63
|
thor (0.19.1)
|
64
|
+
unicode-display_width (1.1.0)
|
51
65
|
|
52
66
|
PLATFORMS
|
53
67
|
ruby
|
data/lib/mini_cli/base_module.rb
CHANGED
data/lib/mini_cli/version.rb
CHANGED
data/mini_cli.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency 'thor', '~> 0.19'
|
24
24
|
spec.add_runtime_dependency 'rerun', '~> 0.10'
|
25
25
|
spec.add_runtime_dependency 'puma', '> 2.10', '< 4.0.0'
|
26
|
+
spec.add_runtime_dependency 'rubocop'
|
26
27
|
|
27
28
|
spec.add_development_dependency "bundler", "~> 1.3"
|
28
29
|
spec.add_development_dependency "rake", '~> 10.4'
|
data/spec/mini_cli/base_spec.rb
CHANGED
@@ -2,70 +2,92 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
describe Base do
|
4
4
|
let(:cli){ Base.new }
|
5
|
+
before { allow(cli).to receive(:exit) }
|
6
|
+
|
7
|
+
def do_run
|
8
|
+
cli.invoke_command cli.class.all_commands[args.first], args[1..-1]
|
9
|
+
end
|
5
10
|
|
6
11
|
describe '#test' do
|
7
|
-
|
12
|
+
let(:args) { %w{test} }
|
8
13
|
|
9
14
|
it 'runs the RSpec suite' do
|
10
15
|
expect(RSpec::Core::Runner).to receive(:run)
|
11
|
-
|
16
|
+
do_run
|
12
17
|
end
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
describe 'with args' do
|
20
|
+
let(:args) { %w{test random args} }
|
21
|
+
|
22
|
+
it 'passes args to RSpec' do
|
23
|
+
expect(RSpec::Core::Runner).to receive(:run).with(['random','args'])
|
24
|
+
do_run
|
25
|
+
end
|
17
26
|
end
|
18
27
|
|
19
28
|
it 'passes ["spec"] if no args are specified' do
|
20
29
|
expect(RSpec::Core::Runner).to receive(:run).with(['spec'])
|
21
|
-
|
30
|
+
do_run
|
22
31
|
end
|
23
32
|
|
24
33
|
it 'exits with the returned status code' do
|
25
34
|
expect(RSpec::Core::Runner).to receive(:run).and_return 99
|
26
35
|
expect(cli).to receive(:exit).with 99
|
27
|
-
|
36
|
+
do_run
|
28
37
|
end
|
29
38
|
end
|
30
39
|
|
31
40
|
describe '#console' do
|
41
|
+
let(:args) { %w{console} }
|
42
|
+
|
32
43
|
it 'runs pry' do
|
33
44
|
expect(Pry).to receive(:start)
|
34
|
-
|
45
|
+
do_run
|
35
46
|
end
|
36
47
|
end
|
37
48
|
|
38
49
|
describe '#start' do
|
39
50
|
before(:all){ require 'puma/cli' }
|
51
|
+
let(:args) { %w{start} }
|
40
52
|
|
41
53
|
it 'runs a Puma server' do
|
42
54
|
a_puma = double('a puma')
|
43
55
|
expect(Puma::CLI).to receive(:new).with(['-p', '22000']).and_return a_puma
|
44
56
|
expect(a_puma).to receive(:run)
|
45
|
-
|
57
|
+
do_run
|
46
58
|
end
|
47
59
|
end
|
48
60
|
|
49
61
|
describe '#auto' do
|
50
62
|
before(:all){ require 'rerun' }
|
63
|
+
let(:args) { %w{auto sample command} }
|
51
64
|
|
52
65
|
it 'launches rerun with the given command' do
|
53
66
|
expect(Rerun::Runner).to receive(:keep_running) do |command, options|
|
54
67
|
expect(command).to eq './cli sample command'
|
55
68
|
end
|
56
|
-
|
69
|
+
|
70
|
+
do_run
|
57
71
|
end
|
58
72
|
end
|
59
73
|
|
60
74
|
describe '#rubocop' do
|
61
75
|
before(:all){ require 'rubocop' }
|
76
|
+
let(:args) { %w{rubocop some args} }
|
62
77
|
|
63
|
-
it 'runs
|
78
|
+
it 'runs rubocop' do
|
64
79
|
a_cop = double('rubocop')
|
65
80
|
expect(RuboCop::CLI).to receive(:new).and_return a_cop
|
66
81
|
expect(a_cop).to receive(:run).and_return 99
|
67
82
|
expect(cli).to receive(:exit).with 99
|
68
|
-
|
83
|
+
do_run
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'passes the args' do
|
87
|
+
a_cop = double('rubocop')
|
88
|
+
expect(RuboCop::CLI).to receive(:new).and_return a_cop
|
89
|
+
expect(a_cop).to receive(:run).with(['some', 'args'])
|
90
|
+
do_run
|
69
91
|
end
|
70
92
|
end
|
71
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Morales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 4.0.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rubocop
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: bundler
|
63
77
|
requirement: !ruby/object:Gem::Requirement
|