shelly 0.3.8 → 0.4.0.pre

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGM5NmViNjFlMWRiMzQ2OWRhMmRmNjdmZjA2OTc3YmI0M2JmYWUxNg==
5
+ data.tar.gz: !binary |-
6
+ N2RlN2M5NzMyMjNmNjcyMjdhMzFlMThiOGQzZWE5NDBlMjBmNzUzZg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OGM5NGFjMTY5MWYyZWI1MmU4MmQ0NWU3Nzc0ZWJhNDEwMzViZWFiMzBlZjhl
10
+ NGRlMmRmZTc1NjZkMTM1ZTM4MmU1ZTcwMDFlYTQ3M2VlNWUyOWEzN2UwNWE0
11
+ NjdjYzRmYTczYjFkNzZlYTNmMDE2ZmQ0YjkzOTM3ZWVhZDFmN2I=
12
+ data.tar.gz: !binary |-
13
+ ZGQxNThkYTZjMTgxNGFkYzAzNGJhNGNlY2RkZDM0NWNkMTljOWM0N2UwYWYy
14
+ M2YxNTlmNmM2ZTkwMGM3OTA0OTZhZTdmZjk0NjZjNWJmNGVlMjZhM2IzODJj
15
+ YWM0ZmEyY2E2ZjY5N2U2ZmM2ZWQ3NmY4MGY0MTRmZjc5Y2NmYzg=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.0.pre / 2013-08-12
2
+
3
+ * [feature] Added `shelly organization add` to create new organizations
4
+ * [improvement] Create organization and cloud separately
5
+
1
6
  ## 0.3.8 / 2013-08-05
2
7
 
3
8
  * [bugfix] Show proper path when asking to delete configuration file
data/lib/shelly/app.rb CHANGED
@@ -9,8 +9,8 @@ module Shelly
9
9
  SERVER_SIZES = %w(small large)
10
10
 
11
11
  attr_accessor :code_name, :databases, :ruby_version, :environment,
12
- :git_url, :domains, :web_server_ip, :size, :thin, :redeem_code,
13
- :content, :organization, :zone_name
12
+ :git_url, :domains, :web_server_ip, :size, :thin, :content,
13
+ :organization_name, :zone_name
14
14
 
15
15
  def initialize(code_name = nil, content = nil)
16
16
  self.code_name = code_name
@@ -62,8 +62,7 @@ module Shelly
62
62
 
63
63
  def create
64
64
  attributes = {:code_name => code_name,
65
- :redeem_code => redeem_code,
66
- :organization_name => organization,
65
+ :organization_name => organization_name,
67
66
  :zone_name => zone_name}
68
67
  response = shelly.create_app(attributes)
69
68
  assign_attributes(response)
@@ -164,10 +163,6 @@ module Shelly
164
163
  shelly.deployment(code_name, deployment_id)
165
164
  end
166
165
 
167
- def self.code_name_from_dir_name
168
- "#{File.basename(Dir.pwd)}".downcase.dasherize
169
- end
170
-
171
166
  def configs
172
167
  @configs ||= shelly.app_configs(code_name)
173
168
  end
@@ -253,7 +248,7 @@ module Shelly
253
248
  end
254
249
 
255
250
  def edit_billing_url
256
- "#{shelly.shellyapp_url}/organizations/#{organization || code_name}/edit"
251
+ "#{shelly.shellyapp_url}/organizations/#{organization_name || attributes['organization']['name']}/edit"
257
252
  end
258
253
 
259
254
  def open
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require "shelly/cli/command"
3
2
  require "shelly/cli/user"
4
3
  require "shelly/cli/backup"
@@ -9,6 +8,9 @@ require "shelly/cli/file"
9
8
  require "shelly/cli/organization"
10
9
  require "shelly/cli/logs"
11
10
 
11
+ require "shelly/cli/main/add"
12
+ require "shelly/cli/main/check"
13
+
12
14
  module Shelly
13
15
  module CLI
14
16
  class Main < Command
@@ -80,73 +82,6 @@ module Shelly
80
82
  say_error "Use ssh-keygen to generate ssh key pair"
81
83
  end
82
84
 
83
- method_option "code-name", :type => :string, :aliases => "-c",
84
- :desc => "Unique code-name of your cloud"
85
- method_option :databases, :type => :array, :aliases => "-d",
86
- :banner => Shelly::App::DATABASE_CHOICES.join(', '),
87
- :desc => "List of databases of your choice"
88
- method_option :size, :type => :string, :aliases => "-s",
89
- :desc => "Server size [large, small]"
90
- method_option "redeem-code", :type => :string, :aliases => "-r",
91
- :desc => "Redeem code for free credits"
92
- method_option "organization", :type => :string, :aliases => "-o",
93
- :desc => "Add cloud to existing organization"
94
- method_option "skip-requirements-check", :type => :boolean,
95
- :desc => "Skip Shelly Cloud requirements check"
96
- method_option "default-organization", :type => :boolean,
97
- :desc => "Create cloud with default organization"
98
- method_option "zone", :type => :string, :hide => true,
99
- :desc => "Create cloud in given zone"
100
- desc "add", "Add a new cloud"
101
- def add
102
- check_options(options)
103
- unless options["skip-requirements-check"]
104
- return unless check(verbose = false)
105
- end
106
- app = Shelly::App.new
107
- app.code_name = options["code-name"] || ask_for_code_name
108
- app.databases = options["databases"] || ask_for_databases
109
- app.size = options["size"] || "large"
110
- app.redeem_code = options["redeem-code"]
111
- unless options["default-organization"]
112
- app.organization = options["organization"] || ask_for_organization(app.code_name)
113
- end
114
- app.zone_name = options["zone"]
115
- app.create
116
-
117
- git_remote = add_remote(app)
118
-
119
- say "Creating Cloudfile", :green
120
- app.create_cloudfile
121
-
122
- if app.credit > 0 || !app.organization_details_present?
123
- say_new_line
124
- say "Billing information", :green
125
- if app.credit > 0
126
- say "#{app.credit.to_i} Euro credit remaining."
127
- end
128
- if !app.organization_details_present?
129
- say "Remember to provide billing details before trial ends."
130
- say app.edit_billing_url
131
- end
132
- end
133
-
134
- info_adding_cloudfile_to_repository
135
- info_deploying_to_shellycloud(git_remote)
136
-
137
- rescue Client::ValidationException => e
138
- e.each_error { |error| say_error error, :with_exit => false }
139
- say_new_line
140
- say_error "Fix erros in the below command and type it again to create your cloud" , :with_exit => false
141
- say_error "shelly add --code-name=#{app.code_name.downcase.dasherize} --databases=#{app.databases.join(',')} --size=#{app.size}"
142
- rescue Client::ForbiddenException
143
- say_error "You have to be the owner of '#{options[:organization]}' organization to add clouds"
144
- rescue Client::NotFoundException => e
145
- raise unless e.resource == :organization
146
- say_error "Organization '#{app.organization}' not found", :with_exit => false
147
- say_error "You can list organizations you have access to with `shelly organization list`"
148
- end
149
-
150
85
  map "status" => :list
