relaton-nist 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/Gemfile.lock +11 -11
- data/lib/relaton_nist/hit.rb +15 -5
- data/lib/relaton_nist/hit_collection.rb +8 -1
- data/lib/relaton_nist/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ab3d1123704cbe701f2f8158ee2d60be05a762141a8c10f2d9f196f8b905dab
|
4
|
+
data.tar.gz: f06320c0918cf4d5b6354015e370b2cc7bab93247bfd842875086005de9ca247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1bb823322716ac5115428bedbcad2cee3667bc24b8f7fc02030856f5028b92377196eaa8b4c1c6afe6cd67357af4a9d34d4fe7d09b8313e3310f6cc02394b8
|
7
|
+
data.tar.gz: 4fddf90e843ed03dc7d2dc281674a5ecf0ce69d58509682a36f39044dcfb7a769378153f194872f2199c1c8b702a6ca3c88be6f618d22a28283814ead733c37c
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-nist (0.2.
|
4
|
+
relaton-nist (0.2.1)
|
5
5
|
relaton-bib (~> 0.2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -15,9 +15,9 @@ GEM
|
|
15
15
|
safe_yaml (~> 1.0.0)
|
16
16
|
debase (0.2.2)
|
17
17
|
debase-ruby_core_source (>= 0.10.2)
|
18
|
-
debase-ruby_core_source (0.10.
|
18
|
+
debase-ruby_core_source (0.10.5)
|
19
19
|
diff-lcs (1.3)
|
20
|
-
docile (1.3.
|
20
|
+
docile (1.3.2)
|
21
21
|
equivalent-xml (0.6.0)
|
22
22
|
nokogiri (>= 1.4.3)
|
23
23
|
hashdiff (0.4.0)
|
@@ -34,23 +34,23 @@ GEM
|
|
34
34
|
pry (~> 0.10)
|
35
35
|
public_suffix (3.1.0)
|
36
36
|
rake (10.5.0)
|
37
|
-
relaton-bib (0.2.
|
37
|
+
relaton-bib (0.2.1)
|
38
38
|
addressable
|
39
39
|
nokogiri (~> 1.8.4)
|
40
40
|
rspec (3.8.0)
|
41
41
|
rspec-core (~> 3.8.0)
|
42
42
|
rspec-expectations (~> 3.8.0)
|
43
43
|
rspec-mocks (~> 3.8.0)
|
44
|
-
rspec-core (3.8.
|
44
|
+
rspec-core (3.8.1)
|
45
45
|
rspec-support (~> 3.8.0)
|
46
|
-
rspec-expectations (3.8.
|
46
|
+
rspec-expectations (3.8.4)
|
47
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
48
|
rspec-support (~> 3.8.0)
|
49
|
-
rspec-mocks (3.8.
|
49
|
+
rspec-mocks (3.8.1)
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
51
|
rspec-support (~> 3.8.0)
|
52
|
-
rspec-support (3.8.
|
53
|
-
ruby-debug-ide (0.
|
52
|
+
rspec-support (3.8.2)
|
53
|
+
ruby-debug-ide (0.7.0)
|
54
54
|
rake (>= 0.8.1)
|
55
55
|
safe_yaml (1.0.5)
|
56
56
|
simplecov (0.16.1)
|
@@ -59,10 +59,10 @@ GEM
|
|
59
59
|
simplecov-html (~> 0.10.0)
|
60
60
|
simplecov-html (0.10.2)
|
61
61
|
vcr (5.0.0)
|
62
|
-
webmock (3.
|
62
|
+
webmock (3.6.0)
|
63
63
|
addressable (>= 2.3.6)
|
64
64
|
crack (>= 0.3.2)
|
65
|
-
hashdiff
|
65
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
66
66
|
|
67
67
|
PLATFORMS
|
68
68
|
ruby
|
data/lib/relaton_nist/hit.rb
CHANGED
@@ -43,11 +43,21 @@ module RelatonNist
|
|
43
43
|
|
44
44
|
# @return [Iteger]
|
45
45
|
def sort_value
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
@sort_value ||= begin
|
47
|
+
sort_phrase = [hit[:serie], hit[:code], hit[:title]].join " "
|
48
|
+
corr = hit_collection.text.split.map do |w|
|
49
|
+
if w =~ /\w+/ &&
|
50
|
+
sort_phrase =~ Regexp.new(Regexp.escape(w), Regexp::IGNORECASE)
|
51
|
+
1
|
52
|
+
else 0
|
53
|
+
end
|
54
|
+
end.sum
|
55
|
+
corr + case hit[:status]
|
56
|
+
when "final" then 3
|
57
|
+
when "withdrawn" then 2
|
58
|
+
when "draft (withdrawn)" then 1
|
59
|
+
else 0
|
60
|
+
end
|
51
61
|
end
|
52
62
|
end
|
53
63
|
end
|
@@ -59,7 +59,14 @@ module RelatonNist
|
|
59
59
|
}, self
|
60
60
|
)
|
61
61
|
end
|
62
|
-
|
62
|
+
hits.sort! do |a, b|
|
63
|
+
if a.sort_value != b.sort_value
|
64
|
+
b.sort_value - a.sort_value
|
65
|
+
else
|
66
|
+
(b.hit[:release_date] - a.hit[:release_date]).to_i
|
67
|
+
end
|
68
|
+
end
|
69
|
+
concat hits
|
63
70
|
# concat(hits.map { |h| Hit.new(h, self) })
|
64
71
|
@fetched = false
|
65
72
|
# @hit_pages = hit_pages
|
data/lib/relaton_nist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-nist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.7.
|
233
|
+
rubygems_version: 2.7.7
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: 'RelatonNist: retrive NIST standards.'
|