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 +4 -4
- data/lib/eac_ruby_gems_utils.rb +2 -0
- data/lib/eac_ruby_gems_utils/gem.rb +10 -1
- data/lib/eac_ruby_gems_utils/tests/base.rb +4 -3
- data/lib/eac_ruby_gems_utils/tests/minitest.rb +10 -2
- data/lib/eac_ruby_gems_utils/tests/rspec.rb +6 -2
- data/lib/eac_ruby_gems_utils/version.rb +3 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa382fd75e266237e5358229ee3abbf7b1e31e3f953fb9e59b845cecb06fe937
|
4
|
+
data.tar.gz: b58fcd6430e03ea9d3b219da5e44aa91ddbf19934982742ad92628028d7efa91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45adccca691763dd270580a783839a9b5405eb401183e5ed4dd37609e14782b034d70595c46ee48dfd03b31d57166b7fe602c25c021055dc5a046db93ad5041
|
7
|
+
data.tar.gz: cdd227d5aa78010e0dc95f7ec2560af92ff0c0a0a84e5edc2a34ecba87033874356de8a7e56ed1c4b1c99e69b8af23a57468a1c89957f687d19ccbea98b09707
|
data/lib/eac_ruby_gems_utils.rb
CHANGED
@@ -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
|
-
|
46
|
+
|
47
|
+
exec_run ? RESULT_SUCCESSFUL : RESULT_FAILED
|
47
48
|
end
|
48
49
|
|
49
|
-
def
|
50
|
+
def exec_run
|
50
51
|
r = ::EacRubyUtils.on_clean_ruby_environment do
|
51
|
-
gem.
|
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
|
9
|
-
%w[
|
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
|
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
|
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
|
+
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-
|
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: []
|