dpl 1.5.2.travis.193.2 → 1.5.2.travis.194.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjAxODdiNjNjYmU3NDBhY2UxYzQxNzM4ZTg0OTIwMzdkNDhjZTVjMA==
4
+ ODQ4N2MxODI1MDMyYjEwYWRiZjI0NDI1ZWFjMzA4MDM3OGRhOThlYQ==
5
5
  data.tar.gz: !binary |-
6
- M2ZmM2YyMTVlMDNkOTU5ZGI1MzlhNWZkOGNjZmJkMDE3ZWY5MDNiZQ==
6
+ MWI4MTNmZThiMjExYjJlMzI5MmE1NmQ0NDNlYWNiMzk3ODkxMGM4Ng==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzA2M2RkODE1ZjhlNjJkYjkzMzJjOTFkNWY0ZDExOThiMDVkOWFmZjA4ZDc3
10
- YzU5OTcxMTM2YTU0YjY3ZGVhNjM0NjA0ODA5YTUwNmYwYmJlMGZjYTViOTc1
11
- ZDE0YTE5MjQyMmM0MDAyNGUxOTdjOTRjYzMzZjkzZTllMDFkYzY=
9
+ MDg3MDVjNThmZWQyMzM3ZGU3NTY0ODFmMzFlMzU4ZGNjZjJiNmE3NWNlOWUy
10
+ NGZhOTgxYjg1ZjM2MzIyNTE5NjA0ZWJjNDVkMTY0OWVhZTcwZTU2NDI1Mzcy
11
+ OGY1MWUwMmU4N2NhMDQwYTc2ZTQwZThmZWRlMGExOGNiYjU1YzQ=
12
12
  data.tar.gz: !binary |-
13
- OGRhNDAwZWI3YzEwMWUyYzJkNzdjYmM3ODdmNDgwZjg3NWI1NmQ4MTM2OTJi
14
- OTk0YzdkN2EwNzEzOTc5OTg0NmNjZDU2ODQ4OWY0ODE5YzdlNzlmMTQ1MGQx
15
- NmNiNDRjNWIyNTY1NWM2YzhkY2ZhYTkwNDAyODk1YTcwMGRhODk=
13
+ NDc3NGQxOWU0ZWZhYjMzZjBjYjRiYjU4ZTA3ODBlZjBkMzg3NDMzNWUwOWI4
14
+ MGEzNjVmOTFjMDI5M2M1NzVhZjRlYjU5ODAyZDQ3MDQzM2IxZDhiZTIwMmQ4
15
+ ZDllYjk3ZjhmOTRhZWYwMTM2YmZhODcyZTBlMTU3YTRmNzMyYmM=
data/lib/dpl/provider.rb CHANGED
@@ -37,7 +37,7 @@ module DPL
37
37
  load = options[:load] || name
38
38
  gem(name, version)
39
39
  rescue LoadError
40
- context.shell("gem install %s -v %p" % [name, version])
40
+ context.shell("gem install %s -v %p" % [name, version], retry: true)
41
41
  Gem.clear_paths
42
42
  ensure
43
43
  require load
@@ -47,16 +47,17 @@ module DPL
47
47
  self
48
48
  end
49
49
 
50
- def self.shell(command)
50
+ def self.shell(command, options = {})
51
+ command = "travis_retry #{command}" if options[:retry]
51
52
  system(command)
52
53
  end
53
54
 
54
55
  def self.pip(name, command = name)
55
- context.shell "sudo pip install #{name}" if `which #{command}`.chop.empty?
56
+ context.shell("sudo pip install #{name}", retry: true) if `which #{command}`.chop.empty?
56
57
  end
57
58
 
58
59
  def self.npm_g(name, command = name)
59
- context.shell "npm install -g #{name}" if `which #{command}`.chop.empty?
60
+ context.shell("npm install -g #{name}", retry: true) if `which #{command}`.chop.empty?
60
61
  end
61
62
 
62
63
  attr_reader :context, :options
@@ -26,7 +26,7 @@ describe DPL::Provider do
26
26
 
27
27
  example "missing" do
28
28
  example_provider.should_receive(:gem).with("foo", "~> 1.4").and_raise(LoadError)
29
- example_provider.context.should_receive(:shell).with('gem install foo -v "~> 1.4"')
29
+ example_provider.context.should_receive(:shell).with('gem install foo -v "~> 1.4"', retry: true)
30
30
  example_provider.requires("foo", :version => "~> 1.4")
31
31
  end
32
32
  end
@@ -40,7 +40,7 @@ describe DPL::Provider do
40
40
 
41
41
  example "missing" do
42
42
  example_provider.should_receive(:`).with("which foo").and_return("")
43
- example_provider.context.should_receive(:shell).with("sudo pip install foo")
43
+ example_provider.context.should_receive(:shell).with("sudo pip install foo", retry: true)
44
44
  example_provider.pip("foo")
45
45
  end
46
46
  end
@@ -120,15 +120,19 @@ describe DPL::Provider do
120
120
  end
121
121
 
122
122
  describe :shell do
123
- example do
123
+ example "without any options" do
124
124
  example_provider.should_receive(:system).with("command")
125
125
  example_provider.shell("command")
126
126
  end
127
+ example "with retry: true" do
128
+ example_provider.should_receive(:system).with("travis_retry command")
129
+ example_provider.shell("command", retry: true)
130
+ end
127
131
  end
128
132
 
129
133
  describe :npm_g do
130
134
  example do
131
- example_provider.context.should_receive(:shell).with("npm install -g foo")
135
+ example_provider.context.should_receive(:shell).with("npm install -g foo", retry: true)
132
136
  example_provider.npm_g("foo")
133
137
  end
134
138
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2.travis.193.2
4
+ version: 1.5.2.travis.194.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-25 00:00:00.000000000 Z
11
+ date: 2013-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec