gitara 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +2 -0
  2. data/.yardopts +5 -0
  3. data/CHANGELOG.markdown +5 -0
  4. data/README.markdown +135 -99
  5. data/examples/tab-with-repeats.ly +117 -0
  6. data/examples/tab-with-repeats.rb +19 -0
  7. data/gitara.gemspec +3 -0
  8. data/lib/gitara.rb +5 -3
  9. data/lib/gitara/dsl.rb +13 -0
  10. data/lib/gitara/node/alternative.rb +14 -0
  11. data/lib/gitara/node/bar.rb +3 -1
  12. data/lib/gitara/node/base.rb +22 -24
  13. data/lib/gitara/node/base/chorded_version.rb +1 -4
  14. data/lib/gitara/node/base/node_version.rb +35 -0
  15. data/lib/gitara/node/base/stanza_version.rb +1 -4
  16. data/lib/gitara/node/base/voiced_version.rb +5 -6
  17. data/lib/gitara/node/repeat.rb +10 -0
  18. data/lib/gitara/node/tab.rb +3 -5
  19. data/lib/gitara/utilities.rb +8 -0
  20. data/lib/gitara/version.rb +1 -1
  21. data/lib/gitara/voice.rb +2 -0
  22. data/spec/factories.rb +6 -0
  23. data/spec/lib/gitara/app_spec.rb +12 -28
  24. data/spec/lib/gitara/dsl_spec.rb +218 -173
  25. data/spec/lib/gitara/node/alternative_spec.rb +15 -0
  26. data/spec/lib/gitara/node/bar/chorded_version_spec.rb +2 -2
  27. data/spec/lib/gitara/node/bar/stanza_version_spec.rb +2 -2
  28. data/spec/lib/gitara/node/bar/voiced_version_spec.rb +2 -2
  29. data/spec/lib/gitara/node/bar_spec.rb +7 -7
  30. data/spec/lib/gitara/node/base/chorded_version_spec.rb +1 -1
  31. data/spec/lib/gitara/node/base/node_version_spec.rb +66 -0
  32. data/spec/lib/gitara/node/base/voiced_version_spec.rb +5 -5
  33. data/spec/lib/gitara/node/base_spec.rb +36 -42
  34. data/spec/lib/gitara/node/chord_set/chorded_version_spec.rb +2 -2
  35. data/spec/lib/gitara/node/chord_set_spec.rb +1 -1
  36. data/spec/lib/gitara/node/note_set_spec.rb +1 -1
  37. data/spec/lib/gitara/node/repeat_spec.rb +15 -0
  38. data/spec/lib/gitara/node/stanza_spec.rb +2 -2
  39. data/spec/lib/gitara/node/tab_spec.rb +6 -6
  40. data/spec/lib/gitara/voice_spec.rb +9 -9
  41. data/spec/lib/gitara_spec.rb +3 -1
  42. data/spec/spec_helper.rb +1 -0
  43. data/spec/support/app_tester.rb +22 -0
  44. metadata +70 -29
  45. data/lib/gitara/is_node_version.rb +0 -23
  46. data/lib/gitara/pow/base.rb +0 -11
  47. data/spec/lib/gitara/is_node_version_spec.rb +0 -58
@@ -1,11 +0,0 @@
1
- module Pow
2
- class Base
3
- def read!
4
- if exists?
5
- read
6
- else
7
- raise PowError, "#{self} does not exist"
8
- end
9
- end
10
- end
11
- end
@@ -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
-