eac_ruby_gems_utils 0.4.1 → 0.5.0

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
  SHA256:
3
- metadata.gz: 0fea6448e900008bc2f0ed5055b36f40690945dd730fe3719f54641703f9347b
4
- data.tar.gz: 5f96fbb4c19ad7be2619accaac5045a4ac7f882b4713442cbd95267d02b8d222
3
+ metadata.gz: 03ed15ab71663ad44165776c7ad4b0993af1a11b1886cb02118a46d31339f503
4
+ data.tar.gz: fe497eb1240ae1190394dab833df4814965fe852ce3df4c451edf570c9a7a912
5
5
  SHA512:
6
- metadata.gz: 8d73a5810d33db4c819ece473a58bcb6a1b254d5464bbd96c72f562905cb1c137a6cc8bd784bc2eeb2dc265c8ec6d294e2cfb489262651e4b5d540907288e885
7
- data.tar.gz: fb0cc049c124d4c4a44e62bf0bc80e51af5a9e2c28bfed7b59dbbde7414039d7eeeacffdd106dc488ee738fbb04b20b99947e0878a2106fc84a81c55f6d50849
6
+ metadata.gz: a7382fe287f7caeebeb731f0f33085aedaaa97185352088bb68e32fe7ac0443df1810e60562e9be16ebdcb9cfa982e2747654cf6a3ca191862784645dc0699de
7
+ data.tar.gz: e3fa0d3c3533ef63aaa396d54b40e958c69e6a472c903811d7c7e89c33f565e787cfb75bca150542a268497c31739252f74eed53dd7295d2d519f0adbd474b0b
@@ -8,13 +8,14 @@ module EacRubyGemsUtils
8
8
  require_sub __FILE__
9
9
  enable_simple_cache
10
10
 
11
- common_constructor :root
12
- set_callback :initialize, :after do
11
+ GEMSPEC_EXTNAME = '.gemspec'
12
+
13
+ common_constructor :root do
13
14
  @root = ::Pathname.new(root).expand_path
14
15
  end
15
16
 
16
17
  def to_s
17
- root.basename.to_s
18
+ name
18
19
  end
19
20
 
20
21
  def bundle(*args)
@@ -29,6 +30,18 @@ module EacRubyGemsUtils
29
30
  ::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path))
30
31
  end
31
32
 
33
+ def name
34
+ name_by_gemspec || name_by_path
35
+ end
36
+
37
+ def name_by_gemspec
38
+ gemspec_path.if_present { |v| v.basename(GEMSPEC_EXTNAME).to_path }
39
+ end
40
+
41
+ def name_by_path
42
+ root.basename.to_s
43
+ end
44
+
32
45
  def rake(*args)
33
46
  raise "File \"#{rakefile_path}\" does not exist" unless rakefile_path.exist?
34
47
 
@@ -45,6 +58,10 @@ module EacRubyGemsUtils
45
58
  root.join('Gemfile.lock')
46
59
  end
47
60
 
61
+ def gemspec_path_uncached
62
+ ::Pathname.glob("#{root.to_path}/*#{GEMSPEC_EXTNAME}").first
63
+ end
64
+
48
65
  def rakefile_path_uncached
49
66
  root.join('Rakefile')
50
67
  end
@@ -9,13 +9,17 @@ module EacRubyGemsUtils
9
9
  class Multiple
10
10
  enable_console_speaker
11
11
  enable_simple_cache
12
- common_constructor :gems
12
+ common_constructor :gems, :options, default: [{}]
13
13
  set_callback :initialize, :after, :run
14
14
 
15
15
  def ok?
16
16
  failed_tests.none?
17
17
  end
18
18
 
19
+ def only
20
+ options[:only]
21
+ end
22
+
19
23
  private
20
24
 
21
25
  def all_tests_uncached
@@ -33,7 +37,9 @@ module EacRubyGemsUtils
33
37
  end
34
38
 
35
39
  def decorated_gems_uncached
36
- gems.map { |gem| DecoratedGem.new(gem) }
40
+ r = gems
41
+ r = r.select { |gem| only.include?(gem.name) } if only.present?
42
+ r.map { |gem| DecoratedGem.new(gem) }
37
43
  end
38
44
 
39
45
  def failed_tests_uncached
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemsUtils
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_gems_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2020-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils