ember-cli-rails 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff30b30d60cf45b946c688fc355c29c2ac79e1a5
4
- data.tar.gz: 89d52810daf83b9b675f8a59f83aef69dfb76370
3
+ metadata.gz: b6f1ecfa7b10f43b47a13ba32488120646db7e4e
4
+ data.tar.gz: 24f6c8380556baec9fe584b07a325154150b3466
5
5
  SHA512:
6
- metadata.gz: f0353db532b3c66bd5bc9183a40ea5399c44e35ed7343f285488a1803b85c980cbf4b76b7ac8b6f085e173e857dd1e23a4c3a2835a5964f07819d2936d3dc2f4
7
- data.tar.gz: 7ff75f83a0be222d214d878356621b4dc27c9c4da9af965654c0937090bc134c67411eb675d1657c61ed5e978aad46825c289a6874105771c77d738f62c40759
6
+ metadata.gz: 586309531996485760e27515c587694ba551dd04d73d23e9bb0ec94f0716d95956c596d136dc8bfac347e32fe723b709a6ef955c631dab4d530ddf6d1d9d692e
7
+ data.tar.gz: c68bdcebcbcf4af6c1f477041ca1b91a19b2b677d70d81ca1d2edffb000832165e34407990f01cb2a6f6eb5f879b191d6aea42165d1257ddf099ef9ef3675727
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.8.6
5
+ -----
6
+
7
+ * Don't require `bower` installation if `bower.json` is missing [#532]
8
+
9
+ [#532]: https://github.com/thoughtbot/ember-cli-rails/pull/532
10
+
4
11
  0.8.5
5
12
  -----
6
13
 
data/README.md CHANGED
@@ -270,7 +270,8 @@ To configure your EmberCLI-Rails applications for Heroku:
270
270
  1. Execute `rails generate ember:heroku`.
271
271
  1. Commit the newly generated files.
272
272
  1. [Add the NodeJS buildpack][buildpack] and configure NPM to include the
273
- `bower` dependency's executable file.
273
+ `bower` dependency's executable file (if your build process requires
274
+ `bower`).
274
275
 
275
276
  ```sh
276
277
  $ heroku buildpacks:clear
@@ -328,11 +329,16 @@ contains the directory or directories that contain the `bower` and `npm`
328
329
  executables.
329
330
 
330
331
  #### For faster deployments
331
- Place the following in your deploy/<environment>.rb
332
+
333
+ Place the following in your `deploy/<environment>.rb`
334
+
332
335
  ```ruby
333
336
  set :linked_dirs, %w{<ember-app-name>/node_modules <ember-app-name>/bower_components}
334
337
  ```
335
- to avoid rebuilding all the node modules and bower components with every deploy. Replace `<ember-app-name>` with the name of your ember app (default is `frontend`).
338
+
339
+ to avoid rebuilding all the node modules and bower components with every deploy.
340
+ Replace `<ember-app-name>` with the name of your ember app (default is
341
+ `frontend`).
336
342
 
337
343
  ## Override
338
344
 
@@ -35,6 +35,10 @@ module EmberCli
35
35
  @gemfile ||= root.join("Gemfile")
36
36
  end
37
37
 
38
+ def bower_json
39
+ ember_cli_root.join("bower.json")
40
+ end
41
+
38
42
  def ember
39
43
  @ember ||= begin
40
44
  root.join("node_modules", "ember-cli", "bin", "ember").tap do |path|
@@ -46,6 +50,7 @@ module EmberCli
46
50
 
47
51
  $ cd #{root}
48
52
  $ #{package_manager} install
53
+
49
54
  MSG
50
55
  end
51
56
  end
@@ -62,16 +67,15 @@ module EmberCli
62
67
 
63
68
  def bower
64
69
  @bower ||= begin
65
- bower_path = app_options.fetch(:bower_path) { which("bower") }
66
-
67
- bower_path.tap do |path|
68
- unless Pathname(path.to_s).executable?
70
+ path_for_executable("bower").tap do |bower_path|
71
+ if bower_json.exist? && (bower_path.blank? || !bower_path.executable?)
69
72
  fail DependencyError.new <<-MSG.strip_heredoc
70
- Bower is required by EmberCLI
73
+ Bower is required by EmberCLI
74
+
75
+ Install it with:
71
76
 
72
- Install it with:
77
+ $ npm install -g bower
73
78
 
74
- $ npm install -g bower
75
79
  MSG
76
80
  end
77
81
  end
@@ -83,12 +87,12 @@ module EmberCli
83
87
  end
84
88
 
85
89
  def npm
86
- @npm ||= app_options.fetch(:npm_path) { which("npm") }
90
+ @npm ||= path_for_executable("npm")
87
91
  end
88
92
 
89
93
  def yarn
90
94
  if yarn?
91
- @yarn ||= app_options.fetch(:yarn_path) { which("yarn") }
95
+ @yarn ||= path_for_executable("yarn")
92
96
  end
93
97
  end
94
98
 
@@ -97,17 +101,25 @@ module EmberCli
97
101
  end
98
102
 
99
103
  def tee
100
- @tee ||= app_options.fetch(:tee_path) { which("tee") }
104
+ @tee ||= path_for_executable("tee")
101
105
  end
102
106
 
103
107
  def bundler
104
- @bundler ||= app_options.fetch(:bundler_path) { which("bundler") }
108
+ @bundler ||= path_for_executable("bundler")
105
109
  end
106
110
 
107
111
  private
108
112
 
109
113
  attr_reader :app, :ember_cli_root, :environment, :rails_root
110
114
 
115
+ def path_for_executable(command)
116
+ path = app_options.fetch("#{command}_path") { which(command) }
117
+
118
+ if path.present?
119
+ Pathname.new(path)
120
+ end
121
+ end
122
+
111
123
  def package_manager
112
124
  if yarn?
113
125
  "yarn"
@@ -125,7 +137,7 @@ module EmberCli
125
137
  end
126
138
 
127
139
  def app_options
128
- app.options
140
+ app.options.with_indifferent_access
129
141
  end
130
142
 
131
143
  def which(executable)
@@ -41,13 +41,15 @@ module EmberCli
41
41
  clean_ember_dependencies!
42
42
  end
43
43
 
44
- if paths.yarn
44
+ if paths.yarn.present? && Pathname.new(paths.yarn).executable?
45
45
  run! "#{paths.yarn} install"
46
46
  else
47
47
  run! "#{paths.npm} prune && #{paths.npm} install"
48
48
  end
49
49
 
50
- run! "#{paths.bower} prune && #{paths.bower} install"
50
+ if paths.bower_json.exist?
51
+ run! "#{paths.bower} prune && #{paths.bower} install"
52
+ end
51
53
  end
52
54
 
53
55
  def test
@@ -1,3 +1,3 @@
1
1
  module EmberCli
2
- VERSION = "0.8.5".freeze
2
+ VERSION = "0.8.6".freeze
3
3
  end
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.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-05-12 00:00:00.000000000 Z
13
+ date: 2017-06-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ember-cli-rails-assets