151
86
  desc "list", "List available clouds"
152
87
  def list
@@ -410,126 +345,6 @@ Wait until cloud is in 'turned off' state and try again.}
410
345
  say_error "Virtual Server '#{options[:server]}' not found"
411
346
  end
412
347
 
413
- desc "check", "Check if application fulfills Shelly Cloud requirements"
414
- # Public: Check if application fulfills shelly's requirements
415
- # and print them
416
- # verbose - when true all requirements will be printed out
417
- # together with header and a summary at the end
418
- # when false only not fulfilled requirements will be
419
- # printed
420
- # When any requirements is not fulfilled header and summary will
421
- # be displayed regardless of verbose value
422
- def check(verbose = true)
423
- structure = Shelly::StructureValidator.new
424
-
425
- if verbose or structure.invalid? or structure.warnings?
426
- say "Checking Shelly Cloud requirements\n\n"
427
- end
428
-
429
- print_check(structure.gemfile?, "Gemfile is present",
430
- "Gemfile is missing in git repository",
431
- :show_fulfilled => verbose)
432
-
433
- print_check(structure.gemfile_lock?, "Gemfile.lock is present",
434
- "Gemfile.lock is missing in git repository",
435
- :show_fulfilled => verbose)
436
-
437
- print_check(structure.config_ru?, "config.ru is present",
438
- "config.ru is missing",
439
- :show_fulfilled => verbose)
440
-
441
- print_check(structure.rakefile?, "Rakefile is present",
442
- "Rakefile is missing",
443
- :show_fulfilled => verbose)
444
-
445
- print_check(!structure.gem?("shelly"),
446
- "Gem 'shelly' is not a part of Gemfile",
447
- "Gem 'shelly' should not be a part of Gemfile.\n The versions of the thor gem used by shelly and Rails may be incompatible.",
448
- :show_fulfilled => verbose || structure.warnings?,
449
- :failure_level => :warning)
450
-
451
- print_check(structure.gem?("shelly-dependencies"),
452
- "Gem 'shelly-dependencies' is present",
453
- "Gem 'shelly-dependencies' is missing, we recommend to install it\n See more at https://shellycloud.com/documentation/requirements#shelly-dependencies",
454
- :show_fulfilled => verbose || structure.warnings?, :failure_level => :warning)
455
-
456
- print_check(structure.gem?("thin") || structure.gem?("puma"),
457
- "Web server gem is present",
458
- "Missing web server gem in Gemfile. Currently supported: 'thin' and 'puma'",
459
- :show_fulfilled => verbose, :failure_level => :warning)
460
-
461
- print_check(structure.gem?("rake"), "Gem 'rake' is present",
462
- "Gem 'rake' is missing in the Gemfile", :show_fulfilled => verbose)
463
-
464
- print_check(structure.task?("db:migrate"), "Task 'db:migrate' is present",
465
- "Task 'db:migrate' is missing", :show_fulfilled => verbose)
466
-
467
- print_check(structure.task?("db:setup"), "Task 'db:setup' is present",
468
- "Task 'db:setup' is missing", :show_fulfilled => verbose)
469
-
470
- cloudfile = Cloudfile.new
471
- if cloudfile.present?
472
- cloudfile.clouds.each do |app|
473
- if app.cloud_databases.include?('postgresql')
474
- print_check(structure.gem?("pg") || structure.gem?("postgres"),
475
- "Postgresql driver is present for '#{app}' cloud",
476
- "Postgresql driver is missing in the Gemfile for '#{app}' cloud,\n we recommend adding 'pg' gem to Gemfile",
477
- :show_fulfilled => verbose)
478
- end
479
-
480
- if app.delayed_job?
481
- print_check(structure.gem?("delayed_job"),
482
- "Gem 'delayed_job' is present for '#{app}' cloud",
483
- "Gem 'delayed_job' is missing in the Gemfile for '#{app}' cloud",
484
- :show_fulfilled => verbose)
485
- end
486
-
487
- if app.whenever?
488
- print_check(structure.gem?("whenever"),
489
- "Gem 'whenever' is present for '#{app}' cloud",
490
- "Gem 'whenever' is missing in the Gemfile for '#{app}' cloud",
491
- :show_fulfilled => verbose)
492
- end
493
-
494
- if app.sidekiq?
495
- print_check(structure.gem?("sidekiq"),
496
- "Gem 'sidekiq' is present for '#{app}' cloud",
497
- "Gem 'sidekiq' is missing in the Gemfile for '#{app}' cloud",
498
- :show_fulfilled => verbose)
499
- end
500
-
501
- if app.thin?
502
- print_check(structure.gem?("thin"),
503
- "Web server gem 'thin' is present",
504
- "Gem 'thin' is missing in the Gemfile for '#{app}' cloud",
505
- :show_fulfilled => verbose)
506
- end
507
-
508
- if app.puma?
509
- print_check(structure.gem?("puma"),
510
- "Web server gem 'puma' is present",
511
- "Gem 'puma' is missing in the Gemfile for '#{app}' cloud",
512
- :show_fulfilled => verbose)
513
- end
514
- end
515
- end
516
-
517
- if structure.valid?
518
- if verbose
519
- say "\nGreat! Your application is ready to run on Shelly Cloud"
520
- end
521
- else
522
- say "\nFix points marked with #{red("✗")} to run your application on the Shelly Cloud"
523
- say "See more about requirements on https://shellycloud.com/documentation/requirements"
524
- end
525
-
526
- structure.valid?
527
- rescue Bundler::BundlerError => e
528
- say_new_line
529
- say_error e.message, :with_exit => false
530
- say_error "Try to run `bundle install`"
531
- end
532
-
533
348
  # FIXME: move to helpers
