shelly 0.2.7 → 0.2.8

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.
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
+ ## 0.2.8 / 2013-03-12
2
+
3
+ * Requires newer version of wijet-thor
4
+
1
5
  ## 0.2.7 / 2013-03-07
2
6
 
3
7
  * [bug] Checking presence of Rakefile and tasks (db:migrate and db:setup)
4
8
 
5
- ## 0.2.6 / 2013-03-06
9
+ ## 0.2.6 / 2013-03-06 yanked
6
10
 
7
11
  * [bug] Fixes issues with newer version of Thor gem (> 0.15.0)
8
12
 
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in shelly.gemspec
4
4
  gemspec
data/lib/shelly/app.rb CHANGED
@@ -10,7 +10,7 @@ module Shelly
10
10
 
11
11
  attr_accessor :code_name, :databases, :ruby_version, :environment,
12
12
  :git_url, :domains, :web_server_ip, :size, :thin, :redeem_code,
13
- :content, :organization
13
+ :content, :organization, :zone_name
14
14
 
15
15
  def initialize(code_name = nil, content = nil)
16
16
  self.code_name = code_name
@@ -45,7 +45,8 @@ module Shelly
45
45
  def create
46
46
  attributes = {:code_name => code_name,
47
47
  :redeem_code => redeem_code,
48
- :organization_name => organization}
48
+ :organization_name => organization,
49
+ :zone_name => zone_name}
49
50
  response = shelly.create_app(attributes)
50
51
  self.git_url = response["git_url"]
51
52
  self.domains = response["domains"]
@@ -85,6 +85,8 @@ module Shelly
85
85
  :desc => "Add cloud to existing organization"
86
86
  method_option "skip-requirements-check", :type => :boolean,
87
87
  :desc => "Skip Shelly Cloud requirements check"
88
+ method_option "zone", :type => :boolean, :hide => true,
89
+ :desc => "Create cloud in given zone"
88
90
  desc "add", "Add a new cloud"
89
91
  def add
90
92
  check_options(options)
@@ -97,6 +99,7 @@ module Shelly
97
99
  app.size = options["size"] || "large"
98
100
  app.redeem_code = options["redeem-code"]
99
101
  app.organization = options["organization"] || ask_for_organization(app.code_name)
102
+ app.zone_name = options["zone"]
100
103
  app.create
101
104
 
102
105
  if overwrite_remote?(app)
data/lib/shelly/client.rb CHANGED
@@ -98,7 +98,9 @@ module Shelly
98
98
 
99
99
  def create_app(attributes)
100
100
  organization = attributes.delete(:organization_name)
101
- post("/apps", :app => attributes, :organization_name => organization)
101
+ zone = attributes.delete(:zone_name)
102
+ post("/apps", :app => attributes, :organization_name => organization,
103
+ :zone_name => zone)
102
104
  end
103
105
 
104
106
  def delete_app(code_name)
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
data/lib/thor/options.rb CHANGED
@@ -15,10 +15,3 @@ class Thor
15
15
  end
16
16
  end
17
17
  end
18
-
19
-
20
- def check_unknown!
21
- raise UnknownArgumentError, "shelly: unrecognized option '#{@unknown.join(', ')}'\n" +
22
- "Usage: shelly [COMMAND]... [OPTIONS]\n" +
23
- "Try 'shelly --help' for more information" unless @unknown.empty?
24
- end
data/shelly.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  end
24
24
  s.add_development_dependency "fakefs"
25
25
  s.add_development_dependency "fakeweb"
26
- s.add_runtime_dependency "wijet-thor", "~> 0.14.7"
26
+ s.add_runtime_dependency "wijet-thor", "~> 0.14.9"
27
27
  s.add_runtime_dependency "rest-client"
28
28
  s.add_runtime_dependency "json"
29
29
  s.add_runtime_dependency "progressbar"
@@ -267,7 +267,8 @@ describe Shelly::App do
267
267
  attributes = {
268
268
  :code_name => "fooo",
269
269
  :redeem_code => "foo123",
270
- :organization_name => nil
270
+ :organization_name => nil,
271
+ :zone_name => nil
271
272
  }
272
273
  @client.should_receive(:create_app).with(attributes).and_return("git_url" => "git@git.shellycloud.com:fooo.git",
273
274
  "domains" => %w(fooo.shellyapp.com))
@@ -347,6 +347,14 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
347
347
  @main.options = {"code-name" => "foo", "databases" => ["postgresql"], "size" => "large"}
348
348
  invoke(@main, :add)
349
349
  end
350
+
351
+ it "should use zone from option" do
352
+ @app.should_receive(:zone_name=).with('eu1')
353
+ @main.options = {"zone" => "eu1"}
354
+ fake_stdin(["mycodename", ""]) do
355
+ invoke(@main, :add)
356
+ end
357
+ end
350
358
  end
351
359
  end
352
360
 
