eac_ruby_gems_utils 0.7.3 → 0.9.3
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/gem.rb +2 -1
- data/lib/eac_ruby_gems_utils/gem/command.rb +1 -1
- data/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
- data/lib/eac_ruby_gems_utils/tests/multiple.rb +10 -3
- data/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +1 -1
- data/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/spec/code/rubocop_check_spec.rb +1 -5
- data/spec/spec_helper.rb +3 -0
- metadata +32 -15
- data/.gitignore +0 -3
- data/.rubocop.yml +0 -25
- data/LICENCE +0 -16
- data/eac_ruby_gems_utils.gemspec +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f492cd66aa139177bb976a2f1a672bd48adae3c6b4fdf40d47504d62a883a549
|
4
|
+
data.tar.gz: 4cb00f68152439fd94d4ba42b213e3e25285f1c7094b33cc7816b6da66f0e797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f25a22c698e88c8d8c5036fa8ee42f97a77e62acf437cef5ebb1fba37b3e698f2b775c4d106f12399f63c4dd2bc528f05a57181a93dce77371506c5553ea3a2
|
7
|
+
data.tar.gz: 0c732cde3675526a97fa7de1c00503a0754a4ccf2fba7358ac7384c49011381aa84abb360add4f0749db02d6c6c21044cd79b78b57bb12b03b4ddd12abe6768b
|
@@ -11,8 +11,9 @@ module EacRubyGemsUtils
|
|
11
11
|
|
12
12
|
GEMSPEC_EXTNAME = '.gemspec'
|
13
13
|
|
14
|
-
common_constructor :root do
|
14
|
+
common_constructor :root, :host_env, default: [nil] do
|
15
15
|
@root = ::Pathname.new(root).expand_path
|
16
|
+
self.host_env ||= ::EacRubyUtils::Envs.local
|
16
17
|
end
|
17
18
|
|
18
19
|
def to_s
|
@@ -11,7 +11,7 @@ module EacRubyGemsUtils
|
|
11
11
|
|
12
12
|
def initialize(gem, command_args, extra_options = {})
|
13
13
|
@gem = gem
|
14
|
-
super(command_args, extra_options)
|
14
|
+
super(command_args, extra_options.merge(host_env: gem.host_env))
|
15
15
|
end
|
16
16
|
|
17
17
|
# Changes current directory to the gem's directory.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/fs/logs'
|
4
5
|
require 'eac_ruby_utils/fs_cache'
|
5
6
|
require 'eac_ruby_utils/listable'
|
6
7
|
require 'eac_ruby_utils/on_clean_ruby_environment'
|
@@ -27,20 +28,16 @@ module EacRubyGemsUtils
|
|
27
28
|
self.class.name.demodulize.gsub(/Test\z/, '')
|
28
29
|
end
|
29
30
|
|
30
|
-
def stdout_cache
|
31
|
-
root_cache.child('stdout')
|
32
|
-
end
|
33
|
-
|
34
|
-
def stderr_cache
|
35
|
-
root_cache.child('stderr')
|
36
|
-
end
|
37
|
-
|
38
31
|
def to_s
|
39
32
|
"#{gem}[#{name}]"
|
40
33
|
end
|
41
34
|
|
42
35
|
private
|
43
36
|
|
37
|
+
def logs_uncached
|
38
|
+
::EacRubyUtils::Fs::Logs.new.add(:stdout).add(:stderr)
|
39
|
+
end
|
40
|
+
|
44
41
|
def result_uncached
|
45
42
|
return RESULT_NONEXISTENT unless elegible?
|
46
43
|
|
@@ -53,8 +50,8 @@ module EacRubyGemsUtils
|
|
53
50
|
|
54
51
|
def exec_run_with_log
|
55
52
|
r = exec_run
|
56
|
-
|
57
|
-
|
53
|
+
logs[:stdout].write(r[:stdout])
|
54
|
+
logs[:stderr].write(r[:stderr])
|
58
55
|
r[:exit_code].zero?
|
59
56
|
end
|
60
57
|
|
@@ -8,7 +8,7 @@ module EacRubyGemsUtils
|
|
8
8
|
module Tests
|
9
9
|
class Multiple
|
10
10
|
require_sub __FILE__
|
11
|
-
|
11
|
+
enable_speaker
|
12
12
|
enable_simple_cache
|
13
13
|
common_constructor :gems, :options, default: [{}]
|
14
14
|
set_callback :initialize, :after, :run
|
@@ -27,6 +27,12 @@ module EacRubyGemsUtils
|
|
27
27
|
decorated_gems.flat_map(&:tests)
|
28
28
|
end
|
29
29
|
|
30
|
+
def clear_logs
|
31
|
+
all_tests.each do |test|
|
32
|
+
test.logs.remove_all
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
30
36
|
def prepare_all_gems
|
31
37
|
infom 'Preparing all gems...'
|
32
38
|
decorated_gems.each(&:prepare)
|
@@ -47,8 +53,7 @@ module EacRubyGemsUtils
|
|
47
53
|
warn 'Some test did not pass:'
|
48
54
|
failed_tests.each do |test|
|
49
55
|
infov ' * Test', test
|
50
|
-
|
51
|
-
infov ' * STDERR', test.stderr_cache.content_path
|
56
|
+
info test.logs.truncate_all
|
52
57
|
end
|
53
58
|
else
|
54
59
|
success 'All tests passed'
|
@@ -60,6 +65,8 @@ module EacRubyGemsUtils
|
|
60
65
|
prepare_all_gems
|
61
66
|
test_all_gems
|
62
67
|
final_results_banner
|
68
|
+
ensure
|
69
|
+
clear_logs
|
63
70
|
end
|
64
71
|
|
65
72
|
def start_banner
|
data/spec/spec_helper.rb
CHANGED
@@ -97,4 +97,7 @@ RSpec.configure do |config|
|
|
97
97
|
# # test failures related to randomization by passing the same `--seed` value
|
98
98
|
# # as the one that triggered the failure.
|
99
99
|
# Kernel.srand config.seed
|
100
|
+
|
101
|
+
require 'eac_ruby_gem_support/rspec'
|
102
|
+
::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
|
100
103
|
end
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
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.9.3
|
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:
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.2.17
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.2.17
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: eac_ruby_utils
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,14 +50,14 @@ dependencies:
|
|
30
50
|
requirements:
|
31
51
|
- - "~>"
|
32
52
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
53
|
+
version: '0.2'
|
34
54
|
type: :development
|
35
55
|
prerelease: false
|
36
56
|
version_requirements: !ruby/object:Gem::Requirement
|
37
57
|
requirements:
|
38
58
|
- - "~>"
|
39
59
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
60
|
+
version: '0.2'
|
41
61
|
description:
|
42
62
|
email:
|
43
63
|
executables: []
|
@@ -45,13 +65,9 @@ extensions: []
|
|
45
65
|
extra_rdoc_files:
|
46
66
|
- README.rdoc
|
47
67
|
files:
|
48
|
-
- ".gitignore"
|
49
68
|
- ".rspec"
|
50
|
-
- ".rubocop.yml"
|
51
69
|
- Gemfile
|
52
|
-
- LICENCE
|
53
70
|
- README.rdoc
|
54
|
-
- eac_ruby_gems_utils.gemspec
|
55
71
|
- lib/eac_ruby_gems_utils.rb
|
56
72
|
- lib/eac_ruby_gems_utils/gem.rb
|
57
73
|
- lib/eac_ruby_gems_utils/gem/command.rb
|
@@ -97,20 +113,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
113
|
- !ruby/object:Gem::Version
|
98
114
|
version: '0'
|
99
115
|
requirements: []
|
100
|
-
rubygems_version: 3.0.
|
116
|
+
rubygems_version: 3.0.9
|
101
117
|
signing_key:
|
102
118
|
specification_version: 4
|
103
119
|
summary: Utilities for Ruby gems development.
|
104
120
|
test_files:
|
105
|
-
- spec/code/rubocop_check_spec.rb
|
106
|
-
- spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb
|
107
121
|
- spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb
|
122
|
+
- spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb
|
108
123
|
- spec/lib/eac_ruby_gems_utils/gem_spec.rb
|
109
124
|
- spec/spec_helper.rb
|
110
|
-
- spec/
|
111
|
-
- spec/support/mygem/Gemfile.lock
|
125
|
+
- spec/code/rubocop_check_spec.rb
|
112
126
|
- spec/support/mygem/Rakefile
|
113
|
-
- spec/support/mygem/
|
114
|
-
- spec/support/mygem/lib/mygem.rb
|
127
|
+
- spec/support/mygem/Gemfile
|
115
128
|
- spec/support/mygem/lib/mygem/version.rb
|
129
|
+
- spec/support/mygem/lib/mygem.rb
|
130
|
+
- spec/support/mygem/exe/myrunner
|
116
131
|
- spec/support/mygem/mygem.gemspec
|
132
|
+
- spec/support/mygem/Gemfile.lock
|
133
|
+
- ".rspec"
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-rails
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 2.4
|
7
|
-
|
8
|
-
Layout/LineLength:
|
9
|
-
Max: 100
|
10
|
-
|
11
|
-
Rails/RakeEnvironment:
|
12
|
-
Exclude:
|
13
|
-
- spec/support/mygem/Rakefile
|
14
|
-
|
15
|
-
Style/Documentation:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
Style/HashEachMethods:
|
19
|
-
Enabled: true
|
20
|
-
|
21
|
-
Style/HashTransformKeys:
|
22
|
-
Enabled: true
|
23
|
-
|
24
|
-
Style/HashTransformValues:
|
25
|
-
Enabled: true
|
data/LICENCE
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Copyright (c) 2020 Eduardo Henrique Bogoni
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
4
|
-
associated documentation files (the "Software"), to deal in the Software without restriction,
|
5
|
-
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
6
|
-
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
7
|
-
furnished to do so, subject to the following conditions:
|
8
|
-
|
9
|
-
The above copyright notice and this permission notice (including the next paragraph) shall be
|
10
|
-
included in all copies or substantial portions of the Software.
|
11
|
-
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
13
|
-
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
14
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
15
|
-
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
16
|
-
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/eac_ruby_gems_utils.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
-
|
5
|
-
# Maintain your gem's version:
|
6
|
-
require 'eac_ruby_gems_utils/version'
|
7
|
-
|
8
|
-
# Describe your gem and declare its dependencies:
|
9
|
-
Gem::Specification.new do |s|
|
10
|
-
s.name = 'eac_ruby_gems_utils'
|
11
|
-
s.version = ::EacRubyGemsUtils::VERSION
|
12
|
-
s.authors = ['Esquilo Azul Company']
|
13
|
-
s.summary = 'Utilities for Ruby gems development.'
|
14
|
-
s.license = 'MIT'
|
15
|
-
s.homepage = 'https://github.com/esquilo-azul/eac_ruby_gems_utils'
|
16
|
-
s.metadata = { 'source_code_uri' => s.homepage }
|
17
|
-
|
18
|
-
s.extra_rdoc_files = ['README.rdoc']
|
19
|
-
s.rdoc_options = ['--charset=UTF-8']
|
20
|
-
|
21
|
-
s.require_paths = ['lib']
|
22
|
-
s.files = `git ls-files`.split("\n")
|
23
|
-
s.test_files = `git ls-files spec examples`.split("\n")
|
24
|
-
|
25
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.29'
|
26
|
-
|
27
|
-
# Tests
|
28
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1'
|
29
|
-
end
|