534
349
  no_tasks do
535
350
  # Returns valid arguments for rake, removes shelly gem arguments
@@ -614,8 +429,8 @@ Wait until cloud is in 'turned off' state and try again.}
614
429
  end
615
430
 
616
431
  def ask_for_code_name
617
- default_code_name = Shelly::App.code_name_from_dir_name
618
- code_name = ask("Cloud code name (#{Shelly::App.code_name_from_dir_name} - default):")
432
+ default_code_name = default_name_from_dir_name
433
+ code_name = ask("Cloud code name (#{default_name_from_dir_name} - default):")
619
434
  code_name.blank? ? default_code_name : code_name
620
435
  end
621
436
 
@@ -632,34 +447,6 @@ Wait until cloud is in 'turned off' state and try again.}
632
447
  databases.empty? ? ["postgresql"] : databases
633
448
  end
634
449
 
635
- def ask_for_organization(default_name)
636
- organizations = Shelly::User.new.organizations
637
- unless organizations.blank?
638
- count = organizations.count
639
- option_selected = 0
640
- loop do
641
- say "Select organization for this cloud:"
642
- say_new_line
643
- say "existing organizations:"
644
-
645
- organizations.each_with_index do |organization, i|
646
- print_wrapped "#{i + 1}) #{organization.name}", :ident => 2
647
- end
648
- say_new_line
649
- say "new organization (default as code name):"
650
-
651
- print_wrapped "#{count + 1}) #{default_name}", :ident => 2
652
-
653
- option_selected = ask("Option:")
654
- break if ('1'..(count + 1).to_s).include?(option_selected)
655
- end
656
-
657
- if (1..count).include?(option_selected.to_i)
658
- return organizations[option_selected.to_i - 1].name
659
- end
660
- end
661
- end
662
-
663
450
  def info_adding_cloudfile_to_repository
664
451
  say_new_line
665
452
  say "Project is now configured for use with Shelly Cloud:", :green
@@ -0,0 +1,116 @@
1
+ module Shelly
2
+ module CLI
3
+ class Main < Command
4
+
5
+ method_option "code-name", :type => :string, :aliases => "-c",
6
+ :desc => "Unique code-name of your cloud"
7
+ method_option :databases, :type => :array, :aliases => "-d",
8
+ :banner => Shelly::App::DATABASE_CHOICES.join(', '),
9
+ :desc => "List of databases of your choice"
10
+ method_option :size, :type => :string, :aliases => "-s",
11
+ :desc => "Server size [large, small]"
12
+ method_option "redeem-code", :type => :string, :aliases => "-r",
13
+ :desc => "Redeem code for free credits"
14
+ method_option "organization", :type => :string, :aliases => "-o",
15
+ :desc => "Add cloud to existing organization"
16
+ method_option "skip-requirements-check", :type => :boolean,
17
+ :desc => "Skip Shelly Cloud requirements check"
18
+ method_option "zone", :type => :string, :hide => true,
19
+ :desc => "Create cloud in given zone"
20
+ desc "add", "Add a new cloud"
21
+ def add
22
+ check_options(options)
23
+ unless options["skip-requirements-check"]
24
+ return unless check(verbose = false)
25
+ end
26
+ app = Shelly::App.new
27
+ app.code_name = options["code-name"] || ask_for_code_name
28
+ app.databases = options["databases"] || ask_for_databases
29
+ app.size = options["size"] || "large"
30
+ app.organization_name = options["organization"] || ask_for_organization(options)
31
+ app.zone_name = options["zone"]
32
+ app.create
33
+ say "Cloud '#{app}' created in '#{app.organization_name}' organization", :green
34
+ say_new_line
35
+
36
+ git_remote = add_remote(app)
37
+
38
+ say "Creating Cloudfile", :green
39
+ app.create_cloudfile
40
+
41
+ if app.credit > 0 || !app.organization_details_present?
42
+ say_new_line
43
+ say "Billing information", :green
44
+ if app.credit > 0
45
+ say "#{app.credit.to_i} Euro credit remaining."
46
+ end
47
+ if !app.organization_details_present?
48
+ say "Remember to provide billing details before trial ends."
49
+ say app.edit_billing_url
50
+ end
51
+ end
52
+
53
+ info_adding_cloudfile_to_repository
54
+ info_deploying_to_shellycloud(git_remote)
55
+
56
+ rescue Client::ValidationException => e
57
+ e.each_error { |error| say_error error, :with_exit => false }
58
+ say_new_line
59
+ say_error "Fix erros in the below command and type it again to create your cloud" , :with_exit => false
60
+ say_error "shelly add --code-name=#{app.code_name.downcase.dasherize} --databases=#{app.databases.join(',')} --organization=#{app.organization_name} --size=#{app.size}"
61
+ rescue Client::ForbiddenException
62
+ say_error "You have to be the owner of '#{options[:organization]}' organization to add clouds"
63
+ rescue Client::NotFoundException => e
64
+ raise unless e.resource == :organization
65
+ say_error "Organization '#{app.organization_name}' not found", :with_exit => false
66
+ say_error "You can list organizations you have access to with `shelly organization list`"
67
+ end
68
+
69
+ no_tasks do
70
+ def ask_for_organization(options)
71
+ organizations = Shelly::User.new.organizations
72
+ if organizations.blank?
73
+ ask_for_new_organization(options)
74
+ else
75
+ count = organizations.count
76
+ option_selected = 0
77
+ loop do
78
+ say "Select organization for this cloud:"
79
+ say_new_line
80
+ say "existing organizations:"
81
+
82
+ organizations.each_with_index do |organization, i|
83
+ print_wrapped "#{i + 1}) #{organization.name}", :ident => 2
84
+ end
85
+ say_new_line
86
+
87
+ print_wrapped "#{count + 1}) provide name for new organization", :ident => 2
88
+
89
+ option_selected = ask("Option:")
90
+ break if ('1'..(count + 1).to_s).include?(option_selected)
91
+ end
92
+
93
+ if option_selected.to_i == count + 1
94
+ return ask_for_new_organization(options)
95
+ end
96
+
97
+ if (1..count).include?(option_selected.to_i)
98
+ return organizations[option_selected.to_i - 1].name
99
+ end
100
+ end
101
+ end
102
+
103
+ def ask_for_new_organization(options = {})
104
+ loop do
105
+ begin
106
+ return create_new_organization(options)
107
+ rescue Client::ValidationException => e
108
+ e.each_error { |error| say_error error, :with_exit => false }
109
+ end
110
+ end
111
+ end
112
+
113
+ end
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,127 @@
1
+ # encoding: utf-8
2
+
3
+ module Shelly
4
+ module CLI
5
+ class Main < Command
6
+ desc "check", "Check if application fulfills Shelly Cloud requirements"
7
+ # Public: Check if application fulfills shelly's requirements
8
+ # and print them
9
+ # verbose - when true all requirements will be printed out
10
+ # together with header and a summary at the end
11
+ # when false only not fulfilled requirements will be
12
+ # printed
13
+ # When any requirements is not fulfilled header and summary will
14
+ # be displayed regardless of verbose value
15
+ def check(verbose = true)
16
+ structure = Shelly::StructureValidator.new
17
+
18
+ if verbose or structure.invalid? or structure.warnings?
19
+ say "Checking Shelly Cloud requirements\n\n"
20
+ end
21
+
22
+ print_check(structure.gemfile?, "Gemfile is present",
23
+ "Gemfile is missing in git repository",
24
+ :show_fulfilled => verbose)
25
+
26
+ print_check(structure.gemfile_lock?, "Gemfile.lock is present",
27
+ "Gemfile.lock is missing in git repository",
28
+ :show_fulfilled => verbose)
29
+
30
+ print_check(structure.config_ru?, "config.ru is present",
31
+ "config.ru is missing",
32
+ :show_fulfilled => verbose)
33
+
34
+ print_check(structure.rakefile?, "Rakefile is present",
35
+ "Rakefile is missing",
36
+ :show_fulfilled => verbose)
37
+
38
+ print_check(!structure.gem?("shelly"),
39
+ "Gem 'shelly' is not a part of Gemfile",
40
+ "Gem 'shelly' should not be a part of Gemfile.\n The versions of the thor gem used by shelly and Rails may be incompatible.",
41
+ :show_fulfilled => verbose || structure.warnings?,
42
+ :failure_level => :warning)
43
+
44
+ print_check(structure.gem?("shelly-dependencies"),
45
+ "Gem 'shelly-dependencies' is present",
46
+ "Gem 'shelly-dependencies' is missing, we recommend to install it\n See more at https://shellycloud.com/documentation/requirements#shelly-dependencies",
47
+ :show_fulfilled => verbose || structure.warnings?, :failure_level => :warning)
48
+
49
+ print_check(structure.gem?("thin") || structure.gem?("puma"),
50
+ "Web server gem is present",
51
+ "Missing web server gem in Gemfile. Currently supported: 'thin' and 'puma'",
52
+ :show_fulfilled => verbose, :failure_level => :warning)
53
+
54
+ print_check(structure.gem?("rake"), "Gem 'rake' is present",
55
+ "Gem 'rake' is missing in the Gemfile", :show_fulfilled => verbose)
56
+
57
+ print_check(structure.task?("db:migrate"), "Task 'db:migrate' is present",
58
+ "Task 'db:migrate' is missing", :show_fulfilled => verbose)
59
+
60
+ print_check(structure.task?("db:setup"), "Task 'db:setup' is present",
61
+ "Task 'db:setup' is missing", :show_fulfilled => verbose)
62
+
63
+ cloudfile = Cloudfile.new
64
+ if cloudfile.present?
65
+ cloudfile.clouds.each do |app|
66
+ if app.cloud_databases.include?('postgresql')
67
+ print_check(structure.gem?("pg") || structure.gem?("postgres"),
68
+ "Postgresql driver is present for '#{app}' cloud",
69
+ "Postgresql driver is missing in the Gemfile for '#{app}' cloud,\n we recommend adding 'pg' gem to Gemfile",
70
+ :show_fulfilled => verbose)
71
+ end
72
+
73
+ if app.delayed_job?
74
+ print_check(structure.gem?("delayed_job"),
75
+ "Gem 'delayed_job' is present for '#{app}' cloud",
76
+ "Gem 'delayed_job' is missing in the Gemfile for '#{app}' cloud",
77
+ :show_fulfilled => verbose)
78
+ end
79
+
80
+ if app.whenever?
81
+ print_check(structure.gem?("whenever"),
82
+ "Gem 'whenever' is present for '#{app}' cloud",
83
+ "Gem 'whenever' is missing in the Gemfile for '#{app}' cloud",
84
+ :show_fulfilled => verbose)
85
+ end
86
+
87
+ if app.sidekiq?
88
+ print_check(structure.gem?("sidekiq"),
89
+ "Gem 'sidekiq' is present for '#{app}' cloud",
90
+ "Gem 'sidekiq' is missing in the Gemfile for '#{app}' cloud",
91
+ :show_fulfilled => verbose)
92
+ end
93
+
94
+ if app.thin?
95
+ print_check(structure.gem?("thin"),
96
+ "Web server gem 'thin' is present",
97
+ "Gem 'thin' is missing in the Gemfile for '#{app}' cloud",
98
+ :show_fulfilled => verbose)
99
+ end
100
+
101
+ if app.puma?
102
+ print_check(structure.gem?("puma"),
103
+ "Web server gem 'puma' is present",
104
+ "Gem 'puma' is missing in the Gemfile for '#{app}' cloud",
105
+ :show_fulfilled => verbose)
106
+ end
107
+ end
108
+ end
109
+
110
+ if structure.valid?
111
+ if verbose
112
+ say "\nGreat! Your application is ready to run on Shelly Cloud"
113
+ end
114
+ else
115
+ say "\nFix points marked with #{red("✗")} to run your application on the Shelly Cloud"
116
+ say "See more about requirements on https://shellycloud.com/documentation/requirements"
117
+ end
118
+
119
+ structure.valid?
120
+ rescue Bundler::BundlerError => e
121
+ say_new_line
122
+ say_error e.message, :with_exit => false
123
+ say_error "Try to run `bundle install`"
124
+ end
125
+ end
126
+ end
127
+ end
@@ -6,7 +6,7 @@ module Shelly
6
6
  namespace :organization
