strobe 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,9 +52,12 @@ module Strobe
52
52
  CLI::Users.start(argv)
53
53
  end
54
54
 
55
+ method_option "production", :type => :boolean, :banner => "open production version of this application"
55
56
  action "open", "opens application in browser" do
56
57
  resource get_application
57
- url = resource.web_url
58
+
59
+ environment = options[:production] ? "production" : "staging"
60
+ url = resource.environment_url(environment)
58
61
 
59
62
  Launchy.open("http://#{url}")
60
63
  end
@@ -126,15 +129,15 @@ module Strobe
126
129
  id = options['application-id'] || config[:application_id]
127
130
  resource Application.get!(id)
128
131
 
129
- host = resource.web_url
130
- host = "staging.#{host}" unless options[:production]
132
+ env = (options[:production] ? "production" : "staging")
133
+ host = resource.environment_url(env)
131
134
 
132
135
  unless agree "Rolling back '#{resource[:name]}' to #{sha} for http://#{host}, continue? [Yn] "
133
136
  say "exiting..."
134
137
  exit
135
138
  end
136
139
 
137
- host = resource.rollback! sha, :environment => (options[:production] ? "production" : "staging"),
140
+ host = resource.rollback! sha, :environment => env,
138
141
  :message => options[:message]
139
142
 
140
143
  say "The application has successfully been rolled back to #{sha} and is available at #{host}"
@@ -149,6 +152,7 @@ module Strobe
149
152
  method_option "url", :banner => "set application's url"
150
153
  action "deploy", "deploy your application to Strobe" do
151
154
  ensure_computer_is_registered
155
+ env = (options[:production] ? "production" : "staging")
152
156
 
153
157
  if application_id = config[:application_id]
154
158
  resource Application.get! application_id, :lazy => true
@@ -157,8 +161,7 @@ module Strobe
157
161
  resource.set_web_url!(options[:url])
158
162
  end
159
163
 
160
- host = resource.web_url
161
- host = "staging.#{host}" unless options[:production]
164
+ host = resource.environment_url(env)
162
165
 
163
166
  unless agree "Deploying '#{resource[:name]}' to http://#{host}, continue? [Yn] "
164
167
  say "exiting..."
@@ -189,7 +192,7 @@ module Strobe
189
192
  run_sc_build
190
193
 
191
194
  begin
192
- host = resource.deploy! :environment => (options[:production] ? "production" : "staging"),
195
+ host = resource.deploy! :environment => env,
193
196
  :callback => CLI::DeployProgress.new,
194
197
  :message => options[:message] || git_message,
195
198
  :sproutcore => is_sproutcore?,
@@ -31,6 +31,19 @@ module Strobe
31
31
  web_install['install_uri']
32
32
  end
33
33
 
34
+ def environment_url(environment)
35
+ if environment.blank? || environment == "production"
36
+ web_url
37
+ else
38
+ uri = web_install['environment_uri']
39
+
40
+ # TODO: remove next line when environment_uri stuff is released
41
+ uri = web_url if uri.blank?
42
+
43
+ "#{environment}.#{uri}"
44
+ end
45
+ end
46
+
34
47
  def set_web_url!(url)
35
48
  install = web_install
36
49
  install['url'] = url
@@ -56,7 +69,7 @@ module Strobe
56
69
  response
57
70
  end
58
71
 
59
- [ environment, self.web_url ].compact.join('.')
72
+ environment_url(environment)
60
73
  end
61
74
 
62
75
  def deploy!(opts = {})
@@ -96,7 +109,7 @@ module Strobe
96
109
  response
97
110
  end
98
111
 
99
- [ environment, self.web_url ].compact.join('.')
112
+ environment_url(environment)
100
113
  end
101
114
 
102
115
  private
@@ -1,3 +1,3 @@
1
1
  module Strobe
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strobe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-25 00:00:00.000000000Z
12
+ date: 2011-08-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
- requirement: &2158028000 !ruby/object:Gem::Requirement
16
+ requirement: &2157177420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2158028000
24
+ version_requirements: *2157177420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mime-types
27
- requirement: &2158027420 !ruby/object:Gem::Requirement
27
+ requirement: &2157176820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.16.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2158027420
35
+ version_requirements: *2157176820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack
38
- requirement: &2158026620 !ruby/object:Gem::Requirement
38
+ requirement: &2157176120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.3.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2158026620
46
+ version_requirements: *2157176120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: thin
49
- requirement: &2158026040 !ruby/object:Gem::Requirement
49
+ requirement: &2157175280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.2.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2158026040
57
+ version_requirements: *2157175280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: em-http-request
60
- requirement: &2158021320 !ruby/object:Gem::Requirement
60
+ requirement: &2157174400 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.0.beta
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2158021320
68
+ version_requirements: *2157174400
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
- requirement: &2158020680 !ruby/object:Gem::Requirement
71
+ requirement: &2157173560 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.14.0
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2158020680
79
+ version_requirements: *2157173560
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: oauth
82
- requirement: &2158020140 !ruby/object:Gem::Requirement
82
+ requirement: &2157172660 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.4.5
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2158020140
90
+ version_requirements: *2157172660
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: launchy
93
- requirement: &2158019680 !ruby/object:Gem::Requirement
93
+ requirement: &2157171900 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2158019680
101
+ version_requirements: *2157171900
102
102
  description: The client library for deploying applications to Strobe's HTML5 deployment
103
103
  platform
104
104
  email: