Module: EmberCLI

Extended by:
EmberCLI
Included in:
EmberCLI
Defined in:
lib/ember-cli/app.rb,
lib/ember-cli-rails.rb,
lib/ember-cli/engine.rb,
lib/ember-cli/runner.rb,
lib/ember-cli/helpers.rb,
lib/ember-cli/version.rb,
lib/ember-cli/path_set.rb,
lib/ember-cli/middleware.rb,
lib/ember-cli/configuration.rb,
lib/generators/ember-cli/init/init_generator.rb

Defined Under Namespace

Modules: Helpers Classes: App, Configuration, Engine, InitGenerator, Middleware, PathSet, Runner

Constant Summary collapse

VERSION =
"0.3.1".freeze

Instance Method Summary collapse

Instance Method Details

#app(name) ⇒ Object Also known as: []



21
22
23
24
25
# File 'lib/ember-cli-rails.rb', line 21

def app(name)
  apps.fetch(name) do
    fail KeyError, "#{name.inspect} app is not defined"
  end
end

#compile! ⇒ Object



56
57
58
59
# File 'lib/ember-cli-rails.rb', line 56

def compile!
  prepare!
  each_app &:compile
end

#configuration ⇒ Object



17
18
19
# File 'lib/ember-cli-rails.rb', line 17

def configuration
  Configuration.instance
end

#configure {|configuration| ... } ⇒ Object

Yields:



13
14
15
# File 'lib/ember-cli-rails.rb', line 13

def configure
  yield configuration
end

#enable! ⇒ Object



41
42
43
44
# File 'lib/ember-cli-rails.rb', line 41

def enable!
  prepare!
  append_middleware unless env.production?
end

#env ⇒ Object



69
70
71
# File 'lib/ember-cli-rails.rb', line 69

def env
  @env ||= Helpers.current_environment.inquiry
end

#install_dependencies! ⇒ Object



46
47
48
49
# File 'lib/ember-cli-rails.rb', line 46

def install_dependencies!
  prepare!
  each_app &:install_dependencies
end

#prepare! ⇒ Object



33
34
35
36
37
38
39
# File 'lib/ember-cli-rails.rb', line 33

def prepare!
  @prepared ||= begin
    Rails.configuration.assets.paths << root.join("assets").to_s
    at_exit{ cleanup }
    true
  end
end

#process_path(path) ⇒ Object



61
62
63
# File 'lib/ember-cli-rails.rb', line 61

def process_path(path)
  each_app{ |app| Runner.new(app, path).process }
end

#root ⇒ Object



65
66
67
# File 'lib/ember-cli-rails.rb', line 65

def root
  @root ||= Rails.root.join("tmp", "ember-cli-#{uid}")
end

#run_tests! ⇒ Object



51
52
53
54
# File 'lib/ember-cli-rails.rb', line 51

def run_tests!
  prepare!
  each_app &:run_tests
end

#skip? ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/ember-cli-rails.rb', line 29

def skip?
  ENV["SKIP_EMBER"].present?
end