ember-cli-rails 0.0.18 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/lib/ember-cli-rails.rb +5 -0
- data/lib/ember-cli/app.rb +41 -3
- data/lib/ember-cli/configuration.rb +4 -0
- data/lib/ember-cli/helpers.rb +1 -1
- data/lib/ember-cli/railtie.rb +1 -0
- data/lib/ember-cli/version.rb +1 -1
- data/lib/tasks/ember-cli.rake +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a08a5e8f40b04f129a52111debe85c7ba3d18020
|
4
|
+
data.tar.gz: 1ccad7df9c3612812095e776becf4cf87314e1d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465c7fecc91622ee2c8cbf9b01b4f1012c3e411628d06fe5f5845eb146aa6df635051d90ce9d36158db3fac29bbd8de3693aa47c3fda58813d5c818229e41ee8
|
7
|
+
data.tar.gz: ea65b28b73265023bc0325a7c39de2e168fd71158f5dfdc471597e7fae6d6819e8fae90ccbb81ddf1b93247be2f47f86f638e960d98f3a95dd1c5ee13b39651d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -64,7 +64,7 @@ Once you've updated your initializer to taste, you need to install the
|
|
64
64
|
For each of your EmberCLI applications install the addon with:
|
65
65
|
|
66
66
|
```sh
|
67
|
-
npm install --save-dev ember-cli-rails-addon@0.0.
|
67
|
+
npm install --save-dev ember-cli-rails-addon@0.0.9
|
68
68
|
```
|
69
69
|
|
70
70
|
And that's it!
|
@@ -145,7 +145,7 @@ polluting your git history. Note that for this to work, you must have
|
|
145
145
|
building Ember CLI will not be enabled.
|
146
146
|
|
147
147
|
|
148
|
-
#### Ember
|
148
|
+
#### Ember Dependencies
|
149
149
|
|
150
150
|
Ember has several dependencies. Some of these dependencies might already be
|
151
151
|
present in your asset list. For example jQuery is bundled in `jquery-rails` gem.
|
data/lib/ember-cli-rails.rb
CHANGED
data/lib/ember-cli/app.rb
CHANGED
@@ -2,9 +2,11 @@ require "timeout"
|
|
2
2
|
|
3
3
|
module EmberCLI
|
4
4
|
class App
|
5
|
-
ADDON_VERSION = "0.0.
|
5
|
+
ADDON_VERSION = "0.0.9"
|
6
6
|
EMBER_CLI_VERSION = "~> 0.1.5"
|
7
7
|
|
8
|
+
class BuildError < StandardError; end
|
9
|
+
|
8
10
|
attr_reader :name, :options, :pid
|
9
11
|
|
10
12
|
def initialize(name, options={})
|
@@ -14,6 +16,11 @@ module EmberCLI
|
|
14
16
|
def compile
|
15
17
|
prepare
|
16
18
|
silence_stream(STDOUT){ exec command }
|
19
|
+
check_for_build_error!
|
20
|
+
end
|
21
|
+
|
22
|
+
def install_dependencies
|
23
|
+
exec "#{npm_path} install"
|
17
24
|
end
|
18
25
|
|
19
26
|
def run
|
@@ -38,7 +45,7 @@ module EmberCLI
|
|
38
45
|
|
39
46
|
def wait
|
40
47
|
Timeout.timeout(build_timeout) do
|
41
|
-
|
48
|
+
wait_for_build_complete_or_error
|
42
49
|
end
|
43
50
|
rescue Timeout::Error
|
44
51
|
suggested_timeout = build_timeout + 5
|
@@ -78,7 +85,7 @@ module EmberCLI
|
|
78
85
|
private
|
79
86
|
|
80
87
|
delegate :match_version?, :non_production?, to: Helpers
|
81
|
-
delegate :tee_path, to: :configuration
|
88
|
+
delegate :tee_path, :npm_path, to: :configuration
|
82
89
|
delegate :configuration, to: :EmberCLI
|
83
90
|
|
84
91
|
def build_timeout
|
@@ -89,10 +96,33 @@ module EmberCLI
|
|
89
96
|
tmp_path.join("build.lock")
|
90
97
|
end
|
91
98
|
|
99
|
+
def check_for_build_error!
|
100
|
+
raise_build_error! if build_error_file.exist?
|
101
|
+
end
|
102
|
+
|
103
|
+
def build_error_file
|
104
|
+
tmp_path.join("error.txt")
|
105
|
+
end
|
106
|
+
|
107
|
+
def reset_build_error!
|
108
|
+
build_error_file.delete if build_error?
|
109
|
+
end
|
110
|
+
|
111
|
+
def build_error?
|
112
|
+
build_error_file.exist?
|
113
|
+
end
|
114
|
+
|
115
|
+
def raise_build_error!
|
116
|
+
error = BuildError.new("EmberCLI app #{name.inspect} has failed to build")
|
117
|
+
error.set_backtrace build_error_file.read.split(?\n)
|
118
|
+
fail error
|
119
|
+
end
|
120
|
+
|
92
121
|
def prepare
|
93
122
|
@prepared ||= begin
|
94
123
|
check_addon!
|
95
124
|
check_ember_cli_version!
|
125
|
+
reset_build_error!
|
96
126
|
FileUtils.touch lockfile
|
97
127
|
symlink_to_assets_root
|
98
128
|
add_assets_to_precompile_list
|
@@ -215,5 +245,13 @@ module EmberCLI
|
|
215
245
|
Kernel.public_send(method_name, env_hash, cmd, err: :out)
|
216
246
|
end
|
217
247
|
end
|
248
|
+
|
249
|
+
def wait_for_build_complete_or_error
|
250
|
+
loop do
|
251
|
+
check_for_build_error!
|
252
|
+
break unless lockfile.exist?
|
253
|
+
sleep 0.1
|
254
|
+
end
|
255
|
+
end
|
218
256
|
end
|
219
257
|
end
|
data/lib/ember-cli/helpers.rb
CHANGED
@@ -28,7 +28,7 @@ module EmberCLI
|
|
28
28
|
def override_assets_precompile_task!
|
29
29
|
Rake.application.instance_eval do
|
30
30
|
@tasks["assets:precompile:original"] = @tasks.delete("assets:precompile")
|
31
|
-
Rake::Task.define_task "assets:precompile", [:assets, :precompile] => :
|
31
|
+
Rake::Task.define_task "assets:precompile", [:assets, :precompile] => "ember-cli:install_dependencies" do
|
32
32
|
EmberCLI.compile!
|
33
33
|
Rake::Task["assets:precompile:original"].execute
|
34
34
|
end
|
data/lib/ember-cli/railtie.rb
CHANGED
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.1.0
|
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: 2015-01-
|
12
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/generators/ember-cli/init/USAGE
|
62
62
|
- lib/generators/ember-cli/init/init_generator.rb
|
63
63
|
- lib/generators/ember-cli/init/templates/initializer.rb
|
64
|
+
- lib/tasks/ember-cli.rake
|
64
65
|
homepage: https://github.com/rwz/ember-cli-rails
|
65
66
|
licenses:
|
66
67
|
- MIT
|