Class: EmberCli::App
- Inherits:
-
Object
- Object
- EmberCli::App
- Defined in:
- lib/ember_cli/app.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
- #build ⇒ Object
- #compile ⇒ Object
- #index_file ⇒ Object
-
#initialize(name, **options) ⇒ App
constructor
A new instance of App.
- #install_dependencies ⇒ Object
- #sprockets ⇒ Object
- #test ⇒ Object
Constructor Details
#initialize(name, **options) ⇒ App
Returns a new instance of App.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ember_cli/app.rb', line 9 def initialize(name, **) @name = name.to_s @options = @paths = PathSet.new( app: self, configuration: EmberCli.configuration, environment: Rails.env, rails_root: Rails.root, ember_cli_root: EmberCli.root, ) @shell = Shell.new( paths: @paths, env: env_hash, options: , ) @build = BuildMonitor.new(name, @paths) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/ember_cli/app.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/ember_cli/app.rb', line 7 def @options end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
7 8 9 |
# File 'lib/ember_cli/app.rb', line 7 def paths @paths end |
Instance Method Details
#build ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/ember_cli/app.rb', line 37 def build if development? build_and_watch elsif test? compile end @build.wait! end |
#compile ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/ember_cli/app.rb', line 27 def compile @compiled ||= begin prepare @shell.compile @build.check! copy_index_html_file true end end |
#index_file ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/ember_cli/app.rb', line 61 def index_file if production? paths.applications.join("#{name}.html") else paths.dist.join("index.html") end end |
#install_dependencies ⇒ Object
47 48 49 |
# File 'lib/ember_cli/app.rb', line 47 def install_dependencies @shell.install end |
#sprockets ⇒ Object
57 58 59 |
# File 'lib/ember_cli/app.rb', line 57 def sprockets EmberCli::Sprockets.new(self) end |
#test ⇒ Object
51 52 53 54 55 |
# File 'lib/ember_cli/app.rb', line 51 def test prepare @shell.test end |