soml 1.0.2 → 1.0.3

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: 66fd7637299b38b3b88d5b32aac32e92bc592da61d744c1b8a60bdcc5380d7ba
4
- data.tar.gz: cea96fd3ddb8eba10088eba4615ba83d995cd3461e7e6d3eaa1cdaa951e419bc
3
+ metadata.gz: 98d491c622a6864b981552e57beb102c94d6afb41dd26e19e538f02f7dcfbc16
4
+ data.tar.gz: c24c90c9b6993c594e387f77d8d850a57134c499debb7788f5130aae66d237ff
5
5
  SHA512:
6
- metadata.gz: 78177287899c99f196c6ef35b0560a801565f84075e4eaef5e35d0d2da40dd2072e6ff381820e12dd763bd4d9737827a98c273cfeadaec6ced70e2e8144b56d2
7
- data.tar.gz: 29b1827bcfae7c5f43bbddde8bf15004b452bc27d9bbb7c5e29cb0ae4fbfb203690dba48a8e10a9de88db542c8b213c8a4c1211f8f8ef67a8dbebfd544ce7107
6
+ metadata.gz: 227082a4f691374be1684fe0c73ec13c74529f82914b0e8333a3ec442ee672d8b96924b5466c97a6e14315f2c665c36b9c626abdfe7159101f86926c357d72a2
7
+ data.tar.gz: c996cbc0e1b7e8538b2ab2b531827a6447e0e150c3ad407dc4ac966e2aa422916de43ca5e85e55f267e1c689d63798b3ff5acba293faa1bf2fd78bdab98ccc93
data/lib/soml/document.rb CHANGED
@@ -34,6 +34,7 @@ module SOML
34
34
  state.value << line
35
35
  else
36
36
  next if line.strip[0] == '#'
37
+
37
38
  state.key, value = line.strip.split(' ', 2)
38
39
  if value =~ /<<(.*)/
39
40
  in_field = true
data/lib/soml/field.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module SOML
2
2
  class Field
3
- attr_reader :name, :value
3
+ attr_reader :name
4
+ attr_reader :value
4
5
 
5
6
  def initialize(name, value)
6
7
  @name = name
@@ -8,7 +9,7 @@ module SOML
8
9
  end
9
10
 
10
11
  def to_s
11
- if is_multi_line?
12
+ if multi_line?
12
13
  to_multi_line
13
14
  else
14
15
  to_single_line
@@ -17,7 +18,7 @@ module SOML
17
18
 
18
19
  private
19
20
 
20
- def is_multi_line?
21
+ def multi_line?
21
22
  @value.to_s.include?("\n")
22
23
  end
23
24
 
data/lib/soml/util.rb CHANGED
@@ -3,7 +3,8 @@ module SOML
3
3
  def self.dedent(str)
4
4
  indentation_level = str.lines.map { |line| line[/^\s*/].length }.min
5
5
  return str if indentation_level == 0
6
- return str.lines.map { |line| line[indentation_level..-1] }.join
6
+
7
+ return str.lines.map { |line| line[indentation_level..] }.join
7
8
  end
8
9
 
9
10
  def self.indent(str, level: 4)
data/lib/soml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SOML
2
- VERSION = "1.0.2"
2
+ VERSION = '1.0.3'
3
3
  end
data/lib/soml.rb CHANGED
@@ -5,6 +5,6 @@ require_relative 'soml/field'
5
5
 
6
6
  module SOML
7
7
  def self.root_dir
8
- File.expand_path('../..', __FILE__)
8
+ File.expand_path('..', __dir__)
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - crdx
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-20 00:00:00.000000000 Z
11
+ date: 2021-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rspec
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.8'
19
+ version: '12.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.8'
26
+ version: '12.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: '3.8'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.3'
41
- description:
42
- email:
40
+ version: '3.8'
41
+ description:
42
+ email:
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
@@ -52,8 +52,9 @@ files:
52
52
  homepage: https://github.com/crdx/soml
53
53
  licenses:
54
54
  - MIT
55
- metadata: {}
56
- post_install_message:
55
+ metadata:
56
+ rubygems_mfa_required: 'true'
57
+ post_install_message:
57
58
  rdoc_options: []
58
59
  require_paths:
59
60
  - lib
@@ -61,15 +62,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
62
  requirements:
62
63
  - - ">="
63
64
  - !ruby/object:Gem::Version
64
- version: '0'
65
+ version: '3.0'
65
66
  required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  requirements:
67
68
  - - ">="
68
69
  - !ruby/object:Gem::Version
69
70
  version: '0'
70
71
  requirements: []
71
- rubygems_version: 3.0.6
72
- signing_key:
72
+ rubygems_version: 3.2.29
73
+ signing_key:
73
74
  specification_version: 4
74
75
  summary: SOML parser
75
76
  test_files: []