eac_ruby_gem_support 0.2.0 → 0.3.0
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 +4 -4
- data/lib/eac_ruby_gem_support/rspec.rb +3 -38
- data/lib/eac_ruby_gem_support/rspec/helpers/filesystem.rb +1 -1
- data/lib/eac_ruby_gem_support/rspec/setup_include.rb +45 -0
- data/lib/eac_ruby_gem_support/rspec/specs/rubocop.rb +1 -1
- data/lib/eac_ruby_gem_support/version.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a68c6c81f0347a649ef8c9e77653d5119b060d0fd288bc60a926ca94d4d38e4
|
4
|
+
data.tar.gz: f54ede8dae8455aa64923620841a7cfa4affc93f54f7e1ae36d4246396a0f6ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d3f9ca90a5683821f98d603cef434614b41b7c1879cd0cd92452657e632667dee069640f72833f74a7b50dba93b5e717c02e971b601aa6e70f703293527b3b2
|
7
|
+
data.tar.gz: 3c886d153dc873c94c3d29f2aa40a5ee5084b1a35fb65e37d280f9e61c094de85f00e0ddfbf8920281c89a4e36eaebae4b3f95fabd6028a7b74c29b89660c24a
|
@@ -1,44 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
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
|
-
|
9
|
-
|
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
|
@@ -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
|
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.
|
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-
|
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.
|
114
|
+
rubygems_version: 3.1.6
|
100
115
|
signing_key:
|
101
116
|
specification_version: 4
|
102
117
|
summary: Development support for Ruby' Gem.
|