eac_ruby_gem_support 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3eb984301f5fc4b7c3a517073ac14f228972e1b871469e5bc434c92555968f
4
- data.tar.gz: c27b4fdcf994129729f64e53795f81487c04148bcf9becfc157ebbe50ef9ce88
3
+ metadata.gz: 4a68c6c81f0347a649ef8c9e77653d5119b060d0fd288bc60a926ca94d4d38e4
4
+ data.tar.gz: f54ede8dae8455aa64923620841a7cfa4affc93f54f7e1ae36d4246396a0f6ea
5
5
  SHA512:
6
- metadata.gz: e4227f1a1e1f950fd9891f8a5e82e80ee0f3b90040ad827d1c6c53a8b7140ebdbffff47f29b12a612f803363e0572ce8d79831006b0e1bfb23a8ebe99119efe2
7
- data.tar.gz: d400d5dea8d8316d334863b08a0711a018a7a93a835d7899efa847d88542556ee309580810a6f1671974608c6f759386872431950298fe8231d5a9692bb264c2
6
+ metadata.gz: 3d3f9ca90a5683821f98d603cef434614b41b7c1879cd0cd92452657e632667dee069640f72833f74a7b50dba93b5e717c02e971b601aa6e70f703293527b3b2
7
+ data.tar.gz: 3c886d153dc873c94c3d29f2aa40a5ee5084b1a35fb65e37d280f9e61c094de85f00e0ddfbf8920281c89a4e36eaebae4b3f95fabd6028a7b74c29b89660c24a
@@ -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,45 @@
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 SetupInclude
11
+ common_concern do
12
+ include ::EacRubyGemSupport::Rspec::Specs::Rubocop
13
+ end
14
+
15
+ class << self
16
+ def setup(setup_obj)
17
+ setup_load_path(setup_obj)
18
+ setup_example_persistence(setup_obj)
19
+ setup_filesystem_helper(setup_obj)
20
+ end
21
+
22
+ private
23
+
24
+ def setup_filesystem_helper(setup_obj)
25
+ setup_obj.rspec_config.include ::EacRubyGemSupport::Rspec::Helpers::Filesystem
26
+ setup_obj.rspec_config.after(:each) { purge_temp_files }
27
+ end
28
+
29
+ def setup_load_path(setup_obj)
30
+ $LOAD_PATH.push setup_obj.app_root_path.join('lib').to_path
31
+ end
32
+
33
+ def setup_example_persistence(setup_obj)
34
+ setup_obj.rspec_config.example_status_persistence_file_path =
35
+ setup_obj.example_persistence_path.to_path
36
+ end
37
+ end
38
+
39
+ # @return [Pathname]
40
+ def example_persistence_path
41
+ ::File.join(::Dir.tmpdir, app_root_path.basename.to_path.variableize).to_pathname
42
+ end
43
+ end
44
+ end
45
+ 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.0'
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.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: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2021-07-25 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.70'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.70'
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_include.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.