forked from thoughtbot/ember-cli-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So that the files and tests follow Ruby's naming idioms, move the contents of `lib/ember-cli-rails.rb` to `lib/ember_cli.rb`, to match the constant that the file contains.
- Loading branch information
1 parent
1089254
commit c11588e
Showing
2 changed files
with
68 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,3 @@ | ||
require "fileutils" | ||
require "ember-cli-rails-assets" | ||
require "ember_cli/engine" | ||
require "ember_cli/configuration" | ||
require "ember_cli/helpers" | ||
require "ember_cli/errors" | ||
|
||
module EmberCli | ||
extend self | ||
|
||
def configure | ||
yield configuration | ||
end | ||
|
||
def configuration | ||
Configuration.instance | ||
end | ||
|
||
def app(name) | ||
apps.fetch(name) do | ||
fail KeyError, "#{name.inspect} app is not defined" | ||
end | ||
end | ||
|
||
def build(name) | ||
app(name).build | ||
end | ||
|
||
alias_method :[], :app | ||
|
||
def skip? | ||
ENV["SKIP_EMBER"].present? | ||
end | ||
|
||
def install_dependencies! | ||
each_app(&:install_dependencies) | ||
end | ||
|
||
def test! | ||
each_app(&:test) | ||
end | ||
|
||
def compile! | ||
cleanup! | ||
each_app(&:compile) | ||
end | ||
|
||
def root | ||
@root ||= Rails.root.join("tmp", "ember-cli").tap(&:mkpath) | ||
end | ||
|
||
def env | ||
@env ||= Helpers.current_environment | ||
end | ||
|
||
delegate :apps, to: :configuration | ||
|
||
private | ||
|
||
def cleanup! | ||
root.children.each { |tmp_file| FileUtils.rm_rf(tmp_file) } | ||
end | ||
|
||
def each_app | ||
apps.each { |_, app| yield app } | ||
end | ||
end | ||
require "ember_cli" | ||
|
||
EmberCLI = EmberCli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
require "fileutils" | ||
require "ember-cli-rails-assets" | ||
require "ember_cli/engine" | ||
require "ember_cli/configuration" | ||
require "ember_cli/helpers" | ||
require "ember_cli/errors" | ||
|
||
module EmberCli | ||
extend self | ||
|
||
def configure | ||
yield configuration | ||
end | ||
|
||
def configuration | ||
Configuration.instance | ||
end | ||
|
||
def app(name) | ||
apps.fetch(name) do | ||
fail KeyError, "#{name.inspect} app is not defined" | ||
end | ||
end | ||
|
||
def build(name) | ||
app(name).build | ||
end | ||
|
||
alias_method :[], :app | ||
|
||
def skip? | ||
ENV["SKIP_EMBER"].present? | ||
end | ||
|
||
def install_dependencies! | ||
each_app(&:install_dependencies) | ||
end | ||
|
||
def test! | ||
each_app(&:test) | ||
end | ||
|
||
def compile! | ||
cleanup! | ||
each_app(&:compile) | ||
end | ||
|
||
def root | ||
@root ||= Rails.root.join("tmp", "ember-cli").tap(&:mkpath) | ||
end | ||
|
||
def env | ||
@env ||= Helpers.current_environment | ||
end | ||
|
||
delegate :apps, to: :configuration | ||
|
||
private | ||
|
||
def cleanup! | ||
root.children.each { |tmp_file| FileUtils.rm_rf(tmp_file) } | ||
end | ||
|
||
def each_app | ||
apps.each { |_, app| yield app } | ||
end | ||
end |