eac_ruby_gem_support 0.2.0 → 0.3.3

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: de3eb984301f5fc4b7c3a517073ac14f228972e1b871469e5bc434c92555968f
4
- data.tar.gz: c27b4fdcf994129729f64e53795f81487c04148bcf9becfc157ebbe50ef9ce88
3
+ metadata.gz: 841cb9c3f61d1207cff12a90f1a05df6762c1656959890711c7e1590de86e22c
4
+ data.tar.gz: 99bc488cbb4754ad0ba5fc0f535a2b832df38a59d11d524e95b5ed18c68f9899
5
5
  SHA512:
6
- metadata.gz: e4227f1a1e1f950fd9891f8a5e82e80ee0f3b90040ad827d1c6c53a8b7140ebdbffff47f29b12a612f803363e0572ce8d79831006b0e1bfb23a8ebe99119efe2
7
- data.tar.gz: d400d5dea8d8316d334863b08a0711a018a7a93a835d7899efa847d88542556ee309580810a6f1671974608c6f759386872431950298fe8231d5a9692bb264c2
6
+ metadata.gz: d847fbc3ea74aa1574288fd903bdb8f5a57ab8708e62b2de822480797a2094d01e87e4b7592be674d647906f16741a5ea807d87fc3d729d73fb7ad155bc2b285
7
+ data.tar.gz: db410649565cb4b121e902b960e958ebb16fb3fa5020606dfe475327b078c7fdbcac39ea8a8034be80ed84b74d1670a0fffeef68299bcf066f4787fbeb481d15
@@ -1,44 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_gem_support/rspec/helpers/filesystem'
4
- require 'eac_ruby_gem_support/rspec/specs/rubocop'
5
- require 'rspec'
3
+ require 'eac_ruby_utils/core_ext'
6
4
 
7
5
  module EacRubyGemSupport
8
- class Rspec
9
- include ::EacRubyGemSupport::Rspec::Specs::Rubocop
10
-
11
- class << self
12
- def default
13
- @default || raise("Default instance was not set. Use #{self.class.name}.setup")
14
- end
15
-
16
- def setup(app_root_path, config = nil)
17
- @default = if config
18
- new(app_root_path, config)
19
- else
20
- ::RSpec.configure { |new_config| new(app_root_path, new_config) }
21
- end
22
- end
23
- end
24
-
25
- attr_reader :app_root_path, :config
26
-
27
- def initialize(app_root_path, config)
28
- @app_root_path = app_root_path
29
- @config = config
30
- setup
31
- end
32
-
33
- protected
34
-
35
- def setup
36
- setup_filesystem_helper
37
- end
38
-
39
- def setup_filesystem_helper
40
- config.include ::EacRubyGemSupport::Rspec::Helpers::Filesystem
41
- config.after(:each) { purge_temp_files }
42
- end
6
+ module Rspec
7
+ require_sub __FILE__
43
8
  end
44
9
  end
@@ -5,7 +5,7 @@ require 'tmpdir'
5
5
  require 'tempfile'
6
6
 
7
7
  module EacRubyGemSupport
8
- class Rspec
8
+ module Rspec
9
9
  module Helpers
10
10
  module Filesystem
11
11
  def purge_temp_files
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_ruby_gem_support/rspec/helpers/filesystem'
5
+ require 'eac_ruby_gem_support/rspec/specs/rubocop'
6
+ require 'tmpdir'
7
+
8
+ module EacRubyGemSupport
9
+ module Rspec
10
+ module Setup
11
+ extend ::ActiveSupport::Concern
12
+ include ::EacRubyGemSupport::Rspec::Specs::Rubocop
13
+
14
+ def self.extended(setup_obj)
15
+ setup_obj.setup_load_path
16
+ setup_obj.setup_example_persistence
17
+ setup_obj.setup_filesystem_helper
18
+ end
19
+
20
+ def setup_filesystem_helper
21
+ rspec_config.include ::EacRubyGemSupport::Rspec::Helpers::Filesystem
22
+ rspec_config.after(:each) { purge_temp_files }
23
+ end
24
+
25
+ def setup_load_path
26
+ $LOAD_PATH.push app_root_path.join('lib').to_path
27
+ end
28
+
29
+ def setup_example_persistence
30
+ rspec_config.example_status_persistence_file_path = example_persistence_path.to_path
31
+ end
32
+
33
+ # @return [Pathname]
34
+ def example_persistence_path
35
+ ::File.join(::Dir.tmpdir, app_root_path.basename.to_path.variableize).to_pathname
36
+ end
37
+ end
38
+ end
39
+ end
@@ -4,7 +4,7 @@ require 'rspec'
4
4
  require 'rubocop'
5
5
 
6
6
  module EacRubyGemSupport
7
- class Rspec
7
+ module Rspec
8
8
  module Specs
9
9
  module Rubocop
10
10
  def describe_rubocop # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemSupport
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_gem_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2021-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: eac_ruby_utils
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.74'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.74'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,7 @@ files:
75
89
  - lib/eac_ruby_gem_support.rb
76
90
  - lib/eac_ruby_gem_support/rspec.rb
77
91
  - lib/eac_ruby_gem_support/rspec/helpers/filesystem.rb
92
+ - lib/eac_ruby_gem_support/rspec/setup.rb
78
93
  - lib/eac_ruby_gem_support/rspec/specs/rubocop.rb
79
94
  - lib/eac_ruby_gem_support/version.rb
80
95
  homepage: https://github.com/esquilo-azul/eac_ruby_gem_support
@@ -96,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
111
  - !ruby/object:Gem::Version
97
112
  version: '0'
98
113
  requirements: []
99
- rubygems_version: 3.0.9
114
+ rubygems_version: 3.1.6
100
115
  signing_key:
101
116
  specification_version: 4
102
117
  summary: Development support for Ruby' Gem.