marc_bot 0.1.0 → 0.2.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: b554d620d2e9958dbd0911ccff5232df5ef37f15fa6395d71ae3984f42f7a7fe
4
- data.tar.gz: 496241156b3cb4913573fd12bdcd6b12d9d47456303ae03b925d2a9d7f928b01
3
+ metadata.gz: bac02957565b4ae2d2ab30d5971f8f858b93e12c66a7365b08699c2f7b8e2d1b
4
+ data.tar.gz: b3c38edea0618bd98ac160ea085ba88b0f5c3597ecc4e5c2d49b72fd189f34ee
5
5
  SHA512:
6
- metadata.gz: 664d05078912b06e07ce7aac508a295ee87753450df541bcccc51404e2190c221202e01b723c36ac730849c9b9e56b3e540250c077212df8985c42973b956c88
7
- data.tar.gz: 18e9d92aca1226b69ff1065231e2b5a24312e35251b09b6f6b14c5b026d18af65751c1a26603d11e9c29147c73c0a217de93ce52ebdd65f342b91291b407abd7
6
+ metadata.gz: 82786dc19e99f483eac6ddf0337202dec6e2abf8560e485a82bf5e1a928de6cad1a884af7430a27f41dbb07fdabdef457aabb0a744adbc4db82294a059032fd0
7
+ data.tar.gz: 7570e5397d29e76d6ad76122f0ba10ee8a51a04e1d9ff7a16c4d08d3fb3cfdaeca21275812c7f54ccf55f20b19d21cc74ed424608e4a3e0b022afaa74c4ee613
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marc_bot (0.1.0)
4
+ marc_bot (0.2.0)
5
5
  marc (~> 1.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -66,6 +66,11 @@ MarcBot.define do
66
66
  c: "Dave Thomas, Andy Hunt."
67
67
  }
68
68
  end
69
+ f650 do
70
+ {
71
+ z: ["Books", "Programming"]
72
+ }
73
+ end
69
74
  end
70
75
  end
71
76
  ```
@@ -40,8 +40,17 @@ module MarcBot
40
40
  def subfield_array
41
41
  input
42
42
  .reject { |key, _value| SKIP_KEYS.include?(key) }
43
+ .map { |key, value| build_subfield_array(key, value) }
44
+ .flatten
45
+ .each_slice(2)
43
46
  .to_a
44
- .map { |subfield| subfield.map(&:to_s) }
47
+ end
48
+
49
+ def build_subfield_array(key, value)
50
+ key = key.to_s
51
+ return [key, value] unless value.is_a?(Array)
52
+
53
+ value.map { |v| [key, v] }
45
54
  end
46
55
 
47
56
  def tag
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MarcBot
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wead
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marc