gitara 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.markdown +11 -0
  4. data/README.markdown +1 -1
  5. data/examples/aimee-man-wise-up.ly +1 -1
  6. data/gitara.gemspec +4 -5
  7. data/lib/gitara/app.rb +3 -3
  8. data/lib/gitara/node/base.rb +1 -4
  9. data/lib/gitara/template/tab.erb +1 -1
  10. data/lib/gitara/utilities.rb +7 -4
  11. data/lib/gitara/version.rb +1 -1
  12. data/lib/gitara.rb +2 -2
  13. data/spec/factories.rb +7 -7
  14. data/spec/lib/gitara/app_spec.rb +4 -4
  15. data/spec/lib/gitara/dsl_spec.rb +112 -112
  16. data/spec/lib/gitara/node/alternative_spec.rb +4 -4
  17. data/spec/lib/gitara/node/bar/chorded_version_spec.rb +6 -6
  18. data/spec/lib/gitara/node/bar/stanza_version_spec.rb +5 -5
  19. data/spec/lib/gitara/node/bar/voiced_version_spec.rb +5 -5
  20. data/spec/lib/gitara/node/bar_spec.rb +20 -20
  21. data/spec/lib/gitara/node/base/node_version_spec.rb +19 -19
  22. data/spec/lib/gitara/node/base/voiced_version_spec.rb +9 -9
  23. data/spec/lib/gitara/node/base_spec.rb +113 -106
  24. data/spec/lib/gitara/node/chord_set/chorded_version_spec.rb +2 -2
  25. data/spec/lib/gitara/node/line_spec.rb +2 -2
  26. data/spec/lib/gitara/node/repeat_spec.rb +3 -3
  27. data/spec/lib/gitara/node/stanza_spec.rb +14 -14
  28. data/spec/lib/gitara/node/tab_spec.rb +25 -25
  29. data/spec/lib/gitara/time_signature_spec.rb +6 -6
  30. data/spec/lib/gitara/voice_spec.rb +33 -33
  31. data/spec/lib/gitara_spec.rb +4 -4
  32. data/spec/spec_helper.rb +6 -4
  33. data/spec/support/app_tester.rb +5 -5
  34. metadata +68 -140
  35. data/examples/aimee-man-wise-up.midi +0 -0
  36. data/examples/aimee-man-wise-up.pdf +0 -0
  37. data/examples/eraserheads-huling-el-bimbo.midi +0 -0
  38. data/examples/eraserheads-huling-el-bimbo.pdf +0 -0
  39. data/examples/foo-fighters-walking-after-you.midi +0 -0
  40. data/examples/foo-fighters-walking-after-you.pdf +0 -0
  41. data/examples/tab-with-alternate-tuning.midi +0 -0
  42. data/examples/tab-with-alternate-tuning.pdf +0 -0
  43. data/examples/tab-with-chords.midi +0 -0
  44. data/examples/tab-with-chords.pdf +0 -0
  45. data/examples/tab-with-key-signature.midi +0 -0
  46. data/examples/tab-with-key-signature.pdf +0 -0
  47. data/examples/tab-with-line-with-no-break.midi +0 -0
  48. data/examples/tab-with-line-with-no-break.pdf +0 -0
  49. data/examples/tab-with-partial.midi +0 -0
  50. data/examples/tab-with-partial.pdf +0 -0
  51. data/examples/tab-with-repeats.midi +0 -0
  52. data/examples/tab-with-repeats.pdf +0 -0
  53. data/examples/tab-with-reused-bar-in-stanza.midi +0 -0
  54. data/examples/tab-with-reused-bar-in-stanza.pdf +0 -0
  55. data/examples/tab-with-time-signature.midi +0 -0
  56. data/examples/tab-with-time-signature.pdf +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2e2826f811fba5feb695cbc7031ede9780218536fe398cd8e97bf644b4cb4da4