7
7
  include Helpers
8
8
 
9
- before_hook :logged_in?, :only => [:list]
9
+ before_hook :logged_in?, :only => [:list, :add]
10
10
 
11
11
  desc "list", "Lists organizations"
12
12
  def list
@@ -23,6 +23,16 @@ module Shelly
23
23
  end
24
24
  end
25
25
  end
26
+
27
+ method_option "redeem-code", :type => :string, :aliases => "-r",
28
+ :desc => "Redeem code for free credits"
29
+ desc "add", "Add a new organization"
30
+ def add
31
+ create_new_organization(options)
32
+ rescue Client::ValidationException => e
33
+ e.each_error { |error| say_error error, :with_exit => false }
34
+ exit 1
35
+ end
26
36
  end
27
37
  end
28
38
  end
@@ -7,6 +7,10 @@ class Shelly::Client
7
7
  get("/organizations/#{name}")
8
8
  end
9
9
 
10
+ def create_organization(attributes)
11
+ post("/organizations", :organization => attributes)
12
+ end
13
+
10
14
  def members(name)
11
15
  get("/organizations/#{name}/memberships")
12
16
  end
@@ -23,6 +23,17 @@ module Shelly
23
23
  say message, :yellow
24
24
  end
25
25
 
26
+ # Extracted into a helper so can be used when adding cloud Main#add and
27
+ # Organization#add
28
+ def create_new_organization(options = {})
29
+ organization = Shelly::Organization.new
30
+ organization.name = ask_for_organization_name
31
+ organization.redeem_code = options["redeem-code"]
32
+ organization.create
33
+ say "Organization '#{organization.name}' created", :green
34
+ organization.name
35
+ end
36
+
26
37
  def ask_for_email(options = {})
27
38
  options = {:guess_email => true}.merge(options)
28
39
  email_question = options[:guess_email] && !User.guess_email.blank? ? "Email (#{User.guess_email} - default):" : "Email:"
@@ -59,6 +70,16 @@ module Shelly
59
70
  exit 1 unless yes?(reset_database_question)
60
71
  end
61
72
 
73
+ def ask_for_organization_name
74
+ default_name = default_name_from_dir_name
75
+ name = ask("Organization name (#{default_name} - default):")
76
+ name.blank? ? default_name : name
77
+ end
78
+
79
+ def default_name_from_dir_name
80
+ "#{File.basename(Dir.pwd)}".downcase.dasherize
81
+ end
82
+
62
83
  def inside_git_repository?
63
84
  unless App.inside_git_repository?
