ember-cli-rails 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +64 -11
- data/lib/ember-cli/helpers.rb +4 -4
- data/lib/ember-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 030d5f1596ebae3fecc96c480954a9e4cb4e3151
|
4
|
+
data.tar.gz: f677b7c8673737370c96f354af72a7b6db07df61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 377903d80e5ee92956235ecc98fa4337b81ace80869d44ec8627adcba014e33ec433e523b0c5fdfa1c651c3f47d995fd4e3e8a6a280344360ad32d8d40dafb75
|
7
|
+
data.tar.gz: 0b0fa9d57c95603281445df2ab1e8e3db21b0471c9103dac625e18b61e03a77e5a2c4b72f20b93b9b312fd88626944399b56f4a63f566a141b02db6931f6c282
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -83,7 +83,7 @@ end
|
|
83
83
|
|
84
84
|
## Usage
|
85
85
|
|
86
|
-
You render your
|
86
|
+
You render your EmberCLI app by including the corresponding JS/CSS tags in whichever
|
87
87
|
Rails view you'd like the Ember app to appear.
|
88
88
|
|
89
89
|
For example, if you had the following Rails app
|
@@ -123,26 +123,79 @@ init` and then add the following to your `Guardfile`.
|
|
123
123
|
```ruby
|
124
124
|
guard "livereload" do
|
125
125
|
# ...
|
126
|
-
watch %r{app/<your-appname
|
126
|
+
watch %r{app/<your-appname>/app/\w+/.+\.(js|hbs|html|css|<other-extensions>)}
|
127
127
|
# ...
|
128
128
|
end
|
129
129
|
```
|
130
130
|
|
131
131
|
This tells Guard to watch your EmberCLI app for any changes to the JavaScript,
|
132
|
-
Handlebars, HTML, or CSS files. Take note that other
|
133
|
-
the line (such as `coffee` for CoffeeScript) to
|
132
|
+
Handlebars, HTML, or CSS files within `app` path. Take note that other
|
133
|
+
extensions can be added to the line (such as `coffee` for CoffeeScript) to
|
134
|
+
watch them for changes as well.
|
135
|
+
|
136
|
+
## Heroku
|
137
|
+
|
138
|
+
In order to deploy EmberCLI Rails app to Heroku you need to follow the steps
|
139
|
+
below:
|
140
|
+
|
141
|
+
First, enable Heroku Multi Buildpack by running the following command:
|
142
|
+
|
143
|
+
```sh
|
144
|
+
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi
|
145
|
+
```
|
146
|
+
|
147
|
+
Next, check in `.buildpacks` file to specify which buildpacks to use:
|
148
|
+
|
149
|
+
```
|
150
|
+
https://github.com/heroku/heroku-buildpack-nodejs
|
151
|
+
https://github.com/heroku/heroku-buildpack-ruby
|
152
|
+
```
|
153
|
+
|
154
|
+
Add `rails_12factor` gem to your production group in Gemfile, then run `bundle
|
155
|
+
install`:
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
gem "rails_12factor", group: :production
|
159
|
+
```
|
160
|
+
|
161
|
+
Add a `package.json` to the root of your Rails project. This is to make sure
|
162
|
+
it'll be detected by the NodeJS buildpack.
|
163
|
+
|
164
|
+
```javascript
|
165
|
+
{
|
166
|
+
"dependencies": {
|
167
|
+
"bower": "*"
|
168
|
+
}
|
169
|
+
}
|
170
|
+
```
|
171
|
+
|
172
|
+
Add a `postinstall` task to your EmberCLI app's `package.json`. This will
|
173
|
+
ensure that during the deployment process, Heroku will install all dependencies
|
174
|
+
found in both `node_modules` and `bower_components`.
|
175
|
+
|
176
|
+
```javascript
|
177
|
+
{
|
178
|
+
# ...
|
179
|
+
"scripts": {
|
180
|
+
# ...
|
181
|
+
"postinstall": "../../node_modules/bower/bin/bower install"
|
182
|
+
}
|
183
|
+
}
|
184
|
+
```
|
185
|
+
|
186
|
+
Now you should be ready to deploy.
|
134
187
|
|
135
188
|
## Additional Information
|
136
189
|
|
137
|
-
When running in the development environment, EmberCLI Rails runs `ember build`
|
138
|
-
with the `--output-path` and `--watch` flags on. The `--watch` flag tells
|
139
|
-
EmberCLI to watch for file system events and rebuild when an EmberCLI file is
|
140
|
-
The `--output-path` flag specifies where the distribution files will
|
141
|
-
EmberCLI Rails does some fancy stuff to get it into your asset path
|
142
|
-
polluting your git history. Note that for this to work, you must have
|
190
|
+
When running in the development environment, EmberCLI Rails runs `ember build`
|
191
|
+
with the `--output-path` and `--watch` flags on. The `--watch` flag tells
|
192
|
+
EmberCLI to watch for file system events and rebuild when an EmberCLI file is
|
193
|
+
changed. The `--output-path` flag specifies where the distribution files will
|
194
|
+
be put. EmberCLI Rails does some fancy stuff to get it into your asset path
|
195
|
+
without polluting your git history. Note that for this to work, you must have
|
143
196
|
`config.consider_all_requests_local = true` set in
|
144
197
|
`config/environments/development.rb`, otherwise the middleware responsible for
|
145
|
-
building
|
198
|
+
building EmberCLI will not be enabled.
|
146
199
|
|
147
200
|
Alternatively, if you want to override the default behavior in any given Rails
|
148
201
|
environment, you can manually set the `config.use_ember_middleware` and
|
data/lib/ember-cli/helpers.rb
CHANGED
@@ -26,16 +26,16 @@ module EmberCLI
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def use_middleware?
|
29
|
-
rails_config_for(:use_ember_middleware
|
29
|
+
rails_config_for(:use_ember_middleware, non_production?)
|
30
30
|
end
|
31
31
|
|
32
32
|
def use_live_recompilation?
|
33
|
-
rails_config_for(:use_ember_live_recompilation
|
33
|
+
rails_config_for(:use_ember_live_recompilation, Rails.env.development?)
|
34
34
|
end
|
35
35
|
|
36
|
-
def rails_config_for(key)
|
36
|
+
def rails_config_for(key, default=false)
|
37
37
|
config = Rails.configuration
|
38
|
-
config.respond_to?(key)
|
38
|
+
config.respond_to?(key) ? config.public_send(key) : default
|
39
39
|
end
|
40
40
|
|
41
41
|
def override_assets_precompile_task!
|
data/lib/ember-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-cli-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pravosud
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01-
|
12
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|