music 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +1 -2
- data/Gemfile +6 -0
- data/Gemfile.lock +234 -34
- data/lib/music/chord.rb +1 -1
- data/lib/music/note.rb +3 -11
- data/lib/music/version.rb +1 -1
- data/music.gemspec +1 -4
- metadata +5 -62
- data/lib/music/patches/hash.rb +0 -5
- data/spec/classes/hash_spec.rb +0 -17
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZWIwNTcyOWMxM2E5MmU1MWY2YTAxNDdmZWMyMGY3MzI4MDMwOWRiYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTNmNjM2NjRiMzYyODcyMTYxNzRjZjA0YTlhMjM1ZTgwN2M2ODQ3YQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjU0ZjBjZDRiNTgyY2JkMDIxZGJjZmU2MzU1YTdmZDQyMGFmMDMwNGUxY2Jj
|
10
|
+
MWIwMzA5OWY4ZmFiNDY0NTNhY2Y2NmUzMmM0MDM0NjI2OTYwN2E5YmViYTM0
|
11
|
+
MWE4ODNiMGU0NTVmZDljNzE2ZjQyMzgwMzViMDQ1NDc5ZDdiM2U=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZGQ0ZWE2ODNhOGFmMzg1YTJmNTZhOThlOTNmNmY5NjYwNGU3NGUwMDJlNDU2
|
14
|
+
NWE1NWM5ZDlkMmJjOGE2MGE3MTdiM2U4ODc2MmQ1NDRmYzYyMzMwNGY0ZjE4
|
15
|
+
ZmM3MDU0MTdhZDZlNGIzYjYxOTE3ZjU1ZDA0NzU3ZjRiMmJjYTI=
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,61 +1,261 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
music (0.
|
4
|
+
music (0.6.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
multi_json (~> 1.0)
|
15
|
-
builder (3.0.0)
|
16
|
-
coderay (1.0.8)
|
17
|
-
diff-lcs (1.1.3)
|
18
|
-
guard (1.5.3)
|
19
|
-
listen (>= 0.4.2)
|
9
|
+
coderay (1.0.9)
|
10
|
+
diff-lcs (1.2.1)
|
11
|
+
ffi2-generators (0.1.1)
|
12
|
+
guard (1.6.2)
|
13
|
+
listen (>= 0.6.0)
|
20
14
|
lumberjack (>= 1.0.2)
|
21
15
|
pry (>= 0.9.10)
|
16
|
+
terminal-table (>= 1.4.3)
|
22
17
|
thor (>= 0.14.6)
|
23
18
|
guard-bundler (1.0.0)
|
24
19
|
bundler (~> 1.0)
|
25
20
|
guard (~> 1.1)
|
26
|
-
guard-rspec (
|
21
|
+
guard-rspec (2.4.1)
|
27
22
|
guard (>= 1.1)
|
28
|
-
|
29
|
-
listen (0.
|
23
|
+
rspec (~> 2.11)
|
24
|
+
listen (0.7.3)
|
30
25
|
lumberjack (1.0.2)
|
31
26
|
method_source (0.8.1)
|
32
|
-
|
33
|
-
pry (0.9.10)
|
27
|
+
pry (0.9.12)
|
34
28
|
coderay (~> 1.0.5)
|
35
29
|
method_source (~> 0.8)
|
36
|
-
slop (~> 3.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
rspec-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
rspec-
|
47
|
-
|
48
|
-
|
30
|
+
slop (~> 3.4)
|
31
|
+
psych (2.0.2)
|
32
|
+
racc (1.4.11)
|
33
|
+
rake (0.9.6)
|
34
|
+
rb-fsevent (0.9.3)
|
35
|
+
rspec (2.13.0)
|
36
|
+
rspec-core (~> 2.13.0)
|
37
|
+
rspec-expectations (~> 2.13.0)
|
38
|
+
rspec-mocks (~> 2.13.0)
|
39
|
+
rspec-core (2.13.0)
|
40
|
+
rspec-expectations (2.13.0)
|
41
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
42
|
+
rspec-mocks (2.13.0)
|
43
|
+
rubysl (2.0.15)
|
44
|
+
rubysl-abbrev (~> 2.0)
|
45
|
+
rubysl-base64 (~> 2.0)
|
46
|
+
rubysl-benchmark (~> 2.0)
|
47
|
+
rubysl-bigdecimal (~> 2.0)
|
48
|
+
rubysl-cgi (~> 2.0)
|
49
|
+
rubysl-cgi-session (~> 2.0)
|
50
|
+
rubysl-cmath (~> 2.0)
|
51
|
+
rubysl-complex (~> 2.0)
|
52
|
+
rubysl-continuation (~> 2.0)
|
53
|
+
rubysl-coverage (~> 2.0)
|
54
|
+
rubysl-csv (~> 2.0)
|
55
|
+
rubysl-curses (~> 2.0)
|
56
|
+
rubysl-date (~> 2.0)
|
57
|
+
rubysl-delegate (~> 2.0)
|
58
|
+
rubysl-digest (~> 2.0)
|
59
|
+
rubysl-drb (~> 2.0)
|
60
|
+
rubysl-e2mmap (~> 2.0)
|
61
|
+
rubysl-english (~> 2.0)
|
62
|
+
rubysl-enumerator (~> 2.0)
|
63
|
+
rubysl-erb (~> 2.0)
|
64
|
+
rubysl-etc (~> 2.0)
|
65
|
+
rubysl-expect (~> 2.0)
|
66
|
+
rubysl-fcntl (~> 2.0)
|
67
|
+
rubysl-fiber (~> 2.0)
|
68
|
+
rubysl-fileutils (~> 2.0)
|
69
|
+
rubysl-find (~> 2.0)
|
70
|
+
rubysl-forwardable (~> 2.0)
|
71
|
+
rubysl-getoptlong (~> 2.0)
|
72
|
+
rubysl-gserver (~> 2.0)
|
73
|
+
rubysl-io-console (~> 2.0)
|
74
|
+
rubysl-io-nonblock (~> 2.0)
|
75
|
+
rubysl-io-wait (~> 2.0)
|
76
|
+
rubysl-ipaddr (~> 2.0)
|
77
|
+
rubysl-irb (~> 2.0)
|
78
|
+
rubysl-logger (~> 2.0)
|
79
|
+
rubysl-mathn (~> 2.0)
|
80
|
+
rubysl-matrix (~> 2.0)
|
81
|
+
rubysl-mkmf (~> 2.0)
|
82
|
+
rubysl-monitor (~> 2.0)
|
83
|
+
rubysl-mutex_m (~> 2.0)
|
84
|
+
rubysl-net-ftp (~> 2.0)
|
85
|
+
rubysl-net-http (~> 2.0)
|
86
|
+
rubysl-net-imap (~> 2.0)
|
87
|
+
rubysl-net-pop (~> 2.0)
|
88
|
+
rubysl-net-protocol (~> 2.0)
|
89
|
+
rubysl-net-smtp (~> 2.0)
|
90
|
+
rubysl-net-telnet (~> 2.0)
|
91
|
+
rubysl-nkf (~> 2.0)
|
92
|
+
rubysl-observer (~> 2.0)
|
93
|
+
rubysl-open-uri (~> 2.0)
|
94
|
+
rubysl-open3 (~> 2.0)
|
95
|
+
rubysl-openssl (~> 2.0)
|
96
|
+
rubysl-optparse (~> 2.0)
|
97
|
+
rubysl-ostruct (~> 2.0)
|
98
|
+
rubysl-pathname (~> 2.0)
|
99
|
+
rubysl-prettyprint (~> 2.0)
|
100
|
+
rubysl-prime (~> 2.0)
|
101
|
+
rubysl-profile (~> 2.0)
|
102
|
+
rubysl-profiler (~> 2.0)
|
103
|
+
rubysl-pstore (~> 2.0)
|
104
|
+
rubysl-pty (~> 2.0)
|
105
|
+
rubysl-rational (~> 2.0)
|
106
|
+
rubysl-readline (~> 2.0)
|
107
|
+
rubysl-resolv (~> 2.0)
|
108
|
+
rubysl-rexml (~> 2.0)
|
109
|
+
rubysl-rinda (~> 2.0)
|
110
|
+
rubysl-rss (~> 2.0)
|
111
|
+
rubysl-scanf (~> 2.0)
|
112
|
+
rubysl-securerandom (~> 2.0)
|
113
|
+
rubysl-set (~> 2.0)
|
114
|
+
rubysl-shellwords (~> 2.0)
|
115
|
+
rubysl-singleton (~> 2.0)
|
116
|
+
rubysl-socket (~> 2.0)
|
117
|
+
rubysl-stringio (~> 2.0)
|
118
|
+
rubysl-strscan (~> 2.0)
|
119
|
+
rubysl-sync (~> 2.0)
|
120
|
+
rubysl-syslog (~> 2.0)
|
121
|
+
rubysl-tempfile (~> 2.0)
|
122
|
+
rubysl-thread (~> 2.0)
|
123
|
+
rubysl-thwait (~> 2.0)
|
124
|
+
rubysl-time (~> 2.0)
|
125
|
+
rubysl-timeout (~> 2.0)
|
126
|
+
rubysl-tmpdir (~> 2.0)
|
127
|
+
rubysl-tsort (~> 2.0)
|
128
|
+
rubysl-un (~> 2.0)
|
129
|
+
rubysl-uri (~> 2.0)
|
130
|
+
rubysl-weakref (~> 2.0)
|
131
|
+
rubysl-webrick (~> 2.0)
|
132
|
+
rubysl-xmlrpc (~> 2.0)
|
133
|
+
rubysl-yaml (~> 2.0)
|
134
|
+
rubysl-zlib (~> 2.0)
|
135
|
+
rubysl-abbrev (2.0.4)
|
136
|
+
rubysl-base64 (2.0.0)
|
137
|
+
rubysl-benchmark (2.0.1)
|
138
|
+
rubysl-bigdecimal (2.0.2)
|
139
|
+
rubysl-cgi (2.0.1)
|
140
|
+
rubysl-cgi-session (2.0.1)
|
141
|
+
rubysl-cmath (2.0.0)
|
142
|
+
rubysl-complex (2.0.0)
|
143
|
+
rubysl-continuation (2.0.0)
|
144
|
+
rubysl-coverage (2.0.3)
|
145
|
+
rubysl-csv (2.0.2)
|
146
|
+
rubysl-english (~> 2.0)
|
147
|
+
rubysl-curses (2.0.1)
|
148
|
+
rubysl-date (2.0.6)
|
149
|
+
rubysl-delegate (2.0.1)
|
150
|
+
rubysl-digest (2.0.3)
|
151
|
+
rubysl-drb (2.0.1)
|
152
|
+
rubysl-e2mmap (2.0.0)
|
153
|
+
rubysl-english (2.0.0)
|
154
|
+
rubysl-enumerator (2.0.0)
|
155
|
+
rubysl-erb (2.0.1)
|
156
|
+
rubysl-etc (2.0.3)
|
157
|
+
ffi2-generators (~> 0.1)
|
158
|
+
rubysl-expect (2.0.0)
|
159
|
+
rubysl-fcntl (2.0.4)
|
160
|
+
ffi2-generators (~> 0.1)
|
161
|
+
rubysl-fiber (2.0.0)
|
162
|
+
rubysl-fileutils (2.0.3)
|
163
|
+
rubysl-find (2.0.1)
|
164
|
+
rubysl-forwardable (2.0.1)
|
165
|
+
rubysl-getoptlong (2.0.0)
|
166
|
+
rubysl-gserver (2.0.0)
|
167
|
+
rubysl-socket (~> 2.0)
|
168
|
+
rubysl-thread (~> 2.0)
|
169
|
+
rubysl-io-console (2.0.0)
|
170
|
+
rubysl-io-nonblock (2.0.0)
|
171
|
+
rubysl-io-wait (2.0.0)
|
172
|
+
rubysl-ipaddr (2.0.0)
|
173
|
+
rubysl-irb (2.0.4)
|
174
|
+
rubysl-e2mmap (~> 2.0)
|
175
|
+
rubysl-mathn (~> 2.0)
|
176
|
+
rubysl-readline (~> 2.0)
|
177
|
+
rubysl-thread (~> 2.0)
|
178
|
+
rubysl-logger (2.0.0)
|
179
|
+
rubysl-mathn (2.0.0)
|
180
|
+
rubysl-matrix (2.1.0)
|
181
|
+
rubysl-e2mmap (~> 2.0)
|
182
|
+
rubysl-mkmf (2.0.1)
|
183
|
+
rubysl-fileutils (~> 2.0)
|
184
|
+
rubysl-shellwords (~> 2.0)
|
185
|
+
rubysl-monitor (2.0.0)
|
186
|
+
rubysl-mutex_m (2.0.0)
|
187
|
+
rubysl-net-ftp (2.0.1)
|
188
|
+
rubysl-net-http (2.0.4)
|
189
|
+
rubysl-cgi (~> 2.0)
|
190
|
+
rubysl-erb (~> 2.0)
|
191
|
+
rubysl-singleton (~> 2.0)
|
192
|
+
rubysl-net-imap (2.0.1)
|
193
|
+
rubysl-net-pop (2.0.1)
|
194
|
+
rubysl-net-protocol (2.0.1)
|
195
|
+
rubysl-net-smtp (2.0.1)
|
196
|
+
rubysl-net-telnet (2.0.0)
|
197
|
+
rubysl-nkf (2.0.1)
|
198
|
+
rubysl-observer (2.0.0)
|
199
|
+
rubysl-open-uri (2.0.0)
|
200
|
+
rubysl-open3 (2.0.0)
|
201
|
+
rubysl-openssl (2.1.0)
|
202
|
+
rubysl-optparse (2.0.1)
|
203
|
+
rubysl-shellwords (~> 2.0)
|
204
|
+
rubysl-ostruct (2.0.4)
|
205
|
+
rubysl-pathname (2.0.0)
|
206
|
+
rubysl-prettyprint (2.0.2)
|
207
|
+
rubysl-prime (2.0.1)
|
208
|
+
rubysl-profile (2.0.0)
|
209
|
+
rubysl-profiler (2.0.1)
|
210
|
+
rubysl-pstore (2.0.0)
|
211
|
+
rubysl-pty (2.0.2)
|
212
|
+
rubysl-rational (2.0.1)
|
213
|
+
rubysl-readline (2.0.2)
|
214
|
+
rubysl-resolv (2.0.0)
|
215
|
+
rubysl-rexml (2.0.2)
|
216
|
+
rubysl-rinda (2.0.1)
|
217
|
+
rubysl-rss (2.0.0)
|
218
|
+
rubysl-scanf (2.0.0)
|
219
|
+
rubysl-securerandom (2.0.0)
|
220
|
+
rubysl-set (2.0.1)
|
221
|
+
rubysl-shellwords (2.0.0)
|
222
|
+
rubysl-singleton (2.0.0)
|
223
|
+
rubysl-socket (2.0.1)
|
224
|
+
rubysl-stringio (2.0.0)
|
225
|
+
rubysl-strscan (2.0.0)
|
226
|
+
rubysl-sync (2.0.0)
|
227
|
+
rubysl-syslog (2.0.1)
|
228
|
+
ffi2-generators (~> 0.1)
|
229
|
+
rubysl-tempfile (2.0.1)
|
230
|
+
rubysl-thread (2.0.2)
|
231
|
+
rubysl-thwait (2.0.0)
|
232
|
+
rubysl-time (2.0.3)
|
233
|
+
rubysl-timeout (2.0.0)
|
234
|
+
rubysl-tmpdir (2.0.0)
|
235
|
+
rubysl-tsort (2.0.1)
|
236
|
+
rubysl-un (2.0.0)
|
237
|
+
rubysl-fileutils (~> 2.0)
|
238
|
+
rubysl-optparse (~> 2.0)
|
239
|
+
rubysl-uri (2.0.0)
|
240
|
+
rubysl-weakref (2.0.0)
|
241
|
+
rubysl-webrick (2.0.0)
|
242
|
+
rubysl-xmlrpc (2.0.0)
|
243
|
+
rubysl-yaml (2.0.4)
|
244
|
+
rubysl-zlib (2.0.1)
|
245
|
+
slop (3.4.3)
|
246
|
+
terminal-table (1.4.5)
|
247
|
+
thor (0.17.0)
|
49
248
|
|
50
249
|
PLATFORMS
|
51
250
|
ruby
|
52
251
|
|
53
252
|
DEPENDENCIES
|
54
|
-
activemodel (>= 3.2.0)
|
55
|
-
bundler (>= 1.1.3)
|
56
253
|
guard-bundler
|
57
254
|
guard-rspec
|
58
255
|
music!
|
59
|
-
|
256
|
+
psych
|
257
|
+
racc
|
258
|
+
rake (~> 0.9)
|
60
259
|
rb-fsevent (~> 0.9.1)
|
61
|
-
rspec
|
260
|
+
rspec (~> 2)
|
261
|
+
rubysl (~> 2.0)
|
data/lib/music/chord.rb
CHANGED
@@ -97,7 +97,7 @@ module Music
|
|
97
97
|
if note_string_match = chord_string.match(/^([A-Ga-g])([#b]?)([^\d]*)(\d*)$/)
|
98
98
|
full_string, note, accidental, interval, octave = note_string_match.to_a
|
99
99
|
|
100
|
-
raise ArgumentError, 'No octave found and no octave assumed' if note.
|
100
|
+
raise ArgumentError, 'No octave found and no octave assumed' if note.empty? && assumed_octave.nil?
|
101
101
|
|
102
102
|
Note.new(note + accidental + octave, assumed_octave).chord(interval)
|
103
103
|
end
|
data/lib/music/note.rb
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
require 'active_model'
|
2
|
-
require 'music/patches/hash'
|
3
|
-
|
4
1
|
module Music
|
5
2
|
class Note
|
6
|
-
include ActiveModel::Validations
|
7
3
|
|
8
4
|
NOTES = ['C', 'C#/Db', 'D', 'D#/Eb', 'E', 'F', 'F#/Gb', 'G', 'G#/Ab', 'A', 'A#/Bb', 'B']
|
9
5
|
NOTE_STRINGS = ['Ab', 'A', 'A#', 'Bb', 'B', 'C', 'C#', 'Db', 'D', 'D#', 'Eb', 'E', 'F', 'Gb', 'G', 'G#']
|
10
6
|
|
11
7
|
attr_accessor :frequency
|
12
8
|
|
13
|
-
validates_presence_of :frequency
|
14
|
-
|
15
9
|
include Comparable
|
16
10
|
def <=>(other_note)
|
17
11
|
self.frequency <=> other_note.frequency
|
@@ -228,7 +222,7 @@ module Music
|
|
228
222
|
}
|
229
223
|
|
230
224
|
def chord(description)
|
231
|
-
description = :major if description.
|
225
|
+
description = :major if description.to_s.empty?
|
232
226
|
|
233
227
|
description = description.to_s
|
234
228
|
description.downcase! unless ['M', 'M7'].include?(description)
|
@@ -249,16 +243,14 @@ module Music
|
|
249
243
|
end
|
250
244
|
|
251
245
|
class << self
|
252
|
-
extend ActiveSupport::Memoizable
|
253
|
-
|
254
246
|
def parse_note_string(note_string, assumed_octave = nil)
|
255
247
|
match = note_string.match(/^([A-Ga-g])([#b]?)([0-8]?)$/)
|
256
248
|
|
257
249
|
raise ArgumentError, "Did not recognize note string: #{note_string}" if !match
|
258
|
-
raise ArgumentError, "No octave found or specified" if match[3].
|
250
|
+
raise ArgumentError, "No octave found or specified" if match[3].empty? && assumed_octave.nil?
|
259
251
|
raise ArgumentError if match[3].to_i > 8 || (assumed_octave && !(0..8).include?(assumed_octave))
|
260
252
|
|
261
|
-
octave = match[3].
|
253
|
+
octave = match[3].empty? ? assumed_octave : match[3]
|
262
254
|
[match[1].upcase, match[2] == '' ? nil : match[2], octave.to_i]
|
263
255
|
end
|
264
256
|
|
data/lib/music/version.rb
CHANGED
data/music.gemspec
CHANGED
@@ -21,9 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
23
|
# Dependencies
|
24
|
-
s.add_dependency "activemodel", "~> 3.2"
|
25
24
|
s.add_development_dependency "rake", "~> 0.9"
|
26
|
-
s.add_development_dependency "bundler", "~> 1.1.3"
|
27
25
|
s.add_development_dependency "rspec", '~> 2'
|
28
|
-
|
29
|
-
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,36 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: music
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brian Underwood
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-02-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: activemodel
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.2'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.2'
|
30
13
|
- !ruby/object:Gem::Dependency
|
31
14
|
name: rake
|
32
15
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
16
|
requirements:
|
35
17
|
- - ~>
|
36
18
|
- !ruby/object:Gem::Version
|
@@ -38,31 +20,13 @@ dependencies:
|
|
38
20
|
type: :development
|
39
21
|
prerelease: false
|
40
22
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
23
|
requirements:
|
43
24
|
- - ~>
|
44
25
|
- !ruby/object:Gem::Version
|
45
26
|
version: '0.9'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: bundler
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 1.1.3
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.1.3
|
62
27
|
- !ruby/object:Gem::Dependency
|
63
28
|
name: rspec
|
64
29
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
30
|
requirements:
|
67
31
|
- - ~>
|
68
32
|
- !ruby/object:Gem::Version
|
@@ -70,27 +34,10 @@ dependencies:
|
|
70
34
|
type: :development
|
71
35
|
prerelease: false
|
72
36
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
37
|
requirements:
|
75
38
|
- - ~>
|
76
39
|
- !ruby/object:Gem::Version
|
77
40
|
version: '2'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: activemodel
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 3.2.0
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 3.2.0
|
94
41
|
description: Library for classifying notes and chords and performing calculations
|
95
42
|
on them. See README.md
|
96
43
|
email:
|
@@ -111,42 +58,38 @@ files:
|
|
111
58
|
- lib/music.rb
|
112
59
|
- lib/music/chord.rb
|
113
60
|
- lib/music/note.rb
|
114
|
-
- lib/music/patches/hash.rb
|
115
61
|
- lib/music/version.rb
|
116
62
|
- music.gemspec
|
117
63
|
- spec/classes/chord_spec.rb
|
118
|
-
- spec/classes/hash_spec.rb
|
119
64
|
- spec/classes/note_spec.rb
|
120
65
|
- spec/spec_helper.rb
|
121
66
|
- spec/support/matchers/have_an_interval.rb
|
122
67
|
homepage: http://github.com/cheerfulstoic/music
|
123
68
|
licenses:
|
124
69
|
- MIT
|
70
|
+
metadata: {}
|
125
71
|
post_install_message:
|
126
72
|
rdoc_options: []
|
127
73
|
require_paths:
|
128
74
|
- lib
|
129
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
76
|
requirements:
|
132
77
|
- - ! '>='
|
133
78
|
- !ruby/object:Gem::Version
|
134
79
|
version: '0'
|
135
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
-
none: false
|
137
81
|
requirements:
|
138
82
|
- - ! '>='
|
139
83
|
- !ruby/object:Gem::Version
|
140
84
|
version: '0'
|
141
85
|
requirements: []
|
142
86
|
rubyforge_project:
|
143
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 2.1.11
|
144
88
|
signing_key:
|
145
|
-
specification_version:
|
89
|
+
specification_version: 4
|
146
90
|
summary: Library for performing calculations on musical elements
|
147
91
|
test_files:
|
148
92
|
- spec/classes/chord_spec.rb
|
149
|
-
- spec/classes/hash_spec.rb
|
150
93
|
- spec/classes/note_spec.rb
|
151
94
|
- spec/spec_helper.rb
|
152
95
|
- spec/support/matchers/have_an_interval.rb
|
data/lib/music/patches/hash.rb
DELETED
data/spec/classes/hash_spec.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'music/patches/hash'
|
3
|
-
|
4
|
-
describe Hash do
|
5
|
-
describe '#flip' do
|
6
|
-
it "Should reverse keys and values" do
|
7
|
-
{1 => 2, 3 => 4}.flip.should == {2 => 1, 4 => 3}
|
8
|
-
|
9
|
-
{'foo' => 'bar', 'baz' => 'bitz'}.flip.should == {'bitz' => 'baz', 'bar' => 'foo'}
|
10
|
-
end
|
11
|
-
|
12
|
-
it "Should return an empty hash from an empty hash" do
|
13
|
-
{}.flip.should == {}
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|