ripple-cli 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTE0ZGViNjk4OTliZDk4Yzg5YzExODUwYzc3MGFkNzFhMDdjNjI0OQ==
5
+ data.tar.gz: !binary |-
6
+ NWViYmViNWVhNDY0ZTFlMDI4ODNmYzM0YTA4MDQ1MmQ3NzExOWQ3OA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YzIxNDJmZGFhZTkyOTQ1ODVmZDMxNzRlYzRlZDY5YTAwZDU5NDQ0YTllMGUy
10
+ YjRjNzAzZTIyM2E3MDM2YThhYjdjZGVhYWJkZTYxYTJmZjkxMDdjZGU3ODNl
11
+ ZjIwMzk4YWU4OTZiMjFmODE2OTdhNjgyZmJjYjRmZGZlY2FiYzI=
12
+ data.tar.gz: !binary |-
13
+ NGVlZTZmNWQ2MjIxY2E5YjVmNGI3ZTlkOTA2NmIwMjU5ZDcyMTc2NGJjODZm
14
+ NjM0NTBiZjdiNmUwMTQ0OTcyZTRhMDkxNmZkYTFiNWRlYzlmZWU0ZGUzYTE3
15
+ OTU4ZjhiZWNjNjVkMjVmOTIzMGIxMDk0ODVhMGM5Njg1NzQyNDk=
@@ -0,0 +1,15 @@
1
+ module Ripple
2
+ class Engine
3
+ def execute
4
+ system("#{RIPPLE_EXE} #{command} #{build_args}")
5
+ end
6
+
7
+ def command
8
+ throw 'Command to be implemented'
9
+ end
10
+
11
+ def build_args
12
+ throw 'Args to be implemented'
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ module Ripple
2
+ class Restore < Engine
3
+
4
+ attr_accessor :feeds, :force, :solution, :cache, :all_solutions, :verbose
5
+
6
+ def command
7
+ 'restore'
8
+ end
9
+
10
+ def build_args
11
+ args = ''
12
+
13
+ args = "#{args} --feeds \"#{@feeds.join('#')}\"" unless @feeds.nil? or @feeds.length < 1
14
+ args = "#{args} --force" if @force
15
+ args = "#{args} --cache \"#{@cache}\"" unless @cache.nil? or @cache.empty?
16
+
17
+ if @all_solutions
18
+ args = "#{args} --all"
19
+ else
20
+ args = "#{args} --solution \"#{@solution}\"" unless @solution.nil? or @solution.empty?
21
+ end
22
+
23
+ args = "#{args} --verbose" if @verbose
24
+
25
+ args.strip
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,29 @@
1
1
  module Ripple
2
- class Update
2
+ class Update < Engine
3
3
 
4
- def update
5
- system("#{RIPPLE_EXE} update")
4
+ attr_accessor :nuget, :preview, :force, :solution, :cache, :all_solutions, :verbose
5
+
6
+ def command
7
+ 'update'
8
+ end
9
+
10
+ def build_args
11
+ args = ''
12
+
13
+ args = "#{args} --nuget \"#{@nuget}\"" unless @nuget.nil? or @nuget.empty?
14
+ args = "#{args} --preview" if @preview
15
+ args = "#{args} --force" if @force
16
+ args = "#{args} --cache \"#{@cache}\"" unless @cache.nil? or @cache.empty?
17
+
18
+ if @all_solutions
19
+ args = "#{args} --all"
20
+ else
21
+ args = "#{args} --solution \"#{@solution}\"" unless @solution.nil? or @solution.empty?
22
+ end
23
+
24
+ args = "#{args} --verbose" if @verbose
25
+
26
+ args.strip
6
27
  end
7
28
 
8
29
  end
@@ -1,3 +1,3 @@
1
- module Ripple
2
- VERSION = '0.0.5'
3
- end
1
+ module Ripple
2
+ VERSION = '0.0.6'
3
+ end
@@ -0,0 +1,99 @@
1
+ require 'ripple-cli'
2
+
3
+ module Ripple
4
+ describe Restore do
5
+ subject { Restore.new }
6
+
7
+ describe '#build_args' do
8
+ context 'with nil feeds' do
9
+ it { subject.build_args.should eq '' }
10
+ end
11
+
12
+ context 'with no feeds' do
13
+ before { subject.feeds = [] }
14
+ it { subject.build_args.should eq '' }
15
+ end
16
+
17
+ context 'with one feed' do
18
+ before { subject.feeds = ['feed1'] }
19
+ it { subject.build_args.should eq '--feeds "feed1"' }
20
+ end
21
+
22
+ context 'with multipe feeds' do
23
+ before { subject.feeds = ['feed1', 'feed2'] }
24
+ it { subject.build_args.should eq '--feeds "feed1#feed2"' }
25
+ end
26
+
27
+ context 'force no' do
28
+ before { subject.force = false }
29
+ it { subject.build_args.should eq '' }
30
+ end
31
+
32
+ context 'force yes' do
33
+ before { subject.force = true }
34
+ it { subject.build_args.should eq '--force' }
35
+ end
36
+
37
+ context 'with nil cache' do
38
+ it { subject.build_args.should eq '' }
39
+ end
40
+
41
+ context 'with empty cache' do
42
+ before { subject.cache = '' }
43
+ it { subject.build_args.should eq '' }
44
+ end
45
+
46
+ context 'with cache' do
47
+ before { subject.cache = 'some/cache' }
48
+ it { subject.build_args.should eq '--cache "some/cache"' }
49
+ end
50
+
51
+ context 'not for all solutions' do
52
+ before { subject.all_solutions = false }
53
+ it { subject.build_args.should eq '' }
54
+ end
55
+
56
+ context 'for all solutions' do
57
+ before { subject.all_solutions = true }
58
+ it { subject.build_args.should eq '--all' }
59
+ end
60
+
61
+ context 'for specific solution' do
62
+ before { subject.solution = 'some/solution' }
63
+ it { subject.build_args.should eq '--solution "some/solution"' }
64
+ end
65
+
66
+ context 'for specific solution and all solutions' do
67
+ before {
68
+ subject.solution = 'some/solution'
69
+ subject.all_solutions = true
70
+ }
71
+ it { subject.build_args.should eq '--all' }
72
+ end
73
+
74
+ context 'no solution specified' do
75
+ it { subject.build_args.should eq '' }
76
+ end
77
+
78
+ context 'verbose no' do
79
+ it { subject.build_args.should eq '' }
80
+ end
81
+
82
+ context 'verbose yes' do
83
+ before { subject.verbose = true }
84
+ it { subject.build_args.should eq '--verbose' }
85
+ end
86
+
87
+ context 'with feeds, force, cache, all, and verbose' do
88
+ before {
89
+ subject.feeds = ['feed1', 'feed2']
90
+ subject.force = true
91
+ subject.cache = 'some/cache'
92
+ subject.all_solutions = true
93
+ subject.verbose = true
94
+ }
95
+ it { subject.build_args.should eq '--feeds "feed1#feed2" --force --cache "some/cache" --all --verbose' }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,105 @@
1
+ require 'ripple-cli'
2
+
3
+ module Ripple
4
+ describe Update do
5
+ subject { Update.new }
6
+
7
+ describe '#build_args' do
8
+ context 'with nil nuget' do
9
+ it { subject.build_args.should eq '' }
10
+ end
11
+
12
+ context 'with empty nuget' do
13
+ before { subject.nuget = '' }
14
+ it { subject.build_args.should eq '' }
15
+ end
16
+
17
+ context 'with nuget' do
18
+ before { subject.nuget = 'some.nuget' }
19
+ it { subject.build_args.should eq '--nuget "some.nuget"' }
20
+ end
21
+
22
+ context 'preview no' do
23
+ before { subject.preview = false }
24
+ it { subject.build_args.should eq '' }
25
+ end
26
+
27
+ context 'preview yes' do
28
+ before { subject.preview = true }
29
+ it { subject.build_args.should eq '--preview' }
30
+ end
31
+
32
+ context 'force no' do
33
+ before { subject.force = false }
34
+ it { subject.build_args.should eq '' }
35
+ end
36
+
37
+ context 'force yes' do
38
+ before { subject.force = true }
39
+ it { subject.build_args.should eq '--force' }
40
+ end
41
+
42
+ context 'with nil cache' do
43
+ it { subject.build_args.should eq '' }
44
+ end
45
+
46
+ context 'with empty cache' do
47
+ before { subject.cache = '' }
48
+ it { subject.build_args.should eq '' }
49
+ end
50
+
51
+ context 'with cache' do
52
+ before { subject.cache = 'some/cache' }
53
+ it { subject.build_args.should eq '--cache "some/cache"' }
54
+ end
55
+
56
+ context 'not for all solutions' do
57
+ before { subject.all_solutions = false }
58
+ it { subject.build_args.should eq '' }
59
+ end
60
+
61
+ context 'for all solutions' do
62
+ before { subject.all_solutions = true }
63
+ it { subject.build_args.should eq '--all' }
64
+ end
65
+
66
+ context 'for specific solution' do
67
+ before { subject.solution = 'some/solution' }
68
+ it { subject.build_args.should eq '--solution "some/solution"' }
69
+ end
70
+
71
+ context 'for specific solution and all solutions' do
72
+ before {
73
+ subject.solution = 'some/solution'
74
+ subject.all_solutions = true
75
+ }
76
+ it { subject.build_args.should eq '--all' }
77
+ end
78
+
79
+ context 'no solution specified' do
80
+ it { subject.build_args.should eq '' }
81
+ end
82
+
83
+ context 'verbose no' do
84
+ it { subject.build_args.should eq '' }
85
+ end
86
+
87
+ context 'verbose yes' do
88
+ before { subject.verbose = true }
89
+ it { subject.build_args.should eq '--verbose' }
90
+ end
91
+
92
+ context 'with feeds, force, cache, all, and verbose' do
93
+ before {
94
+ subject.nuget = 'some.nuget'
95
+ subject.preview = true
96
+ subject.force = true
97
+ subject.cache = 'some/cache'
98
+ subject.all_solutions = true
99
+ subject.verbose = true
100
+ }
101
+ it { subject.build_args.should eq '--nuget "some.nuget" --preview --force --cache "some/cache" --all --verbose' }
102
+ end
103
+ end
104
+ end
105
+ end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripple-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matt Smith
@@ -32,31 +31,34 @@ files:
32
31
  - bin/ripple_exe/Nuget.Core.dll
