chordpro 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chordpro/transform.rb +3 -1
- data/lib/chordpro/version.rb +1 -1
- data/spec/chordpro/song_spec.rb +6 -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: 681c355ddb2b38d1df7753e15752d8c6da61de6091bb2f1b9af9511d8301f73f
|
4
|
+
data.tar.gz: fcc40e9214feea9e711016867c932fa16fdb2d62969680e0e575d8aef03ac16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d57f73191fc02c29442f4745b895ddff7465e428dadf250abc24beb037da039249a74bb08bc5181b3bf78a47a37196f023a29da7dc55284ae089d26af883441
|
7
|
+
data.tar.gz: 5466a1ee8e69dcdc394883c7ed54a2d2c022cbf3cd5ca5b154ba78ece8d038ac0319a324628516dd3d703f5db7583e3d15e64db48066773f23dbb92f6a3b75e2
|
data/lib/chordpro/transform.rb
CHANGED
@@ -4,8 +4,10 @@ module Chordpro
|
|
4
4
|
directive_name = Directive.find(name) || Directive::Name.new(name.to_s)
|
5
5
|
Chordpro::Directive.new(directive_name, value.to_s)
|
6
6
|
end
|
7
|
+
|
7
8
|
rule(directive: {name: simple(:name)}) do
|
8
|
-
|
9
|
+
directive_name = Directive.find(name) || Directive::Name.new(name.to_s)
|
10
|
+
Chordpro::Directive.new(directive_name)
|
9
11
|
end
|
10
12
|
|
11
13
|
rule(linebreak: simple(:x)) { Chordpro::Linebreak.new }
|
data/lib/chordpro/version.rb
CHANGED
data/spec/chordpro/song_spec.rb
CHANGED
@@ -19,11 +19,16 @@ module Chordpro
|
|
19
19
|
expect(song.metadata[:artist]).to eq(song.metadata["artist"])
|
20
20
|
end
|
21
21
|
|
22
|
-
it "returns nil for unknown directive" do
|
22
|
+
it "returns nil for unknown directive with value" do
|
23
23
|
song = Chordpro.parse("{foo: bar}")
|
24
24
|
expect(song.metadata["foo"]).to eq(nil)
|
25
25
|
end
|
26
26
|
|
27
|
+
it "returns nil for unknown directive" do
|
28
|
+
song = Chordpro.parse("{foo}")
|
29
|
+
expect(song.metadata["foo"]).to eq(nil)
|
30
|
+
end
|
31
|
+
|
27
32
|
it "returns hash with to_h" do
|
28
33
|
expect(song.metadata.to_h).to eq({
|
29
34
|
"title" => "Africa",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chordpro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|