lib/ember-cli/app.rb in ember-cli-rails-0.5.0 vs lib/ember-cli/app.rb in ember-cli-rails-0.5.1
- old
+ new
@@ -33,13 +33,13 @@
true
end
end
def build
- if EmberCli.env.development?
+ if development?
build_and_watch
- else
+ elsif test?
compile
end
@build.wait!
end
@@ -57,19 +57,25 @@
def sprockets
EmberCli::Sprockets.new(self)
end
def index_file
- if EmberCli.env.production?
+ if production?
paths.applications.join("#{name}.html")
else
paths.dist.join("index.html")
end
end
private
+ delegate :development?, :production?, :test?, to: :env
+
+ def env
+ EmberCli.env
+ end
+
def build_and_watch
prepare
@shell.build_and_watch
copy_index_html_file
end
@@ -82,10 +88,10 @@
true
end
end
def copy_index_html_file
- if EmberCli.env.production?
+ if production?
FileUtils.cp(paths.app_assets.join("index.html"), index_file)
end
end
def symlink_to_assets_root