64
85
  say_error %q{Current directory is not a git repository.
@@ -1,6 +1,6 @@
1
1
  module Shelly
2
2
  class Organization < Model
3
- attr_reader :name, :app_code_names
3
+ attr_accessor :name, :app_code_names, :redeem_code
4
4
 
5
5
  def initialize(attributes = {})
6
6
  @name = attributes["name"]
@@ -13,6 +13,11 @@ module Shelly
13
13
  end
14
14
  end
15
15
 
16
+ def create
17
+ attributes = {:name => name, :redeem_code => redeem_code}
18
+ shelly.create_organization(attributes)
19
+ end
20
+
16
21
  def memberships
17
22
  @members ||= Array(shelly.members(name)).
18
23
  sort_by { |c| c["email"] }
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.3.8"
2
+ VERSION = "0.4.0.pre"
3
3
  end
data/spec/input_faker.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class InputFaker
2
2
  def initialize(strings)
3
- @strings = strings
3
+ @strings = Array(strings)
4
4
  end
5
5
 
6
6
  def gets
@@ -10,13 +10,6 @@ describe Shelly::App do
10
10
  @app = Shelly::App.new('foo-staging')
11
11
  end
12
12
 
13
- describe ".code_name_from_dir_name" do
14
- it "should downcase and dasherize code name" do
15
- Dir.stub(:pwd).and_return("/project/FOO")
16
- Shelly::App.code_name_from_dir_name.should == "foo"
17
- end
18
- end
19
-
20
13
  describe "#databases=" do
21
14
  it "should remove 'none' as possible database" do
22
15
  @app.databases = %w{none postgresql}
@@ -249,10 +242,8 @@ describe Shelly::App do
249
242
  describe "#create" do
250
243
  it "should create the app on shelly cloud via API client" do
251
244
  @app.code_name = "fooo"
252
- @app.redeem_code = "foo123"
253
245
  attributes = {
254
246
  :code_name => "fooo",
255
- :redeem_code => "foo123",
256
247
  :organization_name => nil,
257
248
  :zone_name => nil
258
249
  }
@@ -333,7 +324,7 @@ describe Shelly::App do
333
324
 
334
325
  describe "#edit_billing_url" do
335
326
  it "should return link to edit billing page for app" do
336
- @app.stub(:organization).and_return("example")
327
+ @app.stub(:organization_name).and_return("example")
337
328
  @app.edit_billing_url.should == "http://shellyapp.example.com/organizations/example/edit"
338
329
  end
339
330
  end
@@ -406,7 +406,7 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
406
406
  it "should create the app on shelly cloud and show credit information" do
407
407
  @app.stub(:attributes).and_return(
408
408
  "organization" => {"credit" => "40", "details_present" => false})
409
- @app.stub(:organization).and_return("example")
409
+ @app.stub(:organization_name).and_return("example")
410
410
  @app.should_receive(:create)
411
411
  $stdout.should_receive(:puts).with(green "Billing information")
412
412
  $stdout.should_receive(:puts).with("40 Euro credit remaining.")
@@ -430,10 +430,11 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
430
430
  it "should display validation errors if they are any" do
431
431
  body = {"message" => "Validation Failed", "errors" => [["code_name", "has been already taken"]]}
432
432
  exception = Shelly::Client::ValidationException.new(body)
433
+ @app.stub(:organization_name).and_return("org-name")
433
434
  @app.should_receive(:create).and_raise(exception)
434
435
  $stdout.should_receive(:puts).with(red "Code name has been already taken")
435
436
  $stdout.should_receive(:puts).with(red "Fix erros in the below command and type it again to create your cloud")
436
- $stdout.should_receive(:puts).with(red "shelly add --code-name=big-letters --databases=postgresql --size=large")
437
+ $stdout.should_receive(:puts).with(red "shelly add --code-name=big-letters --databases=postgresql --organization=org-name --size=large")
437
438
  lambda {
438
439
  fake_stdin(["BiG_LETTERS", ""]) do
439
440
  invoke(@main, :add)
@@ -545,14 +546,14 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
545
546
  end.to raise_error(SystemExit)
546
547
  end
547
548
 
548
- context "organizations" do
549
+ context "organization" do
549
550
  before do
550
551
  @main.unstub(:ask_for_organization)
551
552
  end
552
553
 
553
554
  it "should use --organization option" do
554
555
  @main.options = {"organization" => "foo"}
555
- @app.should_receive(:organization=).with("foo")
556
+ @app.should_receive(:organization_name=).with("foo")
556
557
  fake_stdin(["foooo", "none"]) do
557
558
  invoke(@main, :add)
558
559
  end
@@ -564,37 +565,45 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
564
565
  end
565
566
 
566
567
  it "should ask user to choose organization if present and use chosen organization" do
567
- @app.should_receive(:organization=).with("aaa")
568
+ @app.should_receive(:organization_name=).with("aaa")
568
569
  $stdout.should_receive(:puts).with("Select organization for this cloud:")
569
570
  $stdout.should_receive(:puts).with("existing organizations:")
570
571
  $stdout.should_receive(:puts).with(" 1) aaa")
571
- $stdout.should_receive(:puts).with("new organization (default as code name):")
572
- $stdout.should_receive(:puts).with(" 2) foooo")
572
+ $stdout.should_receive(:puts).with(" 2) provide name for new organization")
573
573
  $stdout.should_receive(:print).with("Option: ")
574
574
  fake_stdin(["foooo", "none", "1"]) do
575
575
  invoke(@main, :add)
576
576
  end
577
577
  end
578
578
 
579
- it "should ask user to choose organization if present" do
580
- @app.should_receive(:organization=).with(nil)
579
+ it "should ask user to create new organization" do
580
+ @main.options = {'redeem-code' => 'discount'}
581
+ @client.should_receive(:create_organization).
582
+ with({:name => "org-name", :redeem_code => 'discount'})
583
+ @app.should_receive(:organization_name=).with('org-name')
581
584
  $stdout.should_receive(:puts).with("Select organization for this cloud:")
582
585
  $stdout.should_receive(:puts).with("existing organizations:")
583
586
  $stdout.should_receive(:puts).with(" 1) aaa")
584
- $stdout.should_receive(:puts).with("new organization (default as code name):")
585
- $stdout.should_receive(:puts).with(" 2) foooo")
587
+ $stdout.should_receive(:puts).with(" 2) provide name for new organization")
586
588
  $stdout.should_receive(:print).with("Option: ")
587
- fake_stdin(["foooo", "none", "2"]) do
589
+ $stdout.should_receive(:print).with("Organization name (foo - default): ")
590
+ $stdout.should_receive(:puts).with(green "Organization 'org-name' created")
591
+ fake_stdin(["foooo", "none", "2", "org-name"]) do
588
592
  invoke(@main, :add)
589
593
  end
590
594
  end
591
- end
592
595
 
593
- context "default-organizaation" do
594
- it "should not ask for organization" do
595
- @main.options = {"default-organization" => true}
596
- @app.should_not_receive(:organization=)
597
- fake_stdin(["foooo", "none"]) do
596
+ it "should use redeem-code option" do
597
+ @client.should_receive(:create_organization).
598
+ with({:name => "org-name", :redeem_code => nil})
599
+ $stdout.should_receive(:puts).with("Select organization for this cloud:")
600
+ $stdout.should_receive(:puts).with("existing organizations:")
601
+ $stdout.should_receive(:puts).with(" 1) aaa")
602
+ $stdout.should_receive(:puts).with(" 2) provide name for new organization")
603
+ $stdout.should_receive(:print).with("Option: ")
604
+ $stdout.should_receive(:print).with("Organization name (foo - default): ")
605
+ $stdout.should_receive(:puts).with(green "Organization 'org-name' created")
606
+ fake_stdin(["foooo", "none", "2", "org-name"]) do
598
607
  invoke(@main, :add)
599
608
  end
600
609
  end
@@ -4,8 +4,8 @@ require "shelly/cli/organization"
4
4
  describe Shelly::CLI::Organization do
5
5
  before do
6
6
  FileUtils.stub(:chmod)
7
- @organization = Shelly::CLI::Organization.new
8
- Shelly::CLI::Organization.stub(:new).and_return(@organization)
7
+ @cli = Shelly::CLI::Organization.new
8
+ Shelly::CLI::Organization.stub(:new).and_return(@cli)
9
9
  @client = mock
10
10
  Shelly::Client.stub(:new).and_return(@client)
11
11
  $stdout.stub(:puts)
@@ -28,7 +28,7 @@ describe Shelly::CLI::Organization do
28
28
  end
29
29
 
30
30
  it "should ensure user has logged in" do
31
- hooks(@organization, :list).should include(:logged_in?)
31
+ hooks(@cli, :list).should include(:logged_in?)
32
32
  end
33
33
 
34
34
  it "should print out all organizations with apps" do
@@ -38,7 +38,51 @@ describe Shelly::CLI::Organization do
38
38
  $stdout.should_receive(:puts).with(green("ccc"))
39
39
  $stdout.should_receive(:puts).with(/app2 \s+ | turned off/)
40
40
  $stdout.should_receive(:puts).with(/app3 \s+ | no code/)
41
- invoke(@organization, :list)
41
+ invoke(@cli, :list)
42
+ end
43
+ end
44
+
45
+ describe "#add" do
46
+ before do
47
+ @organization = Shelly::Organization.new
48
+ Shelly::Organization.stub(:new).and_return(@organization)
49
+ @organization.stub(:create)
50
+ end
51
+
52
+ it "should ensure user has logged in" do
53
+ hooks(@cli, :add).should include(:logged_in?)
54
+ end
55
+
56
+ it "should create new organization" do
57
+ @organization.should_receive(:create)
58
+ $stdout.should_receive(:print).with("Organization name (foo - default): ")
59
+ $stdout.should_receive(:puts).with(green "Organization 'org-name' created")
60
+ fake_stdin("org-name") do
61
+ invoke(@cli, :add)
62
+ end
63
+ end
64
+
65
+ it "should accept redeem-code option" do
66
+ @organization.should_receive(:redeem_code=).with("discount")
67
+ @cli.options = {"redeem-code" => "discount"}
68
+ fake_stdin("org-name") do
69
+ invoke(@cli, :add)
70
+ end
71
+ end
72
+
73
+ context "on failure" do
74
+ it "should display validation errors" do
75
+ body = {"message" => "Validation Failed", "errors" =>
76
+ [["name", "has been already taken"]]}
77
+ exception = Shelly::Client::ValidationException.new(body)
78
+ @organization.should_receive(:create).and_raise(exception)
79
+ $stdout.should_receive(:puts).with(red "Name has been already taken")
80
+ lambda {
81
+ fake_stdin("org-name") do
82
+ invoke(@cli, :add)
83
+ end
84
+ }.should raise_error(SystemExit)
85
+ end
42
86
  end
43
87
  end
44
88
  end
@@ -170,12 +170,6 @@ describe Shelly::Client do
170
170
 
171
171
  describe "#create_app" do
172
172
  it "should send post with app's attributes" do
173
- @client.should_receive(:post).with("/apps", :app => {:code_name => "foo",
174
- :ruby_version => "1.9.2"}, :organization_name => nil, :zone_name => nil)
175
- @client.create_app(:code_name => "foo", :ruby_version => "1.9.2")
176
- end
177
-
178
- it "should send post with app's attributes and organization name" do
179
173
  @client.should_receive(:post).with("/apps", :app => {:code_name => "foo",
180
174
  :ruby_version => "1.9.2"}, :organization_name => "foo", :zone_name => 'eu1')
181
175
  @client.create_app(:code_name => "foo", :ruby_version => "1.9.2",
@@ -194,6 +188,14 @@ describe Shelly::Client do
194
188
  end
195
189
  end
196
190
 
191
+ describe "#create_organization" do
192
+ it "should send post with organization's attributes" do
193
+ @client.should_receive(:post).with("/organizations",
194
+ :organization => {:name => "new-organization"})
195
+ @client.create_organization(:name => "new-organization")
196
+ end
197
+ end
198
+
197
199
  describe "#organization" do
198
200
  it "should fetch organization from API" do
199
201
  FakeWeb.register_uri(:get, api_url("organizations/foo-org"),
@@ -62,6 +62,16 @@ describe Shelly::Organization do
62
62
  end
63
63
  end
64
64
 
65
+ describe "#create" do
66
+ it "should create organization via API client" do
67
+ @client.should_receive(:create_organization).with(
68
+ :name => "new-organization", :redeem_code => "discount")
69
+ @organization.name = "new-organization"
70
+ @organization.redeem_code = "discount"
71
+ @organization.create
72
+ end
73
+ end
74
+
65
75
  describe "#send_invitation" do
66
76
  it "should send invitation" do
67
77
  @client.should_receive(:send_invitation).with("foo-org", "megan@example.com", true)
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
5
- prerelease:
4
+ version: 0.4.0.pre
6
5
  platform: ruby
7
6
  authors:
8
7
  - Shelly Cloud team
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: guard
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: guard-rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: simplecov
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,34 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: ruby_gntp
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rb-fsevent
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
90
107
  requirements:
91
108
  - - ! '>='
92
109
  - !ruby/object:Gem::Version
@@ -94,7 +111,6 @@ dependencies:
94
111
  - !ruby/object:Gem::Dependency
95
112
  name: fakefs
96
113
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
114
  requirements:
99
115
  - - ! '>='
100
116
  - !ruby/object:Gem::Version
@@ -102,7 +118,6 @@ dependencies:
102
118
  type: :development
103
119
  prerelease: false
104
120
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
121
  requirements:
107
122
  - - ! '>='
108
123
  - !ruby/object:Gem::Version
@@ -110,7 +125,6 @@ dependencies:
110
125
  - !ruby/object:Gem::Dependency
111
126
  name: fakeweb
112
127
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
128
  requirements:
115
129
  - - ! '>='
116
130
  - !ruby/object:Gem::Version
@@ -118,7 +132,6 @@ dependencies:
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
135
  requirements:
123
136
  - - ! '>='
124
137
  - !ruby/object:Gem::Version
@@ -126,7 +139,6 @@ dependencies:
126
139
  - !ruby/object:Gem::Dependency
127
140
  name: wijet-thor
128
141
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
142
  requirements:
131
143
  - - ~>
132
144
  - !ruby/object:Gem::Version
@@ -134,7 +146,6 @@ dependencies:
134
146
  type: :runtime
135
147
  prerelease: false
136
148
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
149
  requirements:
139
150
  - - ~>
140
151
  - !ruby/object:Gem::Version
@@ -142,7 +153,6 @@ dependencies:
142
153
  - !ruby/object:Gem::Dependency
143
154
  name: rest-client
144
155
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
156
  requirements:
147
157
  - - ! '>='
148
158
  - !ruby/object:Gem::Version
@@ -150,7 +160,6 @@ dependencies:
150
160
  type: :runtime
151
161
  prerelease: false
152
162
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
163
  requirements:
155
164
  - - ! '>='
156
165
  - !ruby/object:Gem::Version
@@ -158,7 +167,6 @@ dependencies:
158
167
  - !ruby/object:Gem::Dependency
159
168
  name: json
160
169
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
170
  requirements:
163
171
  - - ! '>='
164
172
  - !ruby/object:Gem::Version
@@ -166,7 +174,6 @@ dependencies:
166
174
  type: :runtime
167
175
  prerelease: false
168
176
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
177
  requirements:
171
178
  - - ! '>='
172
179
  - !ruby/object:Gem::Version
@@ -174,7 +181,6 @@ dependencies:
174
181
  - !ruby/object:Gem::Dependency
175
182
  name: progressbar
176
183
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
184
  requirements:
179
185
  - - ! '>='
180
186
  - !ruby/object:Gem::Version
@@ -182,7 +188,6 @@ dependencies:
182
188
  type: :runtime
183
189
  prerelease: false
184
190
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
191
  requirements:
187
192
  - - ! '>='
188
193
  - !ruby/object:Gem::Version
@@ -190,7 +195,6 @@ dependencies:
190
195
  - !ruby/object:Gem::Dependency
191
196
  name: launchy
192
197
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
198
  requirements:
195
199
  - - ! '>='
196
200
  - !ruby/object:Gem::Version
@@ -198,7 +202,6 @@ dependencies:
198
202
  type: :runtime
199
203
  prerelease: false
200
204
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
205
  requirements:
203
206
  - - ! '>='
204
207
  - !ruby/object:Gem::Version
@@ -206,7 +209,6 @@ dependencies:
206
209
  - !ruby/object:Gem::Dependency
207
210
  name: netrc
208
211
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
212
  requirements:
211
213
  - - ! '>='
212
214
  - !ruby/object:Gem::Version
@@ -214,7 +216,6 @@ dependencies:
214
216
  type: :runtime
215
217
  prerelease: false
216
218
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
219
  requirements:
219
220
  - - ! '>='
220
221
  - !ruby/object:Gem::Version
@@ -249,6 +250,8 @@ files:
249
250
  - lib/shelly/cli/file.rb
250
251
  - lib/shelly/cli/logs.rb
251
252
  - lib/shelly/cli/main.rb
253
+ - lib/shelly/cli/main/add.rb
254
+ - lib/shelly/cli/main/check.rb
252
255
  - lib/shelly/cli/organization.rb
253
256
  - lib/shelly/cli/runner.rb
254
257
  - lib/shelly/cli/user.rb
@@ -306,32 +309,48 @@ files:
306
309
  - spec/thor/options_spec.rb
307
310
  homepage: http://shellycloud.com
308
311
  licenses: []
312
+ metadata: {}
309
313
  post_install_message:
310
314
  rdoc_options: []
311
315
  require_paths:
312
316
  - lib
313
317
  required_ruby_version: !ruby/object:Gem::Requirement
314
- none: false
315
318
  requirements:
316
319
  - - ! '>='
317
320
  - !ruby/object:Gem::Version
318
321
  version: '0'
319
- segments:
320
- - 0
321
- hash: -1190904301794294451
322
322
  required_rubygems_version: !ruby/object:Gem::Requirement
323
- none: false
324
323
  requirements:
325
- - - ! '>='
324
+ - - ! '>'
326
325
  - !ruby/object:Gem::Version
327
- version: '0'
328
- segments:
329
- - 0
330
- hash: -1190904301794294451
326
+ version: 1.3.1
331
327
  requirements: []
332
328
  rubyforge_project: shelly
333
- rubygems_version: 1.8.25
329
+ rubygems_version: 2.0.3
334
330
  signing_key:
335
- specification_version: 3
331
+ specification_version: 4
336
332
  summary: Shelly Cloud command line tool
337
- test_files: []
333
+ test_files:
334
+ - spec/helpers.rb
335
+ - spec/input_faker.rb
336
+ - spec/shelly/app_spec.rb
337
+ - spec/shelly/backup_spec.rb
338
+ - spec/shelly/cli/backup_spec.rb
339
+ - spec/shelly/cli/config_spec.rb
340
+ - spec/shelly/cli/database_spec.rb
341
+ - spec/shelly/cli/deploy_spec.rb
342
+ - spec/shelly/cli/file_spec.rb
343
+ - spec/shelly/cli/logs_spec.rb
344
+ - spec/shelly/cli/main_spec.rb
345
+ - spec/shelly/cli/organization_spec.rb
346
+ - spec/shelly/cli/runner_spec.rb
347
+ - spec/shelly/cli/user_spec.rb
348
+ - spec/shelly/client_spec.rb
349
+ - spec/shelly/cloudfile_spec.rb
350
+ - spec/shelly/download_progress_bar_spec.rb
351
+ - spec/shelly/model_spec.rb
352
+ - spec/shelly/organization_spec.rb
353
+ - spec/shelly/structure_validator_spec.rb
354
+ - spec/shelly/user_spec.rb
355
+ - spec/spec_helper.rb
356
+ - spec/thor/options_spec.rb