pondize 0.0.1 → 0.0.3

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: fecb15a50eb9e673a140a9554e7965607d5c9c98
4
- data.tar.gz: c71b63c4544298c20092b7199755406555c55eba
3
+ metadata.gz: 94a6e882418c97ebef5651980f1b7a9f35b4f5f2
4
+ data.tar.gz: bd86a9e29aba302a0c99e90d7d8f8d83d8dd7f4f
5
5
  SHA512:
6
- metadata.gz: c9686308e16995ad8c6d9540774ebc9effade0a7b3b9e1769c1e5136261a62219c35cf39bf9e1d3ef4681ec27112ca9f949d3fc89ea7223cd0c41f03e906152e
7
- data.tar.gz: 8f6c1fbc29b307caf53bfdc5b265cec044db0710355bfdf03a5f0ea9c55ab562b988591bb28c75b55c4b6c914f77a3042062d21a9013deee261f7de234f1c2b4
6
+ metadata.gz: 36c1726e588aaacdbe743e221d2726d6f246db74f85ec09f452762e4853c6cd6aaf1108c38094e2836c5a90eea8a08f73ce0334173edd34b867f4585fd44a11f
7
+ data.tar.gz: c9dce1767870a20c78b324e6e1e3d56941f4a399b850d7473e34d3c0ab9c0dbc1eeb887706c52ad27515e884f048e585936274a1ab912095e68ab41ad70287cb
data/README.md CHANGED
@@ -5,11 +5,11 @@ Appends flats and sharps based on given key.
5
5
 
6
6
  # Installation
7
7
 
8
- make
8
+ gem install pondize
9
9
 
10
10
  # Usage
11
11
 
12
- pondize.rb <key> <lilypondlike string>
12
+ pondize <key> <lilypondlike string>
13
13
 
14
14
  ## Key
15
15
 
@@ -19,6 +19,6 @@ Negative number means number of flats.
19
19
 
20
20
  ## Examples
21
21
 
22
- pondize.rb -2 "g16edc"
22
+ pondize -2 "g16edc"
23
23
 
24
- pondize.rb 4 "g16e8a16|a4"
24
+ pondize 4 "g16e8a16|a4"
@@ -1,11 +1,6 @@
1
1
  module Pondize
2
2
  class Runner
3
- CIRCLE = "fcgdaeb"
4
-
5
- ACCIDENTALS = ['l', 'n', 's']
6
-
7
- OCTAVES = [",", "'"]
8
-
3
+ require 'converter'
9
4
  def start
10
5
  if ARGV.length != 2
11
6
  puts '2 arguments are needed tonality (-7..7) and string'
@@ -14,32 +9,7 @@ module Pondize
14
9
 
15
10
  key_signature= ARGV.first.to_i
16
11
 
17
- notes_to_change = []
18
- if key_signature > 0
19
- notes_to_change = CIRCLE[0...key_signature]
20
- change_to = 's'
21
- end
22
-
23
- if key_signature < 0
24
- notes_to_change = CIRCLE[key_signature..-1]
25
- change_to = 'l'
26
- end
27
-
28
- p notes_to_change
29
-
30
- puts ARGV
31
- .last
32
- .each_char
33
- .map
34
- .with_index { |char, index| (notes_to_change.include?(char) && !ACCIDENTALS.include?(ARGV.last[index + 1]) ) ? "#{char}#{change_to}" : char }
35
- .map.with_index { |char, index| (ACCIDENTALS + OCTAVES).include?(ARGV.last[index + 1]) ? char : "#{char} " }
36
- .join('')
37
- .gsub('n', '')
38
- .gsub(/ (\d)/, '\1')
39
- .gsub('< <', '<<')
40
- .gsub('> >', '>>')
41
- .gsub(' .', '.')
42
- .gsub('l', 'f')
12
+ puts Converter.new(key_signature, ARGV.last).pondize
43
13
  end
44
14
  end
45
15
  end
@@ -1,3 +1,3 @@
1
1
  module Pondize
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/pondize.rb CHANGED
@@ -2,4 +2,5 @@ require "pondize/version"
2
2
 
3
3
  module Pondize
4
4
  autoload :Runner, 'pondize/runner'
5
+ autoload :Converter, 'pondize/converter'
5
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pondize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Tokarski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -33,7 +33,6 @@ extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
35
  - Gemfile
36
- - Makefile
37
36
  - README.md
38
37
  - bin/pondize
39
38
  - lib/pondize.rb
@@ -59,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
58
  version: '0'
60
59
  requirements: []
61
60
  rubyforge_project:
62
- rubygems_version: 2.4.5
61
+ rubygems_version: 2.4.8
63
62
  signing_key:
64
63
  specification_version: 4
65
64
  summary: Appends flats and sharps based on given key.
data/Makefile DELETED
@@ -1,4 +0,0 @@
1
- install:
2
- cp pondize.rb ~/bin
3
-
4
- .PHONY: install