aranha-parsers 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aranha/parsers/rspec.rb +11 -0
- data/lib/aranha/parsers/rspec/setup_include.rb +17 -0
- data/lib/aranha/parsers/{spec → rspec}/source_target_fixtures_example.rb +10 -2
- data/lib/aranha/parsers/source_address.rb +10 -8
- data/lib/aranha/parsers/version.rb +1 -1
- metadata +10 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0ddcc7cbe52bec1df2955534e52d2d781fbe8860d2d831cd00b672e8df18a5f
|
4
|
+
data.tar.gz: d956ecb6d732909ec364eec20eab28b649bf98d05eda853e2517f0af38d242ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4528f766767f4b78c273f53c628ada4a8f8f6639e0d44003fab2c66c3bc1cbd9e164aa62513e2df8ae48a430b57be5c6c2eff21e513edb4059803074b1735218
|
7
|
+
data.tar.gz: 59e5cfd08d23962ed6392126b871facf69fd5169cbdfb8d0ea6cd989d25b2e338c197ba078d4fc95af1e320987feedb5bd2a2da479fe6e703cf8870db4741df5
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Aranha
|
6
|
+
module Parsers
|
7
|
+
module Rspec
|
8
|
+
module SetupInclude
|
9
|
+
class << self
|
10
|
+
def setup(_setup_obj)
|
11
|
+
require 'aranha/parsers/rspec/source_target_fixtures_example'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -20,8 +20,8 @@ RSpec.shared_examples 'source_target_fixtures' do |spec_file| # rubocop:disable
|
|
20
20
|
source_target_fixtures.source_files.each do |source_file|
|
21
21
|
sd = sort_results(source_data(source_file))
|
22
22
|
basename = ::Aranha::Parsers::SourceTargetFixtures.source_target_basename(source_file)
|
23
|
-
target_file = File.expand_path("../#{basename}.target
|
24
|
-
File.write(target_file, sd
|
23
|
+
target_file = File.expand_path("../#{basename}.target#{target_file_extname}", source_file)
|
24
|
+
File.write(target_file, target_content(sd))
|
25
25
|
end
|
26
26
|
end
|
27
27
|
else
|
@@ -67,4 +67,12 @@ RSpec.shared_examples 'source_target_fixtures' do |spec_file| # rubocop:disable
|
|
67
67
|
def target_data(target_file)
|
68
68
|
::YAML.load_file(target_file)
|
69
69
|
end
|
70
|
+
|
71
|
+
def target_content(data)
|
72
|
+
data.to_yaml
|
73
|
+
end
|
74
|
+
|
75
|
+
def target_file_extname
|
76
|
+
'.yaml'
|
77
|
+
end
|
70
78
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/core_ext/module/delegation'
|
4
|
-
require 'eac_ruby_utils/
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
5
|
require 'yaml'
|
6
6
|
|
7
7
|
module Aranha
|
8
8
|
module Parsers
|
9
9
|
class SourceAddress
|
10
|
-
|
10
|
+
require_sub __FILE__
|
11
11
|
|
12
12
|
class << self
|
13
13
|
SUBS = [
|
@@ -35,12 +35,8 @@ module Aranha
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
def initialize(source)
|
41
|
-
@sub = self.class.detect_sub(source)
|
42
|
-
end
|
43
|
-
|
38
|
+
enable_simple_cache
|
39
|
+
common_constructor :source
|
44
40
|
delegate :content, :url, to: :sub
|
45
41
|
|
46
42
|
def to_s
|
@@ -50,6 +46,12 @@ module Aranha
|
|
50
46
|
def serialize
|
51
47
|
sub.serialize.strip + "\n"
|
52
48
|
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def sub_uncached
|
53
|
+
self.class.detect_sub(source)
|
54
|
+
end
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aranha-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.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:
|
11
|
+
date: 2021-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -58,20 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.33.1
|
61
|
+
version: '0.70'
|
65
62
|
type: :runtime
|
66
63
|
prerelease: false
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
68
65
|
requirements:
|
69
66
|
- - "~>"
|
70
67
|
- !ruby/object:Gem::Version
|
71
|
-
version: '0.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.33.1
|
68
|
+
version: '0.70'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
70
|
name: httpclient
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,14 +106,14 @@ dependencies:
|
|
112
106
|
requirements:
|
113
107
|
- - "~>"
|
114
108
|
- !ruby/object:Gem::Version
|
115
|
-
version: '0.
|
109
|
+
version: '0.3'
|
116
110
|
type: :development
|
117
111
|
prerelease: false
|
118
112
|
version_requirements: !ruby/object:Gem::Requirement
|
119
113
|
requirements:
|
120
114
|
- - "~>"
|
121
115
|
- !ruby/object:Gem::Version
|
122
|
-
version: '0.
|
116
|
+
version: '0.3'
|
123
117
|
description:
|
124
118
|
email:
|
125
119
|
executables: []
|
@@ -139,13 +133,15 @@ files:
|
|
139
133
|
- lib/aranha/parsers/invalid_state_exception.rb
|
140
134
|
- lib/aranha/parsers/patches.rb
|
141
135
|
- lib/aranha/parsers/patches/ofx_parser.rb
|
136
|
+
- lib/aranha/parsers/rspec.rb
|
137
|
+
- lib/aranha/parsers/rspec/setup_include.rb
|
138
|
+
- lib/aranha/parsers/rspec/source_target_fixtures_example.rb
|
142
139
|
- lib/aranha/parsers/source_address.rb
|
143
140
|
- lib/aranha/parsers/source_address/file.rb
|
144
141
|
- lib/aranha/parsers/source_address/hash_http_get.rb
|
145
142
|
- lib/aranha/parsers/source_address/hash_http_post.rb
|
146
143
|
- lib/aranha/parsers/source_address/http_get.rb
|
147
144
|
- lib/aranha/parsers/source_target_fixtures.rb
|
148
|
-
- lib/aranha/parsers/spec/source_target_fixtures_example.rb
|
149
145
|
- lib/aranha/parsers/version.rb
|
150
146
|
homepage:
|
151
147
|
licenses: []
|
@@ -165,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
161
|
- !ruby/object:Gem::Version
|
166
162
|
version: '0'
|
167
163
|
requirements: []
|
168
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.1.6
|
169
165
|
signing_key:
|
170
166
|
specification_version: 4
|
171
167
|
summary: Parsers' utilities for Ruby.
|