relaton-index 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/README.adoc +9 -2
- data/lib/relaton/index/file_io.rb +1 -1
- data/lib/relaton/index/file_storage.rb +2 -0
- data/lib/relaton/index/type.rb +1 -1
- data/lib/relaton/index/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba264ee91f3458c72c08556365a2cf318a42ba7d28f54b33f94ebcaa5819a5cb
|
4
|
+
data.tar.gz: 1036ca48d53463eb1b13349f4865a8022a06651fc233851d316c70fb496040ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d13c60883ccbf875b28cf17968ccdb766f957f4a27f578b8af80369b97847f9c4cdd4cb87314f9b3795c2107e02317b808f9808d80e31b6ddb2da77cb2b01085
|
7
|
+
data.tar.gz: 9363b56f7968471b7853a8ca25169c0425ad911f4c99e657b2ff5776314baac3ba8b9ad507d98cacbb07c21c11cad0a29c29f096ca5b7cc6dcd8b0408f1c01f8
|
data/Gemfile
CHANGED
@@ -9,8 +9,8 @@ gem "rake", "~> 13.0"
|
|
9
9
|
|
10
10
|
gem "rspec", "~> 3.0"
|
11
11
|
|
12
|
-
gem "rubocop", "~> 1.
|
13
|
-
gem "rubocop-performance", "~> 1.
|
14
|
-
gem "rubocop-rails", "~> 2.
|
12
|
+
gem "rubocop", "~> 1.48"
|
13
|
+
gem "rubocop-performance", "~> 1.16"
|
14
|
+
gem "rubocop-rails", "~> 2.18"
|
15
15
|
|
16
16
|
gem "simplecov", "~> 0.22"
|
data/README.adoc
CHANGED
@@ -57,8 +57,15 @@ index = Relaton::Index.find_or_create :IHO, url: "https://raw.githubusercontent.
|
|
57
57
|
|
58
58
|
|
59
59
|
# Search for a document by reference
|
60
|
-
index.search "B-4
|
61
|
-
# => ["data/b-4_2_19_0.xml"]
|
60
|
+
index.search "B-4"
|
61
|
+
# => [{ id: "B-4 2.19.0", file: "data/b-4_2_19_0.xml" }]
|
62
|
+
|
63
|
+
# Search for a document by reference using a block
|
64
|
+
index.search do |row|
|
65
|
+
# do something with the index row
|
66
|
+
row[:id] == "B-4"
|
67
|
+
end
|
68
|
+
# => [{ id: "B-4 2.19.0", file: "data/b-4_2_19_0.xml" }]
|
62
69
|
|
63
70
|
# Remove the index from the pool.
|
64
71
|
Relaton::Index.close :IHO
|
@@ -66,7 +66,7 @@ module Relaton
|
|
66
66
|
resp = URI(@url).open
|
67
67
|
zip = Zip::InputStream.new resp
|
68
68
|
entry = zip.get_next_entry
|
69
|
-
index = YAML.safe_load(entry.get_input_stream.read, [Symbol])
|
69
|
+
index = YAML.safe_load(entry.get_input_stream.read, permitted_classes: [Symbol])
|
70
70
|
save index
|
71
71
|
index
|
72
72
|
end
|
data/lib/relaton/index/type.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|