33
32
  - bin/ripple_exe/ripple.exe
34
33
  - lib/ripple-cli.rb
34
+ - lib/ripple-cli/engine.rb
35
+ - lib/ripple-cli/restore.rb
35
36
  - lib/ripple-cli/update.rb
36
37
  - lib/ripple-cli/version.rb
37
38
  - ripple-cli.gemspec
39
+ - specs/ripple-cli/restore_spec.rb
40
+ - specs/ripple-cli/update_spec.rb
38
41
  homepage: ''
39
42
  licenses: []
43
+ metadata: {}
40
44
  post_install_message:
41
45
  rdoc_options: []
42
46
  require_paths:
43
47
  - lib
44
48
  required_ruby_version: !ruby/object:Gem::Requirement
45
- none: false
46
49
  requirements:
47
50
  - - ! '>='
48
51
  - !ruby/object:Gem::Version
49
52
  version: '0'
50
53
  required_rubygems_version: !ruby/object:Gem::Requirement
51
- none: false
52
54
  requirements:
53
55
  - - ! '>='
54
56
  - !ruby/object:Gem::Version
55
57
  version: '0'
56
58
  requirements: []
57
59
  rubyforge_project:
58
- rubygems_version: 1.8.24
60
+ rubygems_version: 2.0.3
59
61
  signing_key:
60
- specification_version: 3
62
+ specification_version: 4
61
63
  summary: installs the command line tool ripple
62
64
  test_files: []