gitara 1.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
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,9 @@
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
+
1
7
  1.0.1 - 2013-01-24
2
8
  ------------------
3
9
 
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
@@ -18,19 +18,18 @@ Gem::Specification.new do |s|
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.1"
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