@@ -165,15 +165,17 @@ describe Shelly::Client do
165
165
 
166
166
  describe "#create_app" do
167
167
  it "should send post with app's attributes" do
168
- @client.should_receive(:post).with("/apps", :app => {:code_name => "foo", :ruby_version => "1.9.2"}, :organization_name => nil)
168
+ @client.should_receive(:post).with("/apps", :app => {:code_name => "foo",
169
+ :ruby_version => "1.9.2"}, :organization_name => nil, :zone_name => nil)
169
170
  @client.create_app(:code_name => "foo", :ruby_version => "1.9.2")
170
171
  end
171
172
 
172
173
  it "should send post with app's attributes and organization name" do
173
- @client.should_receive(:post).with("/apps", :app => {:code_name => "foo", :ruby_version => "1.9.2"}, :organization_name => "foo")
174
- @client.create_app(:code_name => "foo", :ruby_version => "1.9.2", :organization_name => "foo")
174
+ @client.should_receive(:post).with("/apps", :app => {:code_name => "foo",
175
+ :ruby_version => "1.9.2"}, :organization_name => "foo", :zone_name => 'eu1')
176
+ @client.create_app(:code_name => "foo", :ruby_version => "1.9.2",
177
+ :organization_name => "foo", :zone_name => "eu1")
175
178
  end
176
-
177
179
  end
178
180
 
179
181
  describe "#organizations" do
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,9 @@ if ENV["COVERAGE"]
3
3
  SimpleCov.start
4
4
  end
5
5
 
6
+ # Psych is required here to make sure it will be used as default
7
+ # yaml engine when running tests (required by cloudfile_spec:49)
8
+ require 'psych' if RUBY_VERSION >= "1.9"
6
9
  require "rspec"
7
10
  require "shelly"
8
11
  require "helpers"
@@ -10,7 +13,6 @@ require "input_faker"
10
13
  require "fakefs/spec_helpers"
11
14
  require "fakeweb"
12
15
  require "launchy"
13
- require "rake"
14
16
 
15
17
  ENV['THOR_COLUMNS'] = "180"
16
18
  FakeWeb.allow_net_connect = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -91,6 +91,38 @@ dependencies:
91
91
  - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: ruby_gntp
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rb-fsevent
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
94
126
  - !ruby/object:Gem::Dependency
95
127
  name: fakefs
96
128
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +162,7 @@ dependencies:
130
162
  requirements:
131
163
  - - ~>
132
164
  - !ruby/object:Gem::Version
133
- version: 0.14.7
165
+ version: 0.14.9
134
166
  type: :runtime
135
167
  prerelease: false
136
168
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +170,7 @@ dependencies:
138
170
  requirements:
139
171
  - - ~>
140
172
  - !ruby/object:Gem::Version
141
- version: 0.14.7
173
+ version: 0.14.9
142
174
  - !ruby/object:Gem::Dependency
143
175
  name: rest-client
144
176
  requirement: !ruby/object:Gem::Requirement
@@ -285,7 +317,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
285
317
  version: '0'
286
318
  segments:
287
319
  - 0
288
- hash: -626297834617784665
320
+ hash: -3129673927878389756
289
321
  required_rubygems_version: !ruby/object:Gem::Requirement
290
322
  none: false
291
323
  requirements:
@@ -294,11 +326,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
326
  version: '0'
295
327
  segments:
296
328
  - 0
297
- hash: -626297834617784665
329
+ hash: -3129673927878389756
298
330
  requirements: []
299
331
  rubyforge_project: shelly
300
- rubygems_version: 1.8.24
332
+ rubygems_version: 1.8.25
301
333
  signing_key:
302
334
  specification_version: 3
303
335
  summary: Shelly Cloud command line tool
304
- test_files: []
336
+ test_files:
337
+ - spec/helpers.rb
338
+ - spec/input_faker.rb
339
+ - spec/shelly/app_spec.rb
340
+ - spec/shelly/backup_spec.rb
341
+ - spec/shelly/cli/backup_spec.rb
342
+ - spec/shelly/cli/config_spec.rb
343
+ - spec/shelly/cli/deploy_spec.rb
344
+ - spec/shelly/cli/file_spec.rb
345
+ - spec/shelly/cli/main_spec.rb
346
+ - spec/shelly/cli/organization_spec.rb
347
+ - spec/shelly/cli/runner_spec.rb
348
+ - spec/shelly/cli/user_spec.rb
349
+ - spec/shelly/client_spec.rb
350
+ - spec/shelly/cloudfile_spec.rb
351
+ - spec/shelly/download_progress_bar_spec.rb
352
+ - spec/shelly/model_spec.rb
353
+ - spec/shelly/organization_spec.rb
354
+ - spec/shelly/structure_validator_spec.rb
355
+ - spec/shelly/user_spec.rb
356
+ - spec/spec_helper.rb
357
+ - spec/thor/options_spec.rb