bower-rails 0.7.2 → 0.7.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: 73ea0764f11696a1dde32c69b4bfed873bf3c93b
4
- data.tar.gz: 314587a37f67499acd1638c3698997db6fe1d9d0
3
+ metadata.gz: 7e093ead1cb89b8a18574ac632f4eb317f92778d
4
+ data.tar.gz: df6f32947bcf3d5d6b85d9ddd07a63085c336d92
5
5
  SHA512:
6
- metadata.gz: 23ab1f087a70761a17840ca4f98ecf351d5de2d78aba5d57d58dde0f89da53a8853041dc97a757c4a54c6017499c4d2858da48774becb32993092ad1444f321f
7
- data.tar.gz: 690d0aeebc8295c770bed50965679f7a6d055760b5f4ac43d2584575cca81b455cf2d092862d2f9f9a42cfc214a58caac1c90e28a1ae5e54d18750bebf38ff32
6
+ metadata.gz: 88354fff0c91e7a6f62b355d5ef8a5cd8b55a6cd5ab6b3f0b5f783fba045be31140042608f7c1f16c31ade792c432a7d98b429326ebaa72752d75d0c52be7f6a
7
+ data.tar.gz: c1f2d63f353362eac6ff534d1cbc3220ee301177ba49d6c27f944c0330890cc4d35830ef543344491762d0af3e8097c523ed9245f825755cdca696ae6dc89a19
data/README.md CHANGED
@@ -22,7 +22,7 @@ Check out [changelog][] for the latest changes and releases.
22
22
  in Gemfile
23
23
 
24
24
  ``` Ruby
25
- gem "bower-rails", "~> 0.7.2"
25
+ gem "bower-rails", "~> 0.7.3"
26
26
  ```
27
27
 
28
28
  ##JSON configuration
@@ -83,6 +83,9 @@ asset "secret_logic", "1.0.0", git: "git@github.com:initech/secret_logic"
83
83
 
84
84
  # get from a github repo
85
85
  asset "secret_logic", "1.0.0", github: "initech/secret_logic"
86
+
87
+ # get a specific revision from a git endpoint
88
+ asset "secret_logic", github: "initech/secret_logic", ref: '0adff'
86
89
  ```
87
90
 
88
91
  But the default value can be overridden by `assets_path` method:
@@ -122,6 +125,7 @@ Change options in your `config/initializers/bower_rails.rb`:
122
125
  ``` ruby
123
126
  BowerRails.configure do |bower_rails|
124
127
  # By default options are false
128
+ bower_rails.install_before_precompile = true # invokes rake bower:install before precompilation
125
129
  bower_rails.resolve_before_precompile = true # invokes rake bower:resolve before precompilation
126
130
  bower_rails.clean_before_precompile = true # invokes rake bower:clean before precompilation
127
131
  end
@@ -7,6 +7,9 @@ module BowerRails
7
7
  class << self
8
8
  # An array of tasks to enhance `rake assets:precompile`
9
9
  attr_reader :tasks
10
+
11
+ # If set to true then rake bower:install task is invoked before assets precompilation
12
+ attr_accessor :install_before_precompile
10
13
 
11
14
  # If set to true then rake bower:install && rake bower:resolve tasks
12
15
  # are invoked before assets precompilation
@@ -24,6 +27,7 @@ module BowerRails
24
27
  private
25
28
 
26
29
  def collect_tasks
30
+ @tasks << ['bower:install'] if @install_before_precompile
27
31
  @tasks << ['bower:install', 'bower:resolve'] if @resolve_before_precompile
28
32
  @tasks << ['bower:install', 'bower:clean'] if @clean_before_precompile
29
33
  @tasks.flatten!
@@ -35,6 +39,7 @@ module BowerRails
35
39
  @tasks = []
36
40
 
37
41
  # Set default values for options
42
+ @install_before_precompile = false
38
43
  @resolve_before_precompile = false
39
- @clean_before_precompile = false
44
+ @clean_before_precompile = false
40
45
  end
@@ -36,9 +36,10 @@ module BowerRails
36
36
 
37
37
  def asset(name, *args)
38
38
  group = @current_group || default_group
39
-
40
39
  options = Hash === args.last ? args.pop.dup : {}
40
+
41
41
  version = args.last || "latest"
42
+ version = options[:ref] if options[:ref]
42
43
 
43
44
  options[:git] = "git://github.com/#{options[:github]}" if options[:github]
44
45
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module BowerRails
3
- VERSION = "0.7.2"
3
+ VERSION = "0.7.3"
4
4
  end
@@ -1,7 +1,10 @@
1
1
  BowerRails.configure do |bower_rails|
2
+ # Invoke `rake bower:install` automatically before the `rake assets:precompile` task.
3
+ # bower_rails.install_before_precompile = true
4
+
2
5
  # Invoke `rake bower:resolve` automatically before the `rake assets:precompile` task.
3
6
  # bower_rails.resolve_before_precompile = true
4
-
7
+
5
8
  # Invoke `rake bower:clean` automatically before the `rake assets:precompile` task.
6
- # bower_rails.resolve_before_precompile = true
7
- end
9
+ # bower_rails.clean_before_precompile = true
10
+ end
@@ -4,6 +4,8 @@ module BeforeHook
4
4
  def before(*task_names, &new_task)
5
5
  task_names.each do |task_name|
6
6
  old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
7
+ return unless old_task
8
+
7
9
  desc old_task.full_comment
8
10
  task task_name => old_task.prerequisites do
9
11
  new_task.call
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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Harrison
@@ -95,3 +95,4 @@ signing_key:
95
95
  specification_version: 4
96
96
  summary: Bower for Rails
97
97
  test_files: []
98
+ has_rdoc: