ember-rails 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 916d617e38b6defe34e9a4fda6e864399d699a44
4
- data.tar.gz: f4cf0a357c14a700944c601a5ef20b433a471b46
3
+ metadata.gz: 0cf471e302779ef5b339f0ec11f3203c87175618
4
+ data.tar.gz: caacf1625d1b51543d5a6a3bb9d48e6b11574a91
5
5
  SHA512:
6
- metadata.gz: 3f1dd4bc588c9fe62bd10e04d19424cab5a28ed601e890d965f2be2b5a18b010113601e1f2058d688e71c49e20cd56b21ec302c6965040fb2ce01687b73fa9b6
7
- data.tar.gz: d9614b02448d13537139e0f2bcbaec40dc7f7857252a6181ddcdd2cc40993a1e38a215f1fd66458c3a8c33e352a0466842501fb705fd92ca45cfb83dc58d95de
6
+ metadata.gz: bc8dbdc727b58571d73433c900faa99bd84987f0445e6db9a7850e31db9a17efd8d2aa2c2550f01cb7643be22e131794c842a156278b753aeb03535e0134102c
7
+ data.tar.gz: bf42e6518eaf4028fe9656b977fd96103bae9f7ab450942edef13f9ac64d12c7ca65784d84cbce2b27fab34fb65a9a61510bbe2dd2217f7880c39db8cd8fb5eb
data/README.md CHANGED
@@ -14,10 +14,7 @@ You can see an example of how to use the gem [here](https://github.com/keithpitt
14
14
 
15
15
  ```ruby
16
16
  gem 'ember-rails'
17
- gem 'ember-source', '1.1.2' # or the version you need
18
-
19
- # optional since Handlebars 1.0.0 was released
20
- #gem 'handlebars-source', '~> 1.0.12' # or the version you need
17
+ gem 'ember-source', '1.2.0' # or the version you need
21
18
  ```
22
19
 
23
20
  * Run `bundle install`
@@ -1,5 +1,5 @@
1
1
  module Ember
2
2
  module Rails
3
- VERSION = '0.14.0'
3
+ VERSION = '0.14.1'
4
4
  end
5
5
  end
@@ -49,7 +49,9 @@ module Ember
49
49
  end
50
50
 
51
51
  def configuration
52
- ::Rails.configuration.ember
52
+ if defined?(::Rails) && ::Rails.configuration
53
+ ::Rails.configuration.ember
54
+ end
53
55
  end
54
56
  end
55
57
  end
@@ -20,27 +20,27 @@ module Ember
20
20
 
21
21
  desc "Install Ember.js into your vendor folder"
22
22
  class_option :head,
23
- :type => :boolean,
24
- :default => false,
23
+ :type => :boolean,
24
+ :default => false,
25
25
  :desc => "Download Ember.js & Ember data from canary channel. This is deprecated. Use channel instead."
26
26
  class_option :channel,
27
27
  :type => :string,
28
28
  :required => false,
29
29
  :desc => "Ember release channel Choose between 'release', 'beta' or 'canary'"
30
- class_option :ember_only,
31
- :type => :boolean,
32
- :required => false,
30
+ class_option :ember_only,
31
+ :type => :boolean,
32
+ :required => false,
33
33
  :desc => "Only download Ember.",
34
34
  :aliases => '--ember'
35
35
  class_option :ember_data_only,
36
- :type => :boolean,
37
- :required => false,
38
- :desc => "Only download ember-data",
36
+ :type => :boolean,
37
+ :required => false,
38
+ :desc => "Only download ember-data",
39
39
  :aliases => '--ember-data'
40
40
  class_option :tag,
41
41
  :type => :string,
42
- :required => false,
43
- :desc => "Download taged release use syntax v1.0.0-beta.3/ember-data & v1.0.0-rc.8/ember"
42
+ :required => false,
43
+ :desc => "Download tagged release use syntax v1.0.0-beta.3/ember-data & v1.0.0-rc.8/ember"
44
44
 
45
45
  def initialize(args = [], options = {}, config = {})
46
46
  super(args, options, config)
@@ -75,8 +75,17 @@ module Ember
75
75
 
76
76
 
77
77
  def get_ember_data_for(environment)
78
+ # temporarily using a variable here until a stable release of
79
+ # ember-data is released so that installing with ember-data
80
+ # *just works*.
81
+ chan = if channel == :release
82
+ say_status("warning:", 'Ember Data is not available on the :release channel. Falling back to beta channel.' , :yellow)
83
+ :beta
84
+ else
85
+ channel
86
+ end
78
87
  create_file "vendor/assets/ember/#{environment}/ember-data.js" do
79
- fetch "#{base_url}/#{channel}/#{file_name_for('ember-data', environment)}", "vendor/assets/ember/#{environment}/ember-data.js"
88
+ fetch "#{base_url}/#{chan}/#{file_name_for('ember-data', environment)}", "vendor/assets/ember/#{environment}/ember-data.js"
80
89
  end
81
90
  end
82
91
 
@@ -97,8 +106,8 @@ module Ember
97
106
  end
98
107
 
99
108
  def check_options
100
- if options.head?
101
- say('WARNING: --head option is deprecated in favor of --channel=cannary' , :yellow)
109
+ if options.head?
110
+ say('WARNING: --head option is deprecated in favor of --channel=canary' , :yellow)
102
111
  end
103
112
  if options.head? && options.channel?
104
113
  say 'ERROR: conflicting options. --head and --channel. Use either --head or --channel=<channel>', :red
@@ -123,7 +132,7 @@ module Ember
123
132
  end
124
133
 
125
134
  def process_options
126
- if options.head?
135
+ if options.head?
127
136
  @channel = :canary
128
137
  end
129
138
  if options.tag?
@@ -143,23 +152,27 @@ module Ember
143
152
  end
144
153
  end
145
154
 
146
-
147
155
  def fetch(from, to)
148
156
  message = "#{from} -> #{to}"
149
157
  say_status("downloading:", message , :green)
150
158
 
151
159
  uri = URI(from)
152
160
  output = StringIO.new
153
- output.puts "// Fetched from: " + uri.to_s
161
+ output.puts "// Fetched from channel: #{channel}, with url " + uri.to_s
154
162
  output.puts "// Fetched on: " + Time.now.utc.iso8601.to_s
155
- output.puts Net::HTTP.get(uri).force_encoding("UTF-8")
163
+ response = Net::HTTP.get_response(uri)
164
+ case response.code
165
+ when '404'
166
+ say "ERROR: Error reading the content from the channel with url #{from}. File not found" , :red
167
+ raise Thor::Error
168
+ when '200'
169
+ output.puts response.body.force_encoding("UTF-8")
170
+ else
171
+ say "ERROR: Unexpected error with status #{response.code} reading the content from the channel with url #{from}." , :red
172
+ raise Thor::Error
173
+ end
156
174
  output.rewind
157
175
  content = output.read
158
- if content.include?('404')
159
- say "ERROR: Error reading the content from the channel with url #{from}." , :red
160
- raise raise Thor::Error
161
- end
162
- content
163
176
  end
164
177
  end
165
178
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-11-04 00:00:00.000000000 Z
14
+ date: 2013-11-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: execjs
@@ -173,28 +173,28 @@ dependencies:
173
173
  requirements:
174
174
  - - ~>
175
175
  - !ruby/object:Gem::Version
176
- version: 1.1.0
176
+ version: '1.2'
177
177
  type: :development
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - ~>
182
182
  - !ruby/object:Gem::Version
183
- version: 1.1.0
183
+ version: '1.2'
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: handlebars-source
186
186
  requirement: !ruby/object:Gem::Requirement
187
187
  requirements:
188
188
  - - ~>
189
189
  - !ruby/object:Gem::Version
190
- version: 1.0.0
190
+ version: 1.1.1
191
191
  type: :development
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - ~>
196
196
  - !ruby/object:Gem::Version
197
- version: 1.0.0
197
+ version: 1.1.1
198
198
  - !ruby/object:Gem::Dependency
199
199
  name: sprockets-rails
200
200
  requirement: !ruby/object:Gem::Requirement
@@ -318,8 +318,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
318
  version: '0'
319
319
  requirements: []
320
320
  rubyforge_project:
321
- rubygems_version: 2.1.9
321
+ rubygems_version: 2.0.6
322
322
  signing_key:
323
323
  specification_version: 4
324
324
  summary: Ember for Rails 3.1+
325
325
  test_files: []
326
+ has_rdoc: