ext_bundler 2.0.3 → 2.0.4

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: d28d4092493b76e2365c53a0de617d5568bfb464
4
- data.tar.gz: ce167a1e788c54add7f540633237815202e0de57
3
+ metadata.gz: e68d432372e10b0aba398b32c1e0bd2f1f8c6c26
4
+ data.tar.gz: f57467044d096114632e1683cdb7678aef24e13c
5
5
  SHA512:
6
- metadata.gz: a94820f9813e8c8c7edafd1e99ad50c8542f95ea49d71227457979a4fedbcc6dd0068d94da23a58ce5200186a5c997081dda49faaa835624484a9ed838a520a4
7
- data.tar.gz: 2fb51277bd3eecee2e39cf1d3f973a4c86ec3c19dc200f9d568f491ba3365ff74601411c58968b668cefd40dc052e3b687e58bbd56e1b6e08d6ae874e22f5b38
6
+ metadata.gz: 5210b9e0aff4c5da09d3052f0f213d88ac5f3d3aa9e0540bd4deb6e97079912155ed8ddcc1ddc0e150e29f5390bbe70fa186f7b363e9460550b9a551a56be5cb
7
+ data.tar.gz: bce870548e1402ac548a54f24e930e4d640e723bc88ee0252b03601c6352bd3290c6f07e319cd8ec8e65acc9ac4abe092cb80127c432f2976cdf418f3ce87c34
@@ -1,3 +1,3 @@
1
1
  module ExtBundler
2
- VERSION = '2.0.3'
2
+ VERSION = '2.0.4'
3
3
  end
data/lib/ext_bundler.rb CHANGED
@@ -3,12 +3,20 @@ module ExtBundler
3
3
  if names.is_a? Hash
4
4
  @@gem_dev = names
5
5
  self.class.send :define_singleton_method, :gem_dev do
6
- @@gem_dev.find_all(&:last).map(&:first).each{ |gem| require gem }
6
+ env = defined?(Rails.env) ? Rails.env.to_sym : false
7
+ @@gem_dev.find_all do |_gem, options|
8
+ groups = options[:groups]
9
+ options[:require] && (groups.empty? || groups.include?(env))
10
+ end.map(&:first).each{ |gem| require gem }
7
11
  end
8
12
  else
13
+ # TODO allow multiple paths
9
14
  @gem_dev_path ||= File.readlines('.gem-dev').first.strip if File.exist?('.gem-dev')
10
15
  @@gem_dev[names.to_sym] ? gem(names, path: "#{@gem_dev_path}/#{names}", require: false) : gem(names, *args)
11
- @@gem_dev[names.to_sym] = (args.last.is_a?(Hash) ? args.last : {})[:require].nil?
16
+ @@gem_dev[names.to_sym] = {
17
+ require: (args.last.is_a?(Hash) ? args.last : {})[:require].nil?,
18
+ groups: @groups.dup,
19
+ }
12
20
  end
13
21
  end
14
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ext_bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler