indented-list 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b0048ef91a5c25c0f8cfb7f98a434f2315a71a3
4
- data.tar.gz: 7914d6c64b58c1dbe7c167586b6480649facc52c
3
+ metadata.gz: 3a6c633a880f60dbf2db93b9aa5b943506919086
4
+ data.tar.gz: 6fe0028610aa23b5ba94a76d716d1a6565d33d60
5
5
  SHA512:
6
- metadata.gz: a5c541dfd88b371a0e954e4f8f3a7911ab0cc2cd5946e4d55e861d449c01d2e44e73a66b2fb03ed695112d1fa883357364b7a8b3ac8dfd4471a7f274e4dd27d6
7
- data.tar.gz: 929d141bbd25b1aca52a221df9de9e876e144426e0126215af50f3d5e082d86cf09b80284cf196569bf51545af4544c09b7f2f4e877cebb9bdd86b41e3cb5e94
6
+ metadata.gz: a266422142e96041a36d0c7a686a0362ab94f7d9ad424ddcae20e03fdcfebdac64df7673285539f730b0eff4ce4e815667ce9ee01734c4d797c57115c440db62
7
+ data.tar.gz: 9f8987e3c6d49624a0384796f2c250ffa1142cb320cd8997978a6bebe205c048b0e2cf363000cf7ae8c4e2e3c3f1aa5759ba42188b691ea0ff6533a91716c45c
@@ -70,6 +70,11 @@ class IndentedList
70
70
  list.respond_to?( method, *args, &block ) ? list.send( method, *args, &block ) : super
71
71
  end
72
72
 
73
+ alias_method :original_respond_to? , :respond_to?
74
+ def respond_to?( method )
75
+ original_respond_to?( method ) || list.respond_to?( method )
76
+ end
77
+
73
78
  #
74
79
  # Full text search. Takes a regular expression as an argument.
75
80
  # Returns full branch of the root Hash in which match has occured.
File without changes
@@ -4,19 +4,43 @@ require 'indented-list'
4
4
  class IndentedListTest < Minitest::Test
5
5
 
6
6
  def setup
7
- @list = IndentedList.new( 'test/examples/list.txt' )
7
+ @list = IndentedList.new( './examples/list.txt' )
8
8
  end
9
9
 
10
10
  def test_load_list_from_file
11
- assert list = IndentedList.new( 'test/examples/list.txt' )
11
+ assert list = IndentedList.new( './examples/list.txt' )
12
12
  assert list.respond_to?( :list )
13
13
  assert_equal 298, list.list.count
14
14
  end
15
15
 
16
16
  def test_load_list_from_string
17
- assert list = IndentedList.new( DATA.read )
17
+ str = "
18
+ 245 - TITLE STATEMENT (NR)
19
+ Indicators
20
+ First - Title added entry
21
+ 0 - No added entry
22
+ 1 - Added entry
23
+ Second - Nonfiling characters
24
+ 0-9 - Number of nonfiling characters
25
+ Subfield Codes
26
+ $a - Title (NR)
27
+ $b - Remainder of title (NR)
28
+ $c - Statement of responsibility, etc. (NR)
29
+ $d - Designation of section (SE) [OBSOLETE]
30
+ $e - Name of part/section (SE) [OBSOLETE]
31
+ $f - Inclusive dates (NR)
32
+ $g - Bulk dates (NR)
33
+ $h - Medium (NR)
34
+ $k - Form (R)
35
+ $n - Number of part/section of a work (R)
36
+ $p - Name of part/section of a work (R)
37
+ $s - Version (NR)
38
+ $6 - Linkage (NR)
39
+ $8 - Field link and sequence number (R)"
40
+
41
+ assert list = IndentedList.new( str )
18
42
  assert list.respond_to?( :list )
19
- assert_equal 298, list.list.count
43
+ assert_equal 1, list.list.count
20
44
  end
21
45
 
22
46
  def test_method_missing
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indented-list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maike Kittelmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-22 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parses whitespace indented nested lists into a Ruby object of nested
14
14
  Hashes and Arrays.
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  version: '0'
41
41
  requirements: []
42
42
  rubyforge_project:
43
- rubygems_version: 2.6.9
43
+ rubygems_version: 2.4.8
44
44
  signing_key:
45
45
  specification_version: 4
46
46
  summary: Parses whitespace indented nested lists into a Ruby object