dpl 1.3.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89c640c930c9915969567ebf511d6fbfde5e8b29
4
- data.tar.gz: 9f2b6981800149725197834bb4f1698f974aeb47
3
+ metadata.gz: a6bbfb94ff725ea7532c2291f601afd4507bece0
4
+ data.tar.gz: bbf52c38299e4205b9340b242ff1f4c28235d1a8
5
5
  SHA512:
6
- metadata.gz: 4e01c0f62d71f9ff22fa98af2fdcc3dc855b5171cc52f911a8decb8a32c531228e30c868eae728f1e352fa503e15ad53187ea5cdfe0ce2c80d170694203e1bc4
7
- data.tar.gz: c37019e0dad67e83b74301625a10120ded91e2fb4dc20400c31e86f24c9a41e88074e1854bd092be517ec4ea6560252533e9482fca4ed5c3437424986c078577
6
+ metadata.gz: ac76b03568e99c06dd3ea3cba2cc3ed5113de198e3cb23669aba2251384b2a6d71acea6947d5ab9251d722c6967c410d58e66bfb2baedb8ac80faba19f0b098e
7
+ data.tar.gz: 8fb70d1e14c0f71d1879b0696e4c173e7c7ec3b524a69f78c4edc3474b2453813acc189a2477dc31afe1d216d9cbb8d287fe1bcc844519b20e5e547faa4b1a8b
@@ -9,6 +9,7 @@ module DPL
9
9
  autoload :EngineYard, 'dpl/provider/engine_yard'
10
10
  autoload :DotCloud, 'dpl/provider/dot_cloud'
11
11
  autoload :Nodejitsu, 'dpl/provider/nodejitsu'
12
+ autoload :Openshift, 'dpl/provider/openshift'
12
13
 
13
14
  def self.new(context, options)
14
15
  return super if self < Provider
@@ -44,7 +45,7 @@ module DPL
44
45
  end
45
46
 
46
47
  def self.pip(name, command = name)
47
- context.shell "pip install #{name}" if `which #{command}`.chop.empty?
48
+ context.shell "sudo pip install #{name}" if `which #{command}`.chop.empty?
48
49
  end
49
50
 
50
51
  def self.npm_g(name, command = name)
@@ -9,7 +9,7 @@ module DPL
9
9
  end
10
10
 
11
11
  def check_app
12
- `dotcloud connect #{option(:app)}`
12
+ context.shell "dotcloud connect #{option(:app)}"
13
13
  end
14
14
 
15
15
  def needs_key?
@@ -17,13 +17,13 @@ module DPL
17
17
  end
18
18
 
19
19
  def push_app
20
- `dotcloud push #{option(:app)}`
20
+ context.shell "dotcloud push #{option(:app)}"
21
21
  end
22
22
 
23
23
  def run(command)
24
24
  service = options[:instance] || options[:service] || 'www'
25
- `dotcloud -A #{option(:app)} #{service} #{command}`
25
+ context.shell "dotcloud -A #{option(:app)} #{service} #{command}"
26
26
  end
27
27
  end
28
28
  end
29
- end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module DPL
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'dpl/provider/dot_cloud'
3
+
4
+ describe DPL::Provider::DotCloud do
5
+ subject :provider do
6
+ described_class.new(DummyContext.new, :app => 'example', :api_key => 'foo')
7
+ end
8
+
9
+ describe :check_auth do
10
+ example do
11
+ provider.context.should_receive(:shell).with("echo foo | dotcloud setup --api-key")
12
+ provider.check_auth
13
+ end
14
+ end
15
+
16
+ describe :check_app do
17
+ example do
18
+ provider.context.should_receive(:shell).with("dotcloud connect example")
19
+ provider.check_app
20
+ end
21
+ end
22
+
23
+ describe :needs_key? do
24
+ example do
25
+ provider.needs_key?.should == false
26
+ end
27
+ end
28
+
29
+ describe :push_app do
30
+ example do
31
+ provider.context.should_receive(:shell).with("dotcloud push example")
32
+ provider.push_app
33
+ end
34
+ end
35
+
36
+ describe :run do
37
+ example do
38
+ provider.context.should_receive(:shell).with("dotcloud -A example www test")
39
+ provider.run("test")
40
+ end
41
+ end
42
+ end
@@ -41,7 +41,7 @@ describe DPL::Provider do
41
41
 
42
42
  example "missing" do
43
43
  example_provider.should_receive(:`).with("which foo").and_return("")
44
- example_provider.context.should_receive(:shell).with("pip install foo")
44
+ example_provider.context.should_receive(:shell).with("sudo pip install foo")
45
45
  example_provider.pip("foo")
46
46
  end
47
47
  end
@@ -91,4 +91,4 @@ describe DPL::Provider do
91
91
  provider.log("foo")
92
92
  end
93
93
  end
94
- end
94
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -83,6 +83,7 @@ files:
83
83
  - notes/engine_yard.md
84
84
  - notes/heroku.md
85
85
  - spec/cli_spec.rb
86
+ - spec/provider/dotcloud_spec.rb
86
87
  - spec/provider/heroku_spec.rb
87
88
  - spec/provider/openshift_spec.rb
88
89
  - spec/provider_spec.rb
@@ -113,6 +114,7 @@ specification_version: 4
113
114
  summary: deploy tool
114
115
  test_files:
115
116
  - spec/cli_spec.rb
117
+ - spec/provider/dotcloud_spec.rb
116
118
  - spec/provider/heroku_spec.rb
117
119
  - spec/provider/openshift_spec.rb
118
120
  - spec/provider_spec.rb