song_pro 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/song_pro/line.rb +10 -8
- data/lib/song_pro/part.rb +5 -3
- data/lib/song_pro/section.rb +7 -5
- data/lib/song_pro/song.rb +67 -65
- data/lib/song_pro/version.rb +1 -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: 7d13f7f76dd430f25293eab52b8ebb42c1a6ed45eb5a5dedbd117cb4b0206b80
|
4
|
+
data.tar.gz: b13503808204e547d71b958d8ac7691bb040a3b1f3f7c8029e3dc9638753ca58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 234fdde6636efb454f57b9bd12c9a25a087aad982ca732e04114c2dbf9166b118bc39a69d2371064ffe88064bf0760157ee632f84aa8f2ff490f4d4f90e2baa7
|
7
|
+
data.tar.gz: 31d1cafad5793a282bf37705794239d03a1eb8e4a0f7a273db153cef170ed29bf2acd685c6a7c93fcaa0860a8e5c98ee90277a04646066abc351d5e6a4adbe45
|
data/Gemfile.lock
CHANGED
data/lib/song_pro/line.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module SongPro
|
4
|
+
class Line
|
5
|
+
attr_accessor :parts, :tablature
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
def initialize
|
8
|
+
@parts = []
|
9
|
+
@tablature = nil
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
def tablature?
|
13
|
+
return @tablature != nil
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
data/lib/song_pro/part.rb
CHANGED
data/lib/song_pro/section.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module SongPro
|
4
|
+
class Section
|
5
|
+
attr_accessor :name, :lines
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def initialize(name: '')
|
8
|
+
@name = name
|
9
|
+
@lines = []
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
data/lib/song_pro/song.rb
CHANGED
@@ -2,75 +2,77 @@
|
|
2
2
|
|
3
3
|
require 'markaby'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
module SongPro
|
6
|
+
class Song
|
7
|
+
attr_accessor :title,
|
8
|
+
:artist,
|
9
|
+
:capo,
|
10
|
+
:key,
|
11
|
+
:tempo,
|
12
|
+
:year,
|
13
|
+
:album,
|
14
|
+
:tuning,
|
15
|
+
:sections,
|
16
|
+
:custom
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
def initialize
|
19
|
+
@sections = []
|
20
|
+
@custom = {}
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
def set_custom(key, value)
|
24
|
+
@custom[key.to_sym] = value
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
def to_html
|
28
|
+
mab = Markaby::Builder.new(song: self)
|
29
|
+
mab.div.song do
|
30
|
+
h1.title song.title if song.title
|
31
|
+
h2.artist song.artist if song.artist
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
33
|
+
dl.information do
|
34
|
+
if song.tuning
|
35
|
+
dt.tuning 'Tuning'
|
36
|
+
dd.tuning song.tuning
|
37
|
+
end
|
38
|
+
if song.capo
|
39
|
+
dt.capo 'Capo'
|
40
|
+
dd.capo song.capo
|
41
|
+
end
|
42
|
+
if song.key
|
43
|
+
dt.key 'Key'
|
44
|
+
dd.key song.key
|
45
|
+
end
|
46
|
+
if song.tempo
|
47
|
+
dt.tempo 'Tempo'
|
48
|
+
dd.tempo song.tempo
|
49
|
+
end
|
50
|
+
if song.year
|
51
|
+
dt.year 'Year'
|
52
|
+
dd.year song.year
|
53
|
+
end
|
54
|
+
if song.album
|
55
|
+
dt.album 'Album'
|
56
|
+
dd.album song.album
|
57
|
+
end
|
56
58
|
end
|
57
|
-
end
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
60
|
+
song.sections.each do |section|
|
61
|
+
div.section do
|
62
|
+
div.name section.name
|
63
|
+
div.lines do
|
64
|
+
section.lines.each do |line|
|
65
|
+
if line.tablature?
|
66
|
+
div.tablature do
|
67
|
+
line.tablature
|
68
|
+
end
|
69
|
+
else
|
70
|
+
div.line do
|
71
|
+
line.parts.each do |part|
|
72
|
+
div.part do
|
73
|
+
div.chord part.chord
|
74
|
+
div.lyric part.lyric
|
75
|
+
end
|
74
76
|
end
|
75
77
|
end
|
76
78
|
end
|
@@ -79,8 +81,8 @@ class Song
|
|
79
81
|
end
|
80
82
|
end
|
81
83
|
end
|
82
|
-
end
|
83
84
|
|
84
|
-
|
85
|
+
mab.to_s
|
86
|
+
end
|
85
87
|
end
|
86
88
|
end
|
data/lib/song_pro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: song_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Kelly
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: markaby
|