gitara 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.yardopts +5 -0
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +135 -99
- data/examples/tab-with-repeats.ly +117 -0
- data/examples/tab-with-repeats.rb +19 -0
- data/gitara.gemspec +3 -0
- data/lib/gitara.rb +5 -3
- data/lib/gitara/dsl.rb +13 -0
- data/lib/gitara/node/alternative.rb +14 -0
- data/lib/gitara/node/bar.rb +3 -1
- data/lib/gitara/node/base.rb +22 -24
- data/lib/gitara/node/base/chorded_version.rb +1 -4
- data/lib/gitara/node/base/node_version.rb +35 -0
- data/lib/gitara/node/base/stanza_version.rb +1 -4
- data/lib/gitara/node/base/voiced_version.rb +5 -6
- data/lib/gitara/node/repeat.rb +10 -0
- data/lib/gitara/node/tab.rb +3 -5
- data/lib/gitara/utilities.rb +8 -0
- data/lib/gitara/version.rb +1 -1
- data/lib/gitara/voice.rb +2 -0
- data/spec/factories.rb +6 -0
- data/spec/lib/gitara/app_spec.rb +12 -28
- data/spec/lib/gitara/dsl_spec.rb +218 -173
- data/spec/lib/gitara/node/alternative_spec.rb +15 -0
- data/spec/lib/gitara/node/bar/chorded_version_spec.rb +2 -2
- data/spec/lib/gitara/node/bar/stanza_version_spec.rb +2 -2
- data/spec/lib/gitara/node/bar/voiced_version_spec.rb +2 -2
- data/spec/lib/gitara/node/bar_spec.rb +7 -7
- data/spec/lib/gitara/node/base/chorded_version_spec.rb +1 -1
- data/spec/lib/gitara/node/base/node_version_spec.rb +66 -0
- data/spec/lib/gitara/node/base/voiced_version_spec.rb +5 -5
- data/spec/lib/gitara/node/base_spec.rb +36 -42
- data/spec/lib/gitara/node/chord_set/chorded_version_spec.rb +2 -2
- data/spec/lib/gitara/node/chord_set_spec.rb +1 -1
- data/spec/lib/gitara/node/note_set_spec.rb +1 -1
- data/spec/lib/gitara/node/repeat_spec.rb +15 -0
- data/spec/lib/gitara/node/stanza_spec.rb +2 -2
- data/spec/lib/gitara/node/tab_spec.rb +6 -6
- data/spec/lib/gitara/voice_spec.rb +9 -9
- data/spec/lib/gitara_spec.rb +3 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/app_tester.rb +22 -0
- metadata +70 -29
- data/lib/gitara/is_node_version.rb +0 -23
- data/lib/gitara/pow/base.rb +0 -11
- data/spec/lib/gitara/is_node_version_spec.rb +0 -58
data/lib/gitara/pow/base.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe IsNodeVersion do
|
4
|
-
class DummyVersion < Valuable
|
5
|
-
include IsNodeVersion
|
6
|
-
|
7
|
-
has_value :node
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "prefix" do
|
11
|
-
it "should be by default the first letter of the class" do
|
12
|
-
dummy_version = DummyVersion.new
|
13
|
-
dummy_version.extend(IsNodeVersion)
|
14
|
-
dummy_version.prefix.should == 'd'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "definition_name" do
|
19
|
-
it "should include the node's class and the node's name" do
|
20
|
-
dummy_version = DummyVersion.new(:node => FactoryGirl.build(:base, :name => 'some node'))
|
21
|
-
dummy_version.definition_name.should == 'dBaseSomeNode'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "call_name" do
|
26
|
-
it "should be the call version of the definition name" do
|
27
|
-
dummy_version = DummyVersion.new(:node => FactoryGirl.build(:base, :name => 'some node'))
|
28
|
-
dummy_version.call_name.should == '\dBaseSomeNode'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "value" do
|
33
|
-
it "should be the call names of its children" do
|
34
|
-
node = FactoryGirl.build(:base, :children => [
|
35
|
-
FactoryGirl.build(:base, :name => :First),
|
36
|
-
FactoryGirl.build(:base, :name => :Second)
|
37
|
-
])
|
38
|
-
node_version = DummyVersion.new(:node => node)
|
39
|
-
node_version.value.should == '\dBaseFirst \dBaseSecond'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
describe "children" do
|
44
|
-
it "should be versionized versions of the node's children" do
|
45
|
-
parent = FactoryGirl.build(:base, :name => 'parent')
|
46
|
-
child = FactoryGirl.build(:base, :name => 'child')
|
47
|
-
parent.add child
|
48
|
-
|
49
|
-
node_version = DummyVersion.new(:node => parent)
|
50
|
-
|
51
|
-
children = node_version.children
|
52
|
-
children.should have(1).child
|
53
|
-
children[0].node.should == child
|
54
|
-
children[0].should be_a(DummyVersion)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|