eac_ruby_gem_support 0.9.0 → 0.10.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: 87738e690edee80a927f5a3e2cdba1cfdd5979bebcc1b2e8aba274614f5c26da
4
- data.tar.gz: 7aecaebeb4fa14060ea250d5a2fbaa7ae5b69936865c3bb3d7df54bd550f6ed6
3
+ metadata.gz: 604189d5f2c83ce11eb9e52435b54de3883861fcaf742a0023eed4bd171654d5
4
+ data.tar.gz: b5613db689320ecda2285e19236068df36e1c95c4c14e95a012c99c6d54b1330
5
5
  SHA512:
6
- metadata.gz: b8d0bf332ff3c8e0cdf1ceeb5d568c7f44be00d2a48fffd43c7d60be7a3b0a566639d4961edf62434c4d8c506ac2e36eef38656c934b51c3ddab66c2905dc162
7
- data.tar.gz: cc0cb4d2a85554411e80274b5b8d0f83c83ccced39646a8df7e0f6a89fd8fefc794712c804c19b6f0faa397418447e4e93a79c7cbdf0b897b1884c11585cb7ef
6
+ metadata.gz: 2fa46da053d9c5c5b97839c8372cf6097cc73e541d8c4e825cc40969ab81cd45c7a18eedef98510fcdee408a932a56625bb57020c55423aea5d491b6c06a2255
7
+ data.tar.gz: 75dbfb0333063516002e019f9114d04a5bb1e7a89283258fd4010d62584c4477b0b07ebdf50c8f16308495db4982df217c7b40db5b526e9d4af03700641212ac
data/.rubocop.yml CHANGED
@@ -23,6 +23,8 @@ Rails/DynamicFindBy:
23
23
  Enabled: false
24
24
  Rails/Exit:
25
25
  Enabled: false
26
+ Rails/FindEach:
27
+ Enabled: false
26
28
  Rails/Output:
27
29
  Enabled: false
28
30
  Rails/SkipsModelValidations:
@@ -33,6 +33,7 @@ module EacRubyGemSupport
33
33
  end
34
34
 
35
35
  def setup_shared_examples
36
+ require 'eac_ruby_gem_support/rspec/shared_examples/spec_paths'
36
37
  require 'eac_ruby_gem_support/rspec/shared_examples/source_target_fixtures'
37
38
  end
38
39
 
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_gem_support/rspec/shared_examples/spec_paths'
3
4
  require 'eac_ruby_gem_support/rspec/source_target_fixtures_controller'
4
5
  require 'eac_ruby_gem_support/source_target_fixtures'
5
6
  require 'yaml'
6
7
 
7
8
  RSpec.shared_examples 'source_target_fixtures' do |spec_file| # rubocop:disable Metrics/BlockLength
9
+ include_examples 'spec_paths', spec_file
8
10
  fixtures_controller = EacRubyGemSupport::Rspec::SourceTargetFixturesController
9
- .new(self, spec_file)
11
+ .new(spec_paths_controller)
10
12
 
11
13
  let(:fixtures_controller) { fixtures_controller }
12
14
  let(:spec_file) { spec_file }
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_gem_support/rspec/spec_paths_controller'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ RSpec.shared_context 'spec_paths' do |the_spec_file|
7
+ cattr_accessor :spec_paths_controller
8
+ self.spec_paths_controller = EacRubyGemSupport::Rspec::SpecPathsController.new(self,
9
+ the_spec_file)
10
+
11
+ %i[fixtures_directory spec_directory spec_file].each do |m|
12
+ let(m) { self.class.spec_paths_controller.send(m) }
13
+ end
14
+ end
@@ -7,20 +7,14 @@ module EacRubyGemSupport
7
7
  module Rspec
8
8
  class SourceTargetFixturesController
9
9
  enable_simple_cache
10
- common_constructor :example, :spec_file
11
-
12
- def default_fixtures_dir
13
- ::File.join(
14
- ::File.dirname(spec_file),
15
- "#{::File.basename(spec_file, '.*')}_files"
16
- )
17
- end
10
+ common_constructor :spec_paths_controller
11
+ delegate :example, to: :spec_paths_controller
18
12
 
19
13
  def fixtures_dir
20
14
  if example.respond_to?(:fixtures_dir)
21
15
  example.fixtures_dir
22
16
  else
23
- default_fixtures_dir
17
+ spec_paths_controller.fixtures_directory
24
18
  end
25
19
  end
26
20
 
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacRubyGemSupport
6
+ module Rspec
7
+ class SpecPathsController
8
+ # @!attribute [r] spec_file
9
+ # @return [Pathname]
10
+
11
+ # @!method initialize(example, spec_file)
12
+ # @param example [RSpec::Core::ExampleGroup]
13
+ # @param spec_file [Pathname]
14
+ common_constructor :example, :spec_file do
15
+ self.spec_file = spec_file.to_pathname
16
+ end
17
+
18
+ # @return [Pathname]
19
+ def fixtures_directory
20
+ spec_directory.join(spec_file.basename('.*')).basename_sub { |b| "#{b}_files" }
21
+ end
22
+
23
+ # @return [Pathname]
24
+ def spec_directory
25
+ spec_file.parent
26
+ end
27
+ end
28
+ end
29
+ end
@@ -14,11 +14,12 @@ module EacRubyGemSupport
14
14
  end
15
15
  end
16
16
 
17
- attr_reader :fixtures_directory
17
+ # @!attribute [r] fixtures_directory
18
+ # @return [String]
18
19
 
19
- def initialize(fixtures_directory)
20
- @fixtures_directory = fixtures_directory
21
- end
20
+ # @!method initialize(fixtures_directory)
21
+ # @param fixtures_directory [Pathname]
22
+ common_constructor :fixtures_directory
22
23
 
23
24
  def source_target_files
24
25
  sources_targets_basenames.map do |basename|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemSupport
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_gem_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.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: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2024-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.119'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.119.2
19
+ version: '0.120'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.119'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.119.2
26
+ version: '0.120'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rspec
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,54 +44,60 @@ dependencies:
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '1.57'
47
+ version: '1.60'
54
48
  - - ">="
55
49
  - !ruby/object:Gem::Version
56
- version: 1.57.2
50
+ version: 1.60.1
57
51
  type: :runtime
58
52
  prerelease: false
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
54
  requirements:
61
55
  - - "~>"
62
56
  - !ruby/object:Gem::Version
63
- version: '1.57'
57
+ version: '1.60'
64
58
  - - ">="
65
59
  - !ruby/object:Gem::Version
66
- version: 1.57.2
60
+ version: 1.60.1
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: rubocop-rails
69
63
  requirement: !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - "~>"
72
66
  - !ruby/object:Gem::Version
73
- version: '2.22'
67
+ version: '2.23'
74
68
  - - ">="
75
69
  - !ruby/object:Gem::Version
76
- version: 2.22.1
70
+ version: 2.23.1
77
71
  type: :runtime
78
72
  prerelease: false
79
73
  version_requirements: !ruby/object:Gem::Requirement
80
74
  requirements:
81
75
  - - "~>"
82
76
  - !ruby/object:Gem::Version
83
- version: '2.22'
77
+ version: '2.23'
84
78
  - - ">="
85
79
  - !ruby/object:Gem::Version
86
- version: 2.22.1
80
+ version: 2.23.1
87
81
  - !ruby/object:Gem::Dependency
88
82
  name: rubocop-rspec
89
83
  requirement: !ruby/object:Gem::Requirement
90
84
  requirements:
91
85
  - - "~>"
92
86
  - !ruby/object:Gem::Version
93
- version: '2.25'
87
+ version: '2.26'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 2.26.1
94
91
  type: :runtime
95
92
  prerelease: false
96
93
  version_requirements: !ruby/object:Gem::Requirement
97
94
  requirements:
98
95
  - - "~>"
99
96
  - !ruby/object:Gem::Version
100
- version: '2.25'
97
+ version: '2.26'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 2.26.1
101
101
  description:
102
102
  email:
103
103
  executables: []
@@ -111,7 +111,9 @@ files:
111
111
  - lib/eac_ruby_gem_support/rspec/helpers/utils.rb
112
112
  - lib/eac_ruby_gem_support/rspec/setup.rb
113
113
  - lib/eac_ruby_gem_support/rspec/shared_examples/source_target_fixtures.rb
114
+ - lib/eac_ruby_gem_support/rspec/shared_examples/spec_paths.rb
114
115
  - lib/eac_ruby_gem_support/rspec/source_target_fixtures_controller.rb
116
+ - lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb
115
117
  - lib/eac_ruby_gem_support/rspec/specs/rubocop.rb
116
118
  - lib/eac_ruby_gem_support/source_target_fixtures.rb
117
119
  - lib/eac_ruby_gem_support/source_target_fixtures/source_target_file.rb