Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/generators/ember/heroku/USAGE
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
Description:
Configures a project for deploying to Heroku.

Once the generator is complete, execute the following:
Once the generator is complete, add the buildpacks the deploy needs:

$ heroku buildpacks:clear
$ heroku buildpacks:add --index 1 heroku/nodejs
$ heroku buildpacks:add --index 2 heroku/ruby

`SKIP_EMBER` skips the build wherever it is set. Unset it on the Heroku
application, so that `assets:precompile` compiles the EmberCLI
applications at deploy time:

$ heroku config:unset SKIP_EMBER

Example:
Expand All @@ -16,3 +21,9 @@ Example:

This will create:
package.json

An application configured with `yarn` also creates:
yarn.lock

Run the generator again whenever you add an EmberCLI application: the
generated `cacheDirectories` names each application's `node_modules`.
6 changes: 0 additions & 6 deletions lib/generators/ember/heroku/heroku_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ def project_root_cached_directories
[Rails.root.join("node_modules")]
end

def app_paths
EmberCli.apps.values.map do |app|
app.root_path.relative_path_from(Rails.root)
end
end

def apps
EmberCli.apps.values
end
Expand Down
23 changes: 23 additions & 0 deletions spec/generators/ember/init/init_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require "generator_spec"
require "generators/ember/init/init_generator"

describe EmberCli::InitGenerator, type: :generator do
destination Rails.root.join("tmp", "init_generator_test_output")

it "generates an initializer that configures an application" do
prepare_destination

run_generator

expect(destination_root).to have_structure {
directory "config" do
directory "initializers" do
file "ember.rb" do
contains "EmberCli.configure"
contains "c.app :frontend"
end
end
end
}
end
end