song_pro 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 994be76991ee4ae983a808d051d872c455a2264f3bf2b6d921283aca2d35e579
4
- data.tar.gz: 3aece95c07d6bf27ffbef7f71f3e1e1cc1ef086a4e3ee5d0c5a4d2cd7a0c1a4c
3
+ metadata.gz: 7d13f7f76dd430f25293eab52b8ebb42c1a6ed45eb5a5dedbd117cb4b0206b80
4
+ data.tar.gz: b13503808204e547d71b958d8ac7691bb040a3b1f3f7c8029e3dc9638753ca58
5
5
  SHA512:
6
- metadata.gz: 8754d732547c5e5ca22e85e8d9f3160849ead6f4e939c5e91a0ce54ebfa84258ea1bb27f8e26b7b153f0ce18dada2c08830a06f1ae2a9d4d6d51ab8fb6b7d293
7
- data.tar.gz: 233c7229e06286a0e3f6a4766be8a1449bd2b56e38cd786c3ef1ef8a85f0deff09473a0890e160b960727d99b31a08d8769e6a4707fd2a51d3d500d05c1a616f
6
+ metadata.gz: 234fdde6636efb454f57b9bd12c9a25a087aad982ca732e04114c2dbf9166b118bc39a69d2371064ffe88064bf0760157ee632f84aa8f2ff490f4d4f90e2baa7
7
+ data.tar.gz: 31d1cafad5793a282bf37705794239d03a1eb8e4a0f7a273db153cef170ed29bf2acd685c6a7c93fcaa0860a8e5c98ee90277a04646066abc351d5e6a4adbe45
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- song_pro (0.1.2)
4
+ song_pro (0.1.3)
5
5
  markaby
6
6
 
7
7
  GEM
data/lib/song_pro/line.rb CHANGED
@@ -1,14 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Line
4
- attr_accessor :parts, :tablature
3
+ module SongPro
4
+ class Line
5
+ attr_accessor :parts, :tablature
5
6
 
6
- def initialize
7
- @parts = []
8
- @tablature = nil
9
- end
7
+ def initialize
8
+ @parts = []
9
+ @tablature = nil
10
+ end
10
11
 
11
- def tablature?
12
- return @tablature != nil
12
+ def tablature?
13
+ return @tablature != nil
14
+ end
13
15
  end
14
16
  end
data/lib/song_pro/part.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Part
4
- attr_accessor :lyric, :chord
5
- end
3
+ module SongPro
4
+ class Part
5
+ attr_accessor :lyric, :chord
6
+ end
7
+ end
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Section
4
- attr_accessor :name, :lines
3
+ module SongPro
4
+ class Section
5
+ attr_accessor :name, :lines
5
6
 
6
- def initialize(name: '')
7
- @name = name
8
- @lines = []
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
- class Song
6
- attr_accessor :title,
7
- :artist,
8
- :capo,
9
- :key,
10
- :tempo,
11
- :year,
12
- :album,
13
- :tuning,
14
- :sections,
15
- :custom
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
- def initialize
18
- @sections = []
19
- @custom = {}
20
- end
18
+ def initialize
19
+ @sections = []
20
+ @custom = {}
21
+ end
21
22
 
22
- def set_custom(key, value)
23
- @custom[key.to_sym] = value
24
- end
23
+ def set_custom(key, value)
24
+ @custom[key.to_sym] = value
25
+ end
25
26
 
26
- def to_html
27
- mab = Markaby::Builder.new(song: self)
28
- mab.div.song do
29
- h1.title song.title if song.title
30
- h2.artist song.artist if song.artist
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
- dl.information do
33
- if song.tuning
34
- dt.tuning 'Tuning'
35
- dd.tuning song.tuning
36
- end
37
- if song.capo
38
- dt.capo 'Capo'
39
- dd.capo song.capo
40
- end
41
- if song.key
42
- dt.key 'Key'
43
- dd.key song.key
44
- end
45
- if song.tempo
46
- dt.tempo 'Tempo'
47
- dd.tempo song.tempo
48
- end
49
- if song.year
50
- dt.year 'Year'
51
- dd.year song.year
52
- end
53
- if song.album
54
- dt.album 'Album'
55
- dd.album song.album
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
- song.sections.each do |section|
60
- div.section do
61
- div.name section.name
62
- div.lines do
63
- section.lines.each do |line|
64
- if line.tablature?
65
- div.tablature do
66
- line.tablature
67
- end
68
- else
69
- div.line do
70
- line.parts.each do |part|
71
- div.part do
72
- div.chord part.chord
73
- div.lyric part.lyric
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
- mab.to_s
85
+ mab.to_s
86
+ end
85
87
  end
86
88
  end
@@ -1,3 +1,3 @@
1
1
  module SongPro
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
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.2
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-02-03 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: markaby