ember-cli-rails 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ember-cli-rails.rb +18 -7
- data/lib/ember-cli/app.rb +14 -7
- data/lib/ember-cli/configuration.rb +2 -2
- data/lib/ember-cli/helpers.rb +5 -1
- data/lib/ember-cli/railtie.rb +5 -7
- data/lib/ember-cli/version.rb +1 -1
- metadata +4 -6
- data/lib/ember-cli/rack_server.rb +0 -10
- data/lib/ember-cli/rake_task.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e781eea1e9e1586408d6af0ffb8438989446554b
|
4
|
+
data.tar.gz: 5b40c7081f54e4a51447393c91bf6c8f1cdb0501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21dfad6429f5ee62379deaed39cb33d09b570c1fd0796665b8c35e7b76a6edfeeb0805a203284b1aaeb6d7a598bf60fbd78f1ec67dfe325b34957fd4f59e9d6f
|
7
|
+
data.tar.gz: 42a6d2cd995a60ded8da52383bd8ce16ccdd9a3af0504c36ae0b2ea432eadce1657c97c5061046cb5d3aeaa6e03d87a15427a0e15c5eb04998885497d680b3c6
|
data/lib/ember-cli-rails.rb
CHANGED
@@ -5,7 +5,6 @@ module EmberCLI
|
|
5
5
|
|
6
6
|
autoload :App, "ember-cli/app"
|
7
7
|
autoload :Configuration, "ember-cli/configuration"
|
8
|
-
autoload :RackServer, "ember-cli/rack_server"
|
9
8
|
autoload :ViewHelpers, "ember-cli/view_helpers"
|
10
9
|
autoload :Helpers, "ember-cli/helpers"
|
11
10
|
|
@@ -26,15 +25,27 @@ module EmberCLI
|
|
26
25
|
end
|
27
26
|
|
28
27
|
def enable!
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
prepare!
|
29
|
+
|
30
|
+
Rails.application.instance_eval do
|
31
|
+
singleton_class.instance_eval do
|
32
|
+
alias_method :call_without_ember_cli, :call
|
33
|
+
end
|
34
|
+
|
35
|
+
def call(env)
|
36
|
+
@_ember_cli_enabled ||= begin
|
37
|
+
EmberCLI.compile!
|
38
|
+
EmberCLI.run! if Rails.env.development?
|
39
|
+
true
|
40
|
+
end
|
41
|
+
|
42
|
+
call_without_ember_cli(env)
|
43
|
+
end
|
34
44
|
end
|
35
45
|
end
|
36
46
|
|
37
47
|
def run!
|
48
|
+
prepare!
|
38
49
|
each_app &:run
|
39
50
|
end
|
40
51
|
|
@@ -62,6 +73,6 @@ module EmberCLI
|
|
62
73
|
end
|
63
74
|
|
64
75
|
def each_app
|
65
|
-
configuration.apps.
|
76
|
+
configuration.apps.each{ |name, app| yield app }
|
66
77
|
end
|
67
78
|
end
|
data/lib/ember-cli/app.rb
CHANGED
@@ -2,20 +2,19 @@ module EmberCLI
|
|
2
2
|
class App
|
3
3
|
attr_reader :name, :options, :pid
|
4
4
|
|
5
|
-
def initialize(name,
|
5
|
+
def initialize(name, options={})
|
6
6
|
@name, @options = name.to_s, options
|
7
7
|
end
|
8
8
|
|
9
9
|
def compile
|
10
|
-
|
11
|
-
add_assets_to_precompile_list
|
10
|
+
prepare
|
12
11
|
silence_stream STDOUT do
|
13
12
|
system command, chdir: app_path, err: :out
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
17
16
|
def run
|
18
|
-
|
17
|
+
prepare
|
19
18
|
@pid = spawn(command(watch: true), chdir: app_path, err: :out)
|
20
19
|
at_exit{ stop }
|
21
20
|
end
|
@@ -35,6 +34,14 @@ module EmberCLI
|
|
35
34
|
delegate :tee_path, to: :configuration
|
36
35
|
delegate :configuration, to: :EmberCLI
|
37
36
|
|
37
|
+
def prepare
|
38
|
+
@prepared ||= begin
|
39
|
+
symlink_to_assets_root
|
40
|
+
add_assets_to_precompile_list
|
41
|
+
true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
38
45
|
def symlink_to_assets_root
|
39
46
|
assets_path.join(name).make_symlink dist_path.join("assets")
|
40
47
|
end
|
@@ -43,8 +50,8 @@ module EmberCLI
|
|
43
50
|
Rails.configuration.assets.precompile << /(?:\/|\A)#{name}\//
|
44
51
|
end
|
45
52
|
|
46
|
-
def command(
|
47
|
-
watch = "--watch"
|
53
|
+
def command(options={})
|
54
|
+
watch = options[:watch] ? "--watch" : ""
|
48
55
|
"#{ember_path} build #{watch} --environment #{environment} --output-path #{dist_path} #{log_pipe}"
|
49
56
|
end
|
50
57
|
|
@@ -75,7 +82,7 @@ module EmberCLI
|
|
75
82
|
end
|
76
83
|
|
77
84
|
def environment
|
78
|
-
|
85
|
+
Helpers.non_production?? "development" : "production"
|
79
86
|
end
|
80
87
|
end
|
81
88
|
end
|
data/lib/ember-cli/helpers.rb
CHANGED
@@ -15,10 +15,14 @@ module EmberCLI
|
|
15
15
|
nil
|
16
16
|
end
|
17
17
|
|
18
|
+
def non_production?
|
19
|
+
!Rails.env.production? && Rails.configuration.consider_all_requests_local
|
20
|
+
end
|
21
|
+
|
18
22
|
def override_assets_precompile_task!
|
19
23
|
Rake.application.instance_eval do
|
20
24
|
@tasks["assets:precompile:original"] = @tasks.delete("assets:precompile")
|
21
|
-
Rake::Task.define_task "assets:precompile",
|
25
|
+
Rake::Task.define_task "assets:precompile", [:assets, :precompile] => :environment do
|
22
26
|
EmberCLI.compile!
|
23
27
|
Rake::Task["assets:precompile:original"].execute
|
24
28
|
end
|
data/lib/ember-cli/railtie.rb
CHANGED
@@ -5,21 +5,19 @@ module EmberCLI
|
|
5
5
|
end
|
6
6
|
|
7
7
|
initializer "ember-cli-rails.inflector" do
|
8
|
-
ActiveSupport::Inflector.inflections
|
8
|
+
ActiveSupport::Inflector.inflections :en do |inflect|
|
9
9
|
inflect.acronym "CLI"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
initializer "ember-cli-rails.
|
14
|
-
EmberCLI.enable! if non_production?
|
13
|
+
initializer "ember-cli-rails.enable" do
|
14
|
+
EmberCLI.enable! if EmberCLI::Helpers.non_production?
|
15
15
|
end
|
16
16
|
|
17
17
|
rake_tasks do
|
18
|
-
require "
|
18
|
+
require "sprockets/rails/task"
|
19
|
+
EmberCLI::Helpers.override_assets_precompile_task!
|
19
20
|
end
|
20
21
|
|
21
|
-
def non_production?
|
22
|
-
!Rails.env.production? && Rails.configuration.consider_all_requests_local
|
23
|
-
end
|
24
22
|
end
|
25
23
|
end
|
data/lib/ember-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-cli-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pravosud
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -39,9 +39,7 @@ files:
|
|
39
39
|
- lib/ember-cli/app.rb
|
40
40
|
- lib/ember-cli/configuration.rb
|
41
41
|
- lib/ember-cli/helpers.rb
|
42
|
-
- lib/ember-cli/rack_server.rb
|
43
42
|
- lib/ember-cli/railtie.rb
|
44
|
-
- lib/ember-cli/rake_task.rb
|
45
43
|
- lib/ember-cli/version.rb
|
46
44
|
- lib/ember-cli/view_helpers.rb
|
47
45
|
- lib/generators/ember-cli/init/USAGE
|
@@ -57,9 +55,9 @@ require_paths:
|
|
57
55
|
- lib
|
58
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
57
|
requirements:
|
60
|
-
- - "
|
58
|
+
- - ">="
|
61
59
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
60
|
+
version: 1.9.3
|
63
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
62
|
requirements:
|
65
63
|
- - ">="
|
data/lib/ember-cli/rake_task.rb
DELETED