gly 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gly.rb +4 -1
  3. data/lib/gly/cli.rb +71 -8
  4. data/lib/gly/document.rb +20 -8
  5. data/lib/gly/document_gabc_convertor.rb +10 -2
  6. data/lib/gly/exceptions.rb +16 -0
  7. data/lib/gly/exceptions.rb~ +3 -0
  8. data/lib/gly/gabc_convertor.rb +29 -11
  9. data/lib/gly/gly_convertor.rb +52 -0
  10. data/lib/gly/gly_convertor.rb~ +11 -0
  11. data/lib/gly/glyfy_cli.rb~ +92 -0
  12. data/lib/gly/headers.rb +3 -1
  13. data/lib/gly/lister.rb +41 -6
  14. data/lib/gly/lyrics.rb +7 -7
  15. data/lib/gly/markup.rb +15 -0
  16. data/lib/gly/markup.rb~ +11 -0
  17. data/lib/gly/parser.rb +65 -23
  18. data/lib/gly/preview_builder.rb +13 -4
  19. data/lib/gly/preview_generator.rb +44 -23
  20. data/lib/gly/{parsed_score.rb → score.rb} +1 -1
  21. data/lib/gly/templates/lualatex_document.tex +11 -11
  22. data/tests/examples.rb +27 -7
  23. data/tests/examples/gly/expected/block_lyrics.gabc +1 -1
  24. data/tests/examples/gly/expected/block_lyrics.gabc~ +2 -0
  25. data/tests/examples/gly/expected/block_music.gabc +2 -0
  26. data/tests/examples/gly/expected/block_music.gabc~ +4 -0
  27. data/tests/examples/gly/expected/blocks.gabc +3 -0
  28. data/tests/examples/gly/expected/differentia_final.gabc +2 -0
  29. data/tests/examples/gly/expected/empty_lyric_syllable.gabc +2 -0
  30. data/tests/examples/gly/expected/empty_lyric_syllable.gabc~ +1 -0
  31. data/tests/examples/gly/expected/explicit_lyrics.gabc +1 -1
  32. data/tests/examples/gly/expected/header_colon.gabc +3 -0
  33. data/tests/examples/gly/expected/header_colon.gabc~ +3 -0
  34. data/tests/examples/gly/expected/header_empty.gabc +2 -0
  35. data/tests/examples/gly/expected/header_empty.gabc~ +2 -0
  36. data/tests/examples/gly/expected/nabc.gabc +3 -0
  37. data/tests/examples/gly/expected/no_clef.gabc +2 -0
  38. data/tests/examples/gly/expected/no_clef.gabc~ +1 -0
  39. data/tests/examples/gly/expected/real1.gabc~ +15 -0
  40. data/tests/examples/gly/expected/unsingables.gabc +2 -0
  41. data/tests/examples/gly/expected/unsingables.gabc~ +2 -0
  42. data/tests/examples/gly/given/block_lyrics.gly~ +3 -0
  43. data/tests/examples/gly/given/block_music.gly +4 -0
  44. data/tests/examples/gly/given/blocks.gly +6 -0
  45. data/tests/examples/gly/given/differentia_final.gly +5 -0
  46. data/tests/examples/gly/given/differentia_final.gly~ +2 -0
  47. data/tests/examples/gly/given/empty_lyric_syllable.gly +2 -0
  48. data/tests/examples/gly/given/empty_lyric_syllable.gly~ +2 -0
  49. data/tests/examples/gly/given/header_colon.gly +3 -0
  50. data/tests/examples/gly/given/header_colon.gly~ +4 -0
  51. data/tests/examples/gly/given/header_empty.gly +1 -0
  52. data/tests/examples/gly/given/header_empty.gly~ +2 -0
  53. data/tests/examples/gly/given/nabc.gly +3 -0
  54. data/tests/examples/gly/given/nabc.gly~ +2 -0
  55. data/tests/examples/gly/given/no_clef.gly +2 -0
  56. data/tests/examples/gly/given/no_clef.gly~ +1 -0
  57. data/tests/examples/gly/given/real1.gly~ +18 -0
  58. data/tests/examples/gly/given/unsingables.gly +2 -0
  59. data/tests/examples/gly/given/unsingables.gly~ +2 -0
  60. data/tests/examples/glyfy/expected/header.gly +3 -0
  61. data/tests/examples/glyfy/expected/header.gly~ +2 -0
  62. data/tests/examples/glyfy/expected/simple.gly +3 -0
  63. data/tests/examples/glyfy/expected/simple.gly~ +2 -0
  64. data/tests/examples/glyfy/given/header.gabc +3 -0
  65. data/tests/examples/glyfy/given/simple.gabc +2 -0
  66. data/tests/examples/parser/markup_after_header.gly +4 -0
  67. data/tests/examples/parser/markups.gly +10 -0
  68. data/tests/examples/parser/markups.gly~ +5 -0
  69. data/tests/examples/parser/score_markup_order.gly +19 -0
  70. data/tests/examples/parser/score_markup_order.gly~ +13 -0
  71. data/tests/parser.rb +51 -0
  72. data/tests/parser.rb~ +12 -0
  73. data/tests/run.rb +1 -0
  74. data/tests/test_helper.rb +19 -0
  75. metadata +59 -10
  76. data/bin/glyfy +0 -4
  77. data/tests/examples.rb~ +0 -9
  78. data/tests/programmed_examples.rb~ +0 -14
  79. data/tests/run.rb~ +0 -3
  80. data/tests/string_helpers_test.rb~ +0 -19
data/bin/glyfy DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/env ruby
2
-
3
- # glyfy
4
- # takes gabc file(s), produces gly file
@@ -1,9 +0,0 @@
1
- # test-suite dynamically created from examples in subfolders
2
-
3
- def create_test_suite(given_file, expected_file)
4
-
5
- end
6
-
7
- Dir.glob('examples/gly/**/*.gly').each do |given|
8
- expected = given.sub('/given', '/expected').sub('.gly', '.gabc')
9
- end
@@ -1,14 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- # tests of cases that cannot be easily described by a pair
4
- # of single gly file and resulting gabc file
5
- class TestSpecialCases < MiniTest::Test
6
- def self.loads_without_crash_test(filename)
7
- case_name = File.basename(given_file).sub(/\.[^\.]*\Z/, '')
8
- define_method "test_#{case_name}" do
9
- File.open given_file do |fr|
10
- gly_process(fr).string
11
- end
12
- end
13
- end
14
- end
@@ -1,3 +0,0 @@
1
- require 'minitest/autorun'
2
-
3
- require_relative 'examples'
@@ -1,19 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- class StringHelpersTest < GlyTest
4
- SH = Gly::StringHelpers
5
-
6
- examples = [
7
- ['single_chunk', 'a', ['a']],
8
- ['simple_whitespace', 'aa aa', ['aa', 'aa']],
9
- ['leading_trailing_whitespace', ' a a ', ['a', 'a']],
10
- ['bracketted', '(a)', ['a']],
11
- ]
12
-
13
- examples.each do |e|
14
- name, given, expected = e
15
- define_method "test_#{name}" do
16
- assert_equal expected, SH.music_split(given)
17
- end
18
- end
19
- end