pondize 0.0.1 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/pondize/runner.rb +2 -32
- data/lib/pondize/version.rb +1 -1
- data/lib/pondize.rb +1 -0
- metadata +3 -4
- data/Makefile +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94a6e882418c97ebef5651980f1b7a9f35b4f5f2
|
4
|
+
data.tar.gz: bd86a9e29aba302a0c99e90d7d8f8d83d8dd7f4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
8
|
+
gem install pondize
|
9
9
|
|
10
10
|
# Usage
|
11
11
|
|
12
|
-
pondize
|
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
|
22
|
+
pondize -2 "g16edc"
|
23
23
|
|
24
|
-
pondize
|
24
|
+
pondize 4 "g16e8a16|a4"
|
data/lib/pondize/runner.rb
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
module Pondize
|
2
2
|
class Runner
|
3
|
-
|
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
|
-
|
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
|
data/lib/pondize/version.rb
CHANGED
data/lib/pondize.rb
CHANGED
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.
|
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-
|
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.
|
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