musicality 0.6.1 → 0.7.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
  SHA1:
3
- metadata.gz: 8d8e8408a1be330cc1a672767522f3cdf596bb6b
4
- data.tar.gz: 33a3f756ae8d3b31cb4da7cd3bf2b8b8b48aa317
3
+ metadata.gz: c2138ce48e8476b381ac46a6bdc6c9b5578de656
4
+ data.tar.gz: f95722c9c8a4818701880bbe733ccc7684ee41ef
5
5
  SHA512:
6
- metadata.gz: 2d43eba00883baa1e58848acc61a4ce0e9b18176352ae37f65e5c39501dc1db63e7fdf763a87b5eee9e22820fbbebc2a625592fe6f5e89b6b1c9e6dd916fb00a
7
- data.tar.gz: 6a1469a357a4a877ca3e5107f53d53974f13858c3a021dc7a1a257f6e5af566744e81d561c506da52808cf66e4e89081381b22809aeb4bd232e6119f748f458a
6
+ metadata.gz: 9787df99b773046c025138212a9b67494e6ef080211ef429ae04519900e7f3e51dd68c5f0bccb68e762c918e77362fee23a9effb6df8dd06876674914e6d727c
7
+ data.tar.gz: 965abe4f0fd8e897f99909a4d8a6b8c1967f2e45cb8291357d11e60d7c7666660ac9b4f11c5c21f2653de16bb1f74e0e307156183d42ece31d871802d1d07f64
data/ChangeLog.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.7.0 / 2015-04-28
2
+ * Replace Score's title and composer accessors with dual-methods Score#title and Score#composer that can be used to get/set. This makes them useful in the DSL context.
3
+
1
4
  ### 0.6.0 / 2015-04-28
2
5
  * Add Score DSL
3
6
  * Add composition convenience methods `e`, `q`, and `dq` for generating eighth, quarter, and dotted quarter notes
@@ -2,7 +2,23 @@ module Musicality
2
2
 
3
3
  class Score
4
4
  include Validatable
5
- attr_accessor :parts, :program, :title, :composer
5
+ attr_accessor :parts, :program
6
+
7
+ def title value = nil
8
+ if value.nil?
9
+ return @title
10
+ else
11
+ @title = value
12
+ end
13
+ end
14
+
15
+ def composer value = nil
16
+ if value.nil?
17
+ return @composer
18
+ else
19
+ @composer = value
20
+ end
21
+ end
6
22
 
7
23
  def initialize parts: {}, program: [], title: nil, composer: nil, sections: {}
8
24
  @parts = parts
@@ -1,3 +1,3 @@
1
1
  module Musicality
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
2
 
3
3
  measured_score = Score::Measured.new(FOUR_FOUR,120) do |s|
4
- s.title = "The best song ever"
5
- s.composer = "James T."
4
+ s.title "The best song ever"
5
+ s.composer "James T."
6
6
 
7
7
  s.meter_changes[1] = Change::Immediate.new(THREE_FOUR)
8
8
  s.meter_changes[7] = Change::Immediate.new(SIX_EIGHT)
@@ -31,15 +31,15 @@ end
31
31
  unmeasured_score = Score::Unmeasured.new(30) do |s|
32
32
  s.program = measured_score.program
33
33
  s.parts = measured_score.parts
34
- s.title = measured_score.title
35
- s.composer = measured_score.composer
34
+ s.title measured_score.title
35
+ s.composer measured_score.composer
36
36
  end
37
37
 
38
38
  timed_score = Score::Timed.new do |s|
39
39
  s.program = measured_score.program
40
40
  s.parts = measured_score.parts
41
- s.title = measured_score.title
42
- s.composer = measured_score.composer
41
+ s.title measured_score.title
42
+ s.composer measured_score.composer
43
43
  end
44
44
 
45
45
  [ measured_score, unmeasured_score, timed_score ].each do |score|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musicality
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Tunnell