music-utils 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -10,7 +10,8 @@ Simple intervals:
10
10
  * Interval.new('do', 'mi', 0).number #=> 3 (3th)
11
11
  * Interval.new('do', 'mi', 0).semitone #=> 4 (semi-tones)
12
12
  * Interval.new('do', 'mi', 0).quality #=> M (major)
13
- * Interval.new('do#', 'mi', 0).quality #=> m (major)
13
+ * Interval.new('do#', 'mi', 0).quality #=> m (minor)
14
+ * Interval.new('do#', 'mi', 0).short #=> m3 (minor 3th)
14
15
 
15
16
  Compound intervals:
16
17
 
@@ -20,7 +21,8 @@ Compound intervals:
20
21
 
21
22
  To Do
22
23
  -----
23
- * Add more rspec examples
24
+ * Add more rspec examples
25
+ * Fix compound intervals quality error
24
26
 
25
27
  Copyright
26
28
  ---------
data/lib/interval.rb CHANGED
@@ -96,4 +96,9 @@ class Interval
96
96
  QUALITIES[number][semitone]
97
97
  end
98
98
 
99
+ # Returns the class interval in the short notation
100
+ def short
101
+ quality + number.to_s
102
+ end
103
+
99
104
  end
data/music-utils.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  # Basic Info
4
4
  s.name = 'music-utils'
5
- s.version = '0.4.0'
5
+ s.version = '0.5.0'
6
6
  s.summary = 'music-utils'
7
7
  s.description = 'Utils for music'
8
8
  s.platform = Gem::Platform::RUBY
@@ -67,5 +67,17 @@ describe Interval do
67
67
  i.quality.should == 'P'
68
68
  end
69
69
  end
70
+
71
+ context "Short Notation" do
72
+ it "the short notation of do-re interval should be M2" do
73
+ i = Interval.new('do', 're', 0)
74
+ i.short.should == 'M2'
75
+ end
76
+
77
+ it "the short notation of do-re interval should be m3" do
78
+ i = Interval.new('do#', 'mi', 0)
79
+ i.short.should == 'm3'
80
+ end
81
+ end
70
82
  end
71
83
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: music-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-04-26 00:00:00.000000000Z
12
+ date: 2011-04-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &77436860 !ruby/object:Gem::Requirement
16
+ requirement: &79625800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *77436860
24
+ version_requirements: *79625800
25
25
  description: Utils for music
26
26
  email:
27
27
  - jorgeluis700@gmail.com
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: -975623391
57
+ hash: 557011027
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements: