bower-rails 0.8.2 → 0.8.3

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: 4e36c2993bdaea3f036ec27d279dc8d14d39cec3
4
- data.tar.gz: cb00ab94498ddf3558b17ff060c32e7647ecd404
3
+ metadata.gz: 2aaf9a0d471ed511ce2f9d98a433117cb9f70595
4
+ data.tar.gz: d9c3bf796251d8e2aba1bce1fb9afcf49b542245
5
5
  SHA512:
6
- metadata.gz: e2c8048f66291d955440893003ae2f3e6006df3d225295522104ad3daaf681c31589e08b990b047ae0c46d3dbd03a419ccb193e84eadb1bf7a0b2d536de35327
7
- data.tar.gz: 8bfb7ac97c3453fe2dd7b1608e67426ee9ff023fa80f4253094b0bf0a4615fdaaed25a3bae49b1ba7c018fb76a57e3fe1550321aa46a28cf20ddd786a40b2f26
6
+ metadata.gz: 9b37bf6cb706d84d02e5a958383a593c127fd9cea2029f526b42f639ae28a5c431eb7446b7eabfacec15447c78c9047915c23419b44f471bceec8fa9fa16e023
7
+ data.tar.gz: 9bb77af61131dde588d5719ceb8b93450f473eef14890b314dc0c81fc87dcda3f37822dcd2fa64cc1ba1fb3dcdde9aaaff86016686a197922f6e986304c0a4c2
data/README.md CHANGED
@@ -28,7 +28,7 @@ Check out [changelog][] for the latest changes and releases.
28
28
  in Gemfile
29
29
 
30
30
  ``` Ruby
31
- gem "bower-rails", "~> 0.8.2"
31
+ gem "bower-rails", "~> 0.8.3"
32
32
  ```
33
33
 
34
34
  ##JSON configuration
@@ -174,6 +174,9 @@ BowerRails.configure do |bower_rails|
174
174
 
175
175
  # Invokes rake bower:clean before precompilation. Defaults to false
176
176
  bower_rails.clean_before_precompile = true
177
+
178
+ # Invokes rake bower:install:deployment instead rake bower:install. Defaults to false
179
+ bower_rails.use_bower_install_deployment = true
177
180
  end
178
181
  ```
179
182
 
@@ -226,4 +229,4 @@ Remember that you should have [bower installed](#bower-installation) either loca
226
229
 
227
230
  ##Bower Main Files
228
231
 
229
- Each bower component should follow the [bower.json spec](https://github.com/bower/bower.json-spec) which designates a recommended `main` directive that lists the primary files of that component. You may choose to reference these files if you are using the asset pipeline, in which case other extraneous includes of the bower component are not needed. The `rake bower:clean` task removes every file that isn't listed in the `main` directive, if the component specifies a `main` directive. Otherwise, the library will remain as bower installed it.
232
+ Each bower component should follow the [bower.json spec](https://github.com/bower/bower.json-spec) which designates a recommended `main` directive that lists the primary files of that component. You may choose to reference these files if you are using the asset pipeline, in which case other extraneous includes of the bower component are not needed. The `rake bower:clean` task removes every file that isn't listed in the `main` directive, if the component specifies a `main` directive. Otherwise, the library will remain as bower installed it. It supports wildcards in files listed in `main` directive.
@@ -13,15 +13,19 @@ module BowerRails
13
13
 
14
14
  # If set to true then rake bower:install task is invoked before assets precompilation
15
15
  attr_accessor :install_before_precompile
16
-
16
+
17
17
  # If set to true then rake bower:install && rake bower:resolve tasks
18
18
  # are invoked before assets precompilation
19
19
  attr_accessor :resolve_before_precompile
20
20
 
21
- # If set to true then rake bower:install && rake bower:clean && rake bower:resolve tasks
21
+ # If set to true then rake bower:install && rake bower:clean tasks
22
22
  # are invoked before assets precompilation
23
23
  attr_accessor :clean_before_precompile
24
24
 
25
+ # If set to true then rake bower:install:deployment will be invoked
26
+ # instead of rake bower:install before assets precompilation
27
+ attr_accessor :use_bower_install_deployment
28
+
25
29
  def configure &block
26
30
  yield self if block_given?
27
31
  collect_tasks
@@ -30,9 +34,12 @@ module BowerRails
30
34
  private
31
35
 
32
36
  def collect_tasks
33
- @tasks << ['bower:install'] if @install_before_precompile
34
- @tasks << ['bower:install', 'bower:resolve'] if @resolve_before_precompile
35
- @tasks << ['bower:install', 'bower:clean'] if @clean_before_precompile
37
+ install_cmd = 'bower:install'
38
+ install_cmd = 'bower:install:deployment' if @use_bower_install_deployment
39
+
40
+ @tasks << [install_cmd] if @install_before_precompile
41
+ @tasks << [install_cmd, 'bower:clean'] if @clean_before_precompile
42
+ @tasks << [install_cmd, 'bower:resolve'] if @resolve_before_precompile
36
43
  @tasks.flatten!
37
44
  @tasks.uniq!
38
45
  end
@@ -42,7 +49,8 @@ module BowerRails
42
49
  # Set default values for options
43
50
  @root_path = Dir.pwd
44
51
  @tasks = []
45
- @install_before_precompile = false
46
- @resolve_before_precompile = false
47
- @clean_before_precompile = false
48
- end
52
+ @install_before_precompile = false
53
+ @resolve_before_precompile = false
54
+ @clean_before_precompile = false
55
+ @use_bower_install_deployment = false
56
+ end
@@ -166,9 +166,12 @@ module BowerRails
166
166
  # Remove "./" relative path from main file strings
167
167
  main_files.map! { |file| File.join(component_dir, file.gsub(/^\.\//, '')) }
168
168
 
169
+ # Make Regexp to handle wildcards
170
+ main_files.map! { |file| Regexp.new("\\A" + file.gsub(/\*/, '.*') + "\\Z") }
171
+
169
172
  # Delete all files that are not in main
170
173
  Find.find(component_dir).reverse_each do |file_or_dir|
171
- next if main_files.include?(file_or_dir)
174
+ next if main_files.any? { |pattern| file_or_dir =~ pattern }
172
175
  if File.directory?(file_or_dir)
173
176
  Dir.rmdir(file_or_dir) if (Dir.entries(file_or_dir) - %w[ . .. ]).empty?
174
177
  else
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module BowerRails
3
- VERSION = "0.8.2"
3
+ VERSION = "0.8.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bower-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Harrison