eac_ruby_gems_utils 0.2.0 → 0.3.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: 72c347cbc4400da953c018b8081969f1efca483256fad6b60c141384f7fd9b72
4
- data.tar.gz: 63da18372d768e40062eedf2e6ff4474c2569485b400a08bb3808ec1ed73351c
3
+ metadata.gz: fa382fd75e266237e5358229ee3abbf7b1e31e3f953fb9e59b845cecb06fe937
4
+ data.tar.gz: b58fcd6430e03ea9d3b219da5e44aa91ddbf19934982742ad92628028d7efa91
5
5
  SHA512:
6
- metadata.gz: ea7aa11db54e66ef34d3f80b14fd410fec3e236418010d123effba634d98fad1cfb50468ee6f9ecba242850aff4bb40d057f75be8d15d65ba60b1adc45e43c0f
7
- data.tar.gz: 7e39826d5b2a3a7f6f496e41b7f2b6212536a0e0282c526e6c8d5be602c66385da24473b8473629782920663a619fb4fb9e2be4a1945bde5f2e1c24fd15e56ba
6
+ metadata.gz: e45adccca691763dd270580a783839a9b5405eb401183e5ed4dd37609e14782b034d70595c46ee48dfd03b31d57166b7fe602c25c021055dc5a046db93ad5041
7
+ data.tar.gz: cdd227d5aa78010e0dc95f7ec2560af92ff0c0a0a84e5edc2a34ecba87033874356de8a7e56ed1c4b1c99e69b8af23a57468a1c89957f687d19ccbea98b09707
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'eac_ruby_utils/core_ext'
2
4
 
3
5
  module EacRubyGemsUtils
@@ -19,7 +19,6 @@ module EacRubyGemsUtils
19
19
  def bundle(*args)
20
20
  ::EacRubyUtils::Envs.local.command('bundle', *args)
21
21
  .envvar('BUNDLE_GEMFILE', gemfile_path)
22
- .chdir(root)
23
22
  end
24
23
 
25
24
  def gemfile_lock_gem_version(gem_name)
@@ -30,6 +29,12 @@ module EacRubyGemsUtils
30
29
  ::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path))
31
30
  end
32
31
 
32
+ def rake(*args)
33
+ raise "File \"#{rakefile_path}\" does not exist" unless rakefile_path.exist?
34
+
35
+ bundle('exec', 'rake', '--rakefile', rakefile_path, *args)
36
+ end
37
+
33
38
  private
34
39
 
35
40
  def gemfile_path_uncached
@@ -39,5 +44,9 @@ module EacRubyGemsUtils
39
44
  def gemfile_lock_path_uncached
40
45
  root.join('Gemfile.lock')
41
46
  end
47
+
48
+ def rakefile_path_uncached
49
+ root.join('Rakefile')
50
+ end
42
51
  end
43
52
  end
@@ -43,12 +43,13 @@ module EacRubyGemsUtils
43
43
 
44
44
  def result_uncached
45
45
  return RESULT_NONEXISTENT unless elegible?
46
- bundle_run ? RESULT_SUCCESSFUL : RESULT_FAILED
46
+
47
+ exec_run ? RESULT_SUCCESSFUL : RESULT_FAILED
47
48
  end
48
49
 
49
- def bundle_run
50
+ def exec_run
50
51
  r = ::EacRubyUtils.on_clean_ruby_environment do
51
- gem.bundle('exec', *bundle_exec_args).execute
52
+ gem.send(exec_method, *exec_args).execute
52
53
  end
53
54
  stdout_cache.write(r[:stdout])
54
55
  stderr_cache.write(r[:stderr])
@@ -5,14 +5,22 @@ require 'eac_ruby_gems_utils/tests/base'
5
5
  module EacRubyGemsUtils
6
6
  module Tests
7
7
  class Minitest < ::EacRubyGemsUtils::Tests::Base
8
- def bundle_exec_args
9
- %w[rake test]
8
+ def exec_args
9
+ %w[test]
10
+ end
11
+
12
+ def exec_method
13
+ :rake
10
14
  end
11
15
 
12
16
  def dependency_gem
13
17
  'minitest'
14
18
  end
15
19
 
20
+ def elegible?
21
+ super && gem.rakefile_path.exist?
22
+ end
23
+
16
24
  def test_directory
17
25
  'test'
18
26
  end
@@ -5,8 +5,12 @@ require 'eac_ruby_gems_utils/tests/base'
5
5
  module EacRubyGemsUtils
6
6
  module Tests
7
7
  class Rspec < ::EacRubyGemsUtils::Tests::Base
8
- def bundle_exec_args
9
- %w[rspec]
8
+ def exec_args
9
+ %w[exec rspec]
10
+ end
11
+
12
+ def exec_method
13
+ :bundle
10
14
  end
11
15
 
12
16
  def dependency_gem
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EacRubyGemsUtils
2
- VERSION = '0.2.0'.freeze
4
+ VERSION = '0.3.0'
3
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.2.0
4
+ version: 0.3.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-02-28 00:00:00.000000000 Z
11
+ date: 2020-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.20'
27
+ - !ruby/object:Gem::Dependency
28
+ name: eac_ruby_gem_support
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
27
41
  description:
28
42
  email:
29
43
  executables: []