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
- #bower? ⇒ Boolean
- #build ⇒ Object
- #cached_directories ⇒ 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
- #yarn_enabled? ⇒ Boolean
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
#bower? ⇒ Boolean
94 95 96 |
# File 'lib/ember_cli/app.rb', line 94 def bower? paths.bower_json.exist? end |
#build ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ember_cli/app.rb', line 50 def build unless EmberCli.skip? if development? build_and_watch elsif test? compile end @build.wait! end end |
#cached_directories ⇒ Object
36 37 38 |
# File 'lib/ember_cli/app.rb', line 36 def cached_directories paths.cached_directories end |
#check_for_errors! ⇒ Object
82 83 84 |
# File 'lib/ember_cli/app.rb', line 82 def check_for_errors! @build.check! end |
#compile ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/ember_cli/app.rb', line 40 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
62 63 64 65 66 67 68 69 70 |
# File 'lib/ember_cli/app.rb', line 62 def index_html(head:, body:) html = HtmlPage::Renderer.new( head: head, body: body, content: deploy.index_html, ) html.render end |
#install_dependencies ⇒ Object
72 73 74 |
# File 'lib/ember_cli/app.rb', line 72 def install_dependencies @shell.install end |
#mountable? ⇒ Boolean
86 87 88 |
# File 'lib/ember_cli/app.rb', line 86 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
76 77 78 79 80 |
# File 'lib/ember_cli/app.rb', line 76 def test prepare @shell.test.success? end |
#to_rack ⇒ Object
98 99 100 |
# File 'lib/ember_cli/app.rb', line 98 def to_rack deploy.to_rack end |
#yarn_enabled? ⇒ Boolean
90 91 92 |
# File 'lib/ember_cli/app.rb', line 90 def yarn_enabled? .fetch(:yarn, false) end |