songbooks 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d039be80aa91be731b93c15a510600e11e5dcb19
4
- data.tar.gz: b22174caf5f19f92cb21f6cdc5731659c920e4b0
3
+ metadata.gz: c3c550bd81fd6f184ccafb6017616b794678f6b6
4
+ data.tar.gz: 3b68b821f9628595d751df1398c95fd18d4cabca
5
5
  SHA512:
6
- metadata.gz: 8b2144caaa1ca0acc9d29f63d6e27f556053a922a13a4ad824d684c9596bd23d68ac99335593fb28e98aeffdeeb7587a1414229be0be4e1f9393a87c3e19de13
7
- data.tar.gz: 649206f5dd910096907c2f5c31805f4ca4179754b38c5a5fc5fffc54e93ce91f45559db12287547becca6fdaa2d44ae161489aaa1c2b2b357ee52bc3d2ab262a
6
+ metadata.gz: 2857a5dbc1a3701d5cd9b69871e29409764f9779ee402dbafc6f48203a8db82918d753d30f0cfba14e1fd6dabdf81d95e3027777c90fdcacacffb68b1276bc49
7
+ data.tar.gz: ab5e6dff8c0d559d2359447075b2ff755784452e766f6e6c0d52c11cbbc6306f7763a3125388b94d3a530240773d4ccc1b82cd3b9b89ac2ffbe4d8cf867515f4
data/lib/songbooks/CLI.rb CHANGED
@@ -5,8 +5,8 @@ module Songbooks
5
5
  class CLI < Thor
6
6
  desc :start, 'Starts a songbook server'
7
7
  def start(directory = '.')
8
+ puts "Starting songbook server in #{File.expand_path(directory)}..."
8
9
  Songbooks.initialize_folder(File.expand_path(directory))
9
- puts Songbooks.folder.inspect
10
10
  Songbooks::Server.run!
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Songbooks
6
6
  # CONSTANTS
7
7
  #----------------------------------------------------------------
8
8
 
9
- NOTES = %w(C Db D Eb E F Gb G Ab A Bb B)
9
+ NOTES = %w(C Db D Eb E F Gb G Ab A Bb B).freeze
10
10
 
11
11
  NOTE_MAPPING = [
12
12
  %w(C# Db),
@@ -20,14 +20,14 @@ module Songbooks
20
20
  ].each_with_object({}) do |(n1, n2), h|
21
21
  h[n1] = n2
22
22
  h[n2] = n1
23
- end
23
+ end.freeze
24
24
 
25
- CHORD_REGEXP = /[A-G](?:b|#)?(?:(?:m(?:aj)?|M|aug|dim|sus)?(?:[2-7]|9|13)?)?(?:\/[A-G](?:b|#)?)?/
26
- NOTE_REGEXP = /\A[A-G](b|#)*/
25
+ CHORD_REGEXP = /[A-G](?:b|#)?(?:(?:m(?:aj)?|M|aug|dim|sus)?(?:[2-7]|9|13)?)?(?:\/[A-G](?:b|#)?)?/.freeze
26
+ NOTE_REGEXP = /\A[A-G](b|#)*/.freeze
27
27
 
28
28
  # A chord in a line has to appear either right before a space or punctuation symbol
29
29
  # or be the only thing left in a string
30
- CHORD_OCCURRENCE_REGEXP = /\A(#{CHORD_REGEXP})(?:\s+|[\.,\|])|\A(#{CHORD_REGEXP})\z/
30
+ CHORD_OCCURRENCE_REGEXP = /\A(#{CHORD_REGEXP})(?:\s+|[\.,\|])|\A(#{CHORD_REGEXP})\z/.freeze
31
31
 
32
32
  #----------------------------------------------------------------
33
33
  # Parsing
@@ -6,12 +6,12 @@ module Songbooks
6
6
  # CONSTANTS
7
7
  #----------------------------------------------------------------
8
8
 
9
- EMPTY_LINE_REGEXP = /\A\s*\r?\n/
9
+ EMPTY_LINE_REGEXP = /\A\s*\r?\n/.freeze
10
10
 
11
11
  REGEXPS = {
12
12
  :title => /\A@title\s*\r?\n?([^\n\r]+)/,
13
13
  :artist => /\A@artist\s*\r?\n?([^\n\r]+)/,
14
- }
14
+ }.freeze
15
15
 
16
16
  #----------------------------------------------------------------
17
17
  # Parsing
@@ -9,7 +9,7 @@ module Songbooks
9
9
  # CONSTANTS
10
10
  #----------------------------------------------------------------
11
11
 
12
- REGEXP = /^##\s*(.*)$/
12
+ REGEXP = /^##\s*(.*)$/.freeze
13
13
 
14
14
  #----------------------------------------------------------------
15
15
  # Parsing
@@ -1,3 +1,3 @@
1
1
  module Songbooks
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: songbooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Exner
@@ -309,7 +309,6 @@ files:
309
309
  - app/views/songs/show.jbuilder
310
310
  - app/views/songs/song.haml
311
311
  - exe/sb_server
312
- - lib/prawn_ext/font/afm.rb
313
312
  - lib/songbooks.rb
314
313
  - lib/songbooks/CLI.rb
315
314
  - lib/songbooks/components/chord.rb
@@ -1,20 +0,0 @@
1
- # class Prawn::Font::AFM
2
- # # Patch normalize_encoding method to handle conversion more gracefully.
3
- # #
4
- # # Any valid utf-8 characters that cannot be encoded to windows-1252 are
5
- # # replaced with the logic "not" symbol and a warning is issued identifying
6
- # # the text that cannot be converted.
7
- # def normalize_encoding(text)
8
- # text.encode('utf-8')
9
- # #text.encode 'windows-1252'
10
- # rescue ::Encoding::UndefinedConversionError
11
- # warn 'The following text could not be fully converted to the Windows-1252 character set:'
12
- # warn %(#{text.gsub(/^/, '| ').rstrip})
13
- # warn ''
14
- # text.encode 'windows-1252', undef: :replace, invalid: :replace, replace: 'x'
15
- # rescue ::Encoding::InvalidByteSequenceError
16
- # raise Prawn::Errors::IncompatibleStringEncoding,
17
- # %(Your document includes text that's not compatible with the Windows-1252 character set.
18
- # If you need full UTF-8 support, use TTF fonts instead of PDF's built-in (AFM) fonts\n.)
19
- # end
20
- # end