4
+ data.tar.gz: 074d686d39fe120c15259f1d6b58333201d49c22ef7eec7471715cbff7181474
5
+ SHA512:
6
+ metadata.gz: f9516849fe5f9d5e48f44ecaa47ec88da8e80bcd9c2524dd15157751495723ae0c37e44ab9c31d4edc094f0f13f2928ea699e4d9149de149f61ad55b011b1f3e
7
+ data.tar.gz: 8498c45c544ade9df131ae16ff9e0f9edce49b9fdfd70002678539846c4a810203fce74a4544ac84d9b8eb79685143db93da7a79b3780050992fd10cc7159713
data/.gitignore CHANGED
@@ -12,4 +12,5 @@ b/*
12
12
  doc/*
13
13
  files/*
14
14
  pkg/*
15
+ spec/support/examples.txt
15
16
  tmp/*
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,14 @@
1
+ 1.2.0 - 2024-08-08
2
+ -------------------
3
+
4
+ * [#28] Support Ruby 3.3 and Lilypond 2.22
5
+ * Chord names have moved between the staff and tab staffs. Still figuring out how to move it back under the tab staff.
6
+
7
+ 1.0.1 - 2013-01-24
8
+ ------------------
9
+
10
+ Do not include pdfs and midis in gem.
11
+
1
12
  1.0.0 - 2013-01-24
2
13
  ------------------
3
14
 
data/README.markdown CHANGED
@@ -10,7 +10,7 @@ To install,
10
10
 
11
11
  You need [lilypond](http://lilypond.org) in order to generate pdfs and midis.
12
12
 
13
- Gitara is tested on Ruby 1.9.3 and Lilypond 2.14. Patches are welcome.
13
+ Gitara is tested on Ruby 3.3.3 and Lilypond 2.22. Patches are welcome.
14
14
 
15
15
  To run,
16
16
 
@@ -1,4 +1,4 @@
1
- \version "2.14.2"
1
+ \version "2.22.1"
2
2
  \include "english.ly"
3
3
 
4
4
  \paper {
data/gitara.gemspec CHANGED
@@ -13,24 +13,23 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.rubyforge_project = "gitara"
15
15
 
16
- s.files = `git ls-files`.split("\n")
16
+ s.files = `git ls-files`.split("\n").reject{|file| file =~ %r{\.(pdf)|(midi)}}
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_runtime_dependency "active_support"
21
+ s.add_runtime_dependency "activesupport"
22
22
  s.add_runtime_dependency "erubis"
23
23
  s.add_runtime_dependency "linguistics"
24
24
  s.add_runtime_dependency "loggability"
25
- s.add_runtime_dependency "pow"
26
25
  s.add_runtime_dependency "redwood"
27
26
  s.add_runtime_dependency "thor"
28
27
  s.add_runtime_dependency "valuable"
29
28
 
30
- s.add_development_dependency "factory_girl"
29
+ s.add_development_dependency "factory_bot"
31
30
  s.add_development_dependency "guard"
32
31
  s.add_development_dependency "guard-rspec"
33
- s.add_development_dependency "pry"
32
+ s.add_development_dependency "byebug"
34
33
  s.add_development_dependency "rb-inotify"
35
34
  s.add_development_dependency "rspec"
36
35
  s.add_development_dependency "yard"
data/lib/gitara/app.rb CHANGED
@@ -17,12 +17,12 @@ module Gitara
17
17
  def export(source_path)
18
18
  load source_path
19
19
  tab = Gitara.tab
20
- lilypond_name = Pow(source_path).name(false) + '.ly'
21
- lilypond_path = Pow(options['target-directory']) / lilypond_name
20
+ lilypond_name = Pathname.new(source_path).sub_ext('.ly')
21
+ lilypond_path = Pathname.new(options['target-directory']) / lilypond_name
22
22
  lilypond_path.write(Gitara.render('tab', tab))
23
23
 
24
24
  if options['run-lilypond']
25
- `lilypond -o #{lilypond_path.parent / lilypond_path.name(false)} #{lilypond_path}`
25
+ `lilypond -o #{lilypond_path.parent / lilypond_path.basename.sub_ext('') } #{lilypond_path}`
26
26
  end
27
27
  end
28
28
  end
@@ -55,10 +55,7 @@ module Gitara
55
55
  end
56
56
 
57
57
  def definition_name
58
- name.to_s.
59
- gsub(/\W/, '_').
60
- gsub(/\d+/){|s| Utilities.id_as_word(s)}.
61
- camelize
58
+ name.to_s.gsub(/\d+/){ |s| Utilities.id_as_word(s) }.split(/\W/).map(&:camelize).join
62
59
  end
63
60
 
64
61
  def definition_of?(target)
@@ -1,4 +1,4 @@
1
- \version "2.14.2"
1
+ \version "2.22.1"
2
2
  \include "english.ly"
3
3
 
4
4
  \paper {
@@ -1,5 +1,8 @@
1
1
  module Gitara
2
2
  module Utilities
3
+ class PathnameDoesNotExist < StandardError
4
+ end
5
+
3
6
  def self.id_as_word(id)
4
7
  id.en.numwords.gsub('-', '_').camelize
5
8
  end
@@ -8,11 +11,11 @@ module Gitara
8
11
  "#{object.class}(" + attributes.collect{|a| "#{a}=#{object.send(a).inspect}"}.join(', ') + ")"
9
12
  end
10
13
 
11
- def self.read!(pow)
12
- if pow.exists?
13
- pow.read
14
+ def self.read!(pathname)
15
+ if pathname.exist?
16
+ pathname.read
14
17
  else
15
- raise PowError, "#{pow} does not exist"
18
+ raise PathnameDoesNotExist, "#{pathname} does not exist"
16
19
  end
17
20
  end
18
21
  end
@@ -1,3 +1,3 @@
1
1
  module Gitara
2
- VERSION = "1.0.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/lib/gitara.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "active_support/inflector"
2
2
  require "erubis"
3
3
  require "linguistics"
4
- require "pow"
4
+ require "pathname"
5
5
  require "redwood"
6
6
  require "thor"
7
7
  require "valuable"
@@ -41,7 +41,7 @@ module Gitara
41
41
  end
42
42
 
43
43
  def self.render(path, object)
44
- template = (Pow!('gitara/template') / "#{path}.erb")
44
+ template = Pathname.new(__FILE__).parent / "gitara/template/#{path}.erb"
45
45
  erb = Erubis::Eruby.new(Utilities.read!(template))
46
46
  erb.evaluate(object)
47
47
  end
data/spec/factories.rb CHANGED
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :note_set, :class => Node::NoteSet do
3
3
  end
4
4
 
@@ -9,7 +9,7 @@ FactoryGirl.define do
9
9
  end
10
10
 
11
11
  factory :bar, :class => Node::Bar do
12
- children [FactoryGirl.build(:note_set)]
12
+ children { [FactoryBot.build(:note_set)] }
13
13
  end
14
14
 
15
15
  factory :base, :class => Node::Base do
@@ -28,25 +28,25 @@ FactoryGirl.define do
28
28
  end
29
29
 
30
30
  factory :line, :class => Node::Line do
31
- children [FactoryGirl.build(:bar)]
31
+ children { [FactoryBot.build(:bar)] }
32
32
  end
33
33
 
34
34
  factory :repeat, :class => Node::Repeat do
35
35
  end
36
36
 
37
37
  factory :stanza, :class => Node::Stanza do
38
- children [FactoryGirl.build(:line)]
38
+ children { [FactoryBot.build(:line)] }
39
39
  end
40
40
 
41
41
  factory :stanza_version_bar, :class => Node::Bar::StanzaVersion do
42
42
  end
43
43
 
44
44
  factory :score, :class => Node::Score do
45
- children [FactoryGirl.build(:stanza)]
45
+ children { [FactoryBot.build(:stanza)] }
46
46
  end
47
47
 
48
48
  factory :tab, :class => Node::Tab do
49
- children [FactoryGirl.build(:score)]
49
+ children { [FactoryBot.build(:score)] }
50
50
  end
51
51
 
52
52
  factory :time_signature, :class => TimeSignature do
@@ -60,4 +60,4 @@ FactoryGirl.define do
60
60
 
61
61
  factory :voiced_version, :class => Node::Base::VoicedVersion do
62
62
  end
63
- end
63
+ end
@@ -4,18 +4,18 @@ describe Gitara::App do
4
4
  describe "#export" do
5
5
  let(:app_test){AppTester.new(:run_lilypond => run_lilypond?)}
6
6
 
7
- Pow('examples').glob('/*.rb').each do |path|
7
+ Pathname.new('examples').glob('/*.rb').each do |path|
8
8
  it "can convert #{path.name(false)} to lilypond" do
9
9
  app_test.name = path.name(false)
10
10
  app_test.run
11
- app_test.actual.should == app_test.expected
11
+ expect(app_test.actual).to eq(app_test.expected)
12
12
  end
13
13
  end
14
14
 
15
15
  after do
16
16
  if run_lilypond?
17
- app_test.should be_midi_generated
18
- app_test.should be_pdf_generated
17
+ expect(app_test).to be_midi_generated
18
+ expect(app_test).to be_pdf_generated
19
19
  end
20
20
  end
21
21
  end