soml 1.0.2 → 1.1.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: 66fd7637299b38b3b88d5b32aac32e92bc592da61d744c1b8a60bdcc5380d7ba
4
- data.tar.gz: cea96fd3ddb8eba10088eba4615ba83d995cd3461e7e6d3eaa1cdaa951e419bc
3
+ metadata.gz: f1965a7b3c8c4a9711d41c0a8057ff910b5945fb51acae996fa548ea9028dd20
4
+ data.tar.gz: 683b30223d58d09c587dad56e686d188d85fa5cf816bba043b3433ad5c741a8c
5
5
  SHA512:
6
- metadata.gz: 78177287899c99f196c6ef35b0560a801565f84075e4eaef5e35d0d2da40dd2072e6ff381820e12dd763bd4d9737827a98c273cfeadaec6ced70e2e8144b56d2
7
- data.tar.gz: 29b1827bcfae7c5f43bbddde8bf15004b452bc27d9bbb7c5e29cb0ae4fbfb203690dba48a8e10a9de88db542c8b213c8a4c1211f8f8ef67a8dbebfd544ce7107
6
+ metadata.gz: 198a4c6aaa797c6563f3c0390cf03e0cbe632a6b2d1a3c2bd4ab87700d8a6777e03595cb9fb2c194febbcbd7e7fbf060ccbbc68ffa4113b17d71a640fb1a0b91
7
+ data.tar.gz: d74245532b25450bc2f7515af835ef3fbcbc3b3c7c97af5c0e1d443fd04e45fcb80a3263cf9123569241f19a5dd081db272fbf8331629740a79f019eb05c4fd1
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.1.0'
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.1.0
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: 2024-03-24 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: []
@@ -51,9 +51,10 @@ files:
51
51
  - lib/soml/version.rb
52
52
  homepage: https://github.com/crdx/soml
53
53
  licenses:
54
- - MIT
55
- metadata: {}
56
- post_install_message:
54
+ - GPLv3
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.3.25
73
+ signing_key:
73
74
  specification_version: 4
74
75
  summary: SOML parser
75
76
  test_files: []