eac_ruby_gems_utils 0.8.0 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f53674fe550c42bfff29451c72ce82b786a519967088b7294378b0b74159e283
4
- data.tar.gz: ca4835aac1a8d8e404b3b77fbb0a86c5a7ed239686e41d17ca39e0cb86189f35
3
+ metadata.gz: '09e6804eab2bdc6bf0d98c58e97c46b1c41ba6f5c97a3a4405dd1482ce6fb06d'
4
+ data.tar.gz: c374f0eb6aeb665097bf05782db4c76af1476917d742b4fa153ae17a66fefca5
5
5
  SHA512:
6
- metadata.gz: 855c6e6831bc15ad059764124c1133e43079f54810e1e66343834fc9075fbedc6a79325ff844a53bd4cc08807c4da5e48413be2952ebc7739e29e73f8b1d9931
7
- data.tar.gz: 5f5d51cf0b8dde23ad1aeebee3a67847e66d135bc5e03e0ccfd2d99ef383bc5ae8964bcf33f65ccbc2e9f53511a0043e9de05cc74bfc5ff4ed59fe3653c3b72f
6
+ metadata.gz: 2e91380a15673a27fa4acc3ecf7cc6ad38b9ce4b9556d7c822b8b90c30e694cd7d3df34c90e9178d7deda7c632cb0c8811d37293f84e1f507f6c8604767f7da8
7
+ data.tar.gz: 9a5aa8a82764ec3f2fa0fbe0e07204b88ca946779f8f974e1d4126825ca2990868792aff9ae5506dfd543b2e7c1ee8021ea9c21847d4ac0fa44337b2adf515d3
@@ -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
- stdout_cache.write(r[:stdout])
57
- stderr_cache.write(r[:stderr])
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
- enable_console_speaker
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
- infov ' * STDOUT', test.stdout_cache.content_path
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
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/core_ext'
4
+
3
5
  module EacRubyGemsUtils
4
6
  module Tests
5
7
  class Multiple
6
8
  class DecoratedGem < ::SimpleDelegator
7
- enable_console_speaker
9
+ enable_speaker
8
10
 
9
11
  def prepare
10
12
  return unless gemfile_path.exist?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemsUtils
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.4'
5
5
  end
@@ -1,7 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_gem_support/spec/examples/rubocop_check'
4
-
5
- RSpec.describe ::RuboCop do
6
- include_examples 'rubocop_check', ::File.expand_path('../..', __dir__)
7
- end
3
+ ::EacRubyGemSupport::Rspec.default.describe_rubocop
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,43 +1,63 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_gems_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.4
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-10-14 00:00:00.000000000 Z
11
+ date: 2021-06-08 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
16
36
  requirements:
17
37
  - - "~>"
18
38
  - !ruby/object:Gem::Version
19
- version: '0.29'
39
+ version: '0.67'
20
40
  type: :runtime
21
41
  prerelease: false
22
42
  version_requirements: !ruby/object:Gem::Requirement
23
43
  requirements:
24
44
  - - "~>"
25
45
  - !ruby/object:Gem::Version
26
- version: '0.29'
46
+ version: '0.67'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: eac_ruby_gem_support
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '0.1'
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.1'
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.8
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/support/mygem/Gemfile
111
- - spec/support/mygem/Gemfile.lock
125
+ - spec/code/rubocop_check_spec.rb
112
126
  - spec/support/mygem/Rakefile
113
- - spec/support/mygem/exe/myrunner
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
@@ -1,3 +0,0 @@
1
- /Gemfile.lock
2
- doc/**/*
3
- .yardoc/**/*
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.
@@ -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