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
- #check_for_errors! ⇒ Object
- #compile ⇒ Object
- #dist_path ⇒ Object
- #index_html(head:, body:) ⇒ Object
-
#initialize(name, **options) ⇒ App
constructor
A new instance of App.
- #install_dependencies ⇒ Object
- #mountable? ⇒ Boolean
- #root_path ⇒ Object
- #test ⇒ Object
- #to_rack ⇒ Object
Constructor Details
#initialize(name, **options) ⇒ App
Returns a new instance of App.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ember_cli/app.rb', line 11 def initialize(name, **) @name = name.to_s @options = @paths = PathSet.new( app: self, 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.
9 10 11 |
# File 'lib/ember_cli/app.rb', line 9 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/ember_cli/app.rb', line 9 def @options end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
9 10 11 |
# File 'lib/ember_cli/app.rb', line 9 def paths @paths end |
Instance Method Details
#build ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ember_cli/app.rb', line 46 def build unless EmberCli.skip? if development? build_and_watch elsif test? compile end @build.wait! end end |
#check_for_errors! ⇒ Object
78 79 80 |
# File 'lib/ember_cli/app.rb', line 78 def check_for_errors! @build.check! end |
#compile ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/ember_cli/app.rb', line 36 def compile @compiled ||= begin prepare exit_status = @shell.compile @build.check! exit_status.success? end end |
#dist_path ⇒ Object
32 33 34 |
# File 'lib/ember_cli/app.rb', line 32 def dist_path paths.dist end |
#index_html(head:, body:) ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/ember_cli/app.rb', line 58 def index_html(head:, body:) html = HtmlPage::Renderer.new( head: head, body: body, content: deploy.index_html, ) html.render end |
#install_dependencies ⇒ Object
68 69 70 |
# File 'lib/ember_cli/app.rb', line 68 def install_dependencies @shell.install end |
#mountable? ⇒ Boolean
82 83 84 |
# File 'lib/ember_cli/app.rb', line 82 def mountable? deploy.mountable? end |
#root_path ⇒ Object
28 29 30 |
# File 'lib/ember_cli/app.rb', line 28 def root_path paths.root end |
#test ⇒ Object
72 73 74 75 76 |
# File 'lib/ember_cli/app.rb', line 72 def test prepare @shell.test.success? end |
#to_rack ⇒ Object
86 87 88 |
# File 'lib/ember_cli/app.rb', line 86 def to_rack deploy.to_rack end |