coltrane 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.bundle/config +2 -0
  3. data/.rspec +2 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +17 -0
  6. data/Gemfile.lock +164 -0
  7. data/Guardfile +71 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +41 -0
  10. data/Rakefile +6 -0
  11. data/bin/_guard-core +17 -0
  12. data/bin/bundler +17 -0
  13. data/bin/coderay +17 -0
  14. data/bin/coltrane +11 -0
  15. data/bin/console +14 -0
  16. data/bin/erubis +17 -0
  17. data/bin/guard +17 -0
  18. data/bin/htmldiff +17 -0
  19. data/bin/kill-pry-rescue +17 -0
  20. data/bin/ldiff +17 -0
  21. data/bin/listen +17 -0
  22. data/bin/nokogiri +17 -0
  23. data/bin/pry +17 -0
  24. data/bin/rackup +17 -0
  25. data/bin/rails +17 -0
  26. data/bin/rake +17 -0
  27. data/bin/rdoc +17 -0
  28. data/bin/rescue +17 -0
  29. data/bin/ri +17 -0
  30. data/bin/rspec +17 -0
  31. data/bin/rubocop +17 -0
  32. data/bin/ruby-parse +17 -0
  33. data/bin/ruby-rewrite +17 -0
  34. data/bin/setup +8 -0
  35. data/bin/sprockets +17 -0
  36. data/bin/thor +17 -0
  37. data/bin/tilt +17 -0
  38. data/coltrane.gemspec +35 -0
  39. data/db/cache.sqlite3 +0 -0
  40. data/db/cache_test.sqlite3 +0 -0
  41. data/db/config.yml +11 -0
  42. data/db/schema.rb +30 -0
  43. data/lib/coltrane.rb +48 -0
  44. data/lib/coltrane/cadence.rb +4 -0
  45. data/lib/coltrane/chord.rb +81 -0
  46. data/lib/coltrane/chord_cache.rb +4 -0
  47. data/lib/coltrane/chord_quality.rb +48 -0
  48. data/lib/coltrane/classic_scales.rb +134 -0
  49. data/lib/coltrane/essential_guitar_chords.rb +82 -0
  50. data/lib/coltrane/fret_set.rb +0 -0
  51. data/lib/coltrane/guitar.rb +15 -0
  52. data/lib/coltrane/guitar_chord.rb +50 -0
  53. data/lib/coltrane/guitar_chord_finder.rb +98 -0
  54. data/lib/coltrane/guitar_note.rb +50 -0
  55. data/lib/coltrane/guitar_note_set.rb +61 -0
  56. data/lib/coltrane/guitar_representation.rb +96 -0
  57. data/lib/coltrane/guitar_string.rb +52 -0
  58. data/lib/coltrane/interval.rb +33 -0
  59. data/lib/coltrane/interval_sequence.rb +70 -0
  60. data/lib/coltrane/interval_set.rb +23 -0
  61. data/lib/coltrane/mode.rb +0 -0
  62. data/lib/coltrane/note.rb +98 -0
  63. data/lib/coltrane/note_set.rb +50 -0
  64. data/lib/coltrane/piano_representation.rb +58 -0
  65. data/lib/coltrane/pitch.rb +27 -0
  66. data/lib/coltrane/progression.rb +4 -0
  67. data/lib/coltrane/qualities.rb +115 -0
  68. data/lib/coltrane/scale.rb +139 -0
  69. data/lib/coltrane/scale_cache.rb +4 -0
  70. data/lib/coltrane/scale_chord.rb +4 -0
  71. data/lib/coltrane/version.rb +3 -0
  72. metadata +144 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0d89db41e5429721884671402e8cf17f2b25c461
4
+ data.tar.gz: 2d17e5909962dd7c1c737f55cb216bd426602311
5
+ SHA512:
6
+ metadata.gz: 2717d0aa492aefc42486ec1548aab3d7ad1c4ac236c33f26201d9bd19b29357681da70acd721b4c05455852a1fd9192550a47e05e1f8c805a65855ecdbd5bc17
7
+ data.tar.gz: eeee10c3e63d7bc8b94d11b4f1cbf4adac076b375d7bc800bc4b43b56b416ed5dcb10c012a65c07798a5d0971d7754f876e51268c989c6752d64148d6e30b1e1
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_BIN: "bin"
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at pedrozath@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'sqlite3'
6
+ gem 'standalone_migrations', '5.2.0'
7
+
8
+ gem 'guard'
9
+ gem 'guard-rspec'
10
+ gem 'paint'
11
+ gem 'pry'
12
+ gem 'pry-stack_explorer'
13
+ gem 'pry-rescue'
14
+ gem 'rspec'
15
+ gem 'rubocop', require: false
16
+
17
+ gemspec
@@ -0,0 +1,164 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ coltrane (0.0.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actionpack (5.1.0)
10
+ actionview (= 5.1.0)
11
+ activesupport (= 5.1.0)
12
+ rack (~> 2.0)
13
+ rack-test (~> 0.6.3)
14
+ rails-dom-testing (~> 2.0)
15
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
16
+ actionview (5.1.0)
17
+ activesupport (= 5.1.0)
18
+ builder (~> 3.1)
19
+ erubi (~> 1.4)
20
+ rails-dom-testing (~> 2.0)
21
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
22
+ activemodel (5.1.0)
23
+ activesupport (= 5.1.0)
24
+ activerecord (5.1.0)
25
+ activemodel (= 5.1.0)
26
+ activesupport (= 5.1.0)
27
+ arel (~> 8.0)
28
+ activesupport (5.1.0)
29
+ concurrent-ruby (~> 1.0, >= 1.0.2)
30
+ i18n (~> 0.7)
31
+ minitest (~> 5.1)
32
+ tzinfo (~> 1.1)
33
+ arel (8.0.0)
34
+ ast (2.3.0)
35
+ binding_of_caller (0.7.2)
36
+ debug_inspector (>= 0.0.1)
37
+ builder (3.2.3)
38
+ coderay (1.1.1)
39
+ concurrent-ruby (1.0.5)
40
+ debug_inspector (0.0.2)
41
+ diff-lcs (1.3)
42
+ erubi (1.6.0)
43
+ ffi (1.9.18)
44
+ formatador (0.2.5)
45
+ guard (2.14.1)
46
+ formatador (>= 0.2.4)
47
+ listen (>= 2.7, < 4.0)
48
+ lumberjack (~> 1.0)
49
+ nenv (~> 0.1)
50
+ notiffany (~> 0.0)
51
+ pry (>= 0.9.12)
52
+ shellany (~> 0.0)
53
+ thor (>= 0.18.1)
54
+ guard-compat (1.2.1)
55
+ guard-rspec (4.7.3)
56
+ guard (~> 2.1)
57
+ guard-compat (~> 1.1)
58
+ rspec (>= 2.99.0, < 4.0)
59
+ i18n (0.8.1)
60
+ interception (0.5)
61
+ listen (3.1.5)
62
+ rb-fsevent (~> 0.9, >= 0.9.4)
63
+ rb-inotify (~> 0.9, >= 0.9.7)
64
+ ruby_dep (~> 1.2)
65
+ loofah (2.0.3)
66
+ nokogiri (>= 1.5.9)
67
+ lumberjack (1.0.11)
68
+ method_source (0.8.2)
69
+ mini_portile2 (2.1.0)
70
+ minitest (5.10.1)
71
+ nenv (0.3.0)
72
+ nokogiri (1.7.1)
73
+ mini_portile2 (~> 2.1.0)
74
+ notiffany (0.1.1)
75
+ nenv (~> 0.1)
76
+ shellany (~> 0.0)
77
+ paint (2.0.0)
78
+ parser (2.4.0.0)
79
+ ast (~> 2.2)
80
+ powerpack (0.1.1)
81
+ pry (0.10.4)
82
+ coderay (~> 1.1.0)
83
+ method_source (~> 0.8.1)
84
+ slop (~> 3.4)
85
+ pry-rescue (1.4.5)
86
+ interception (>= 0.5)
87
+ pry
88
+ pry-stack_explorer (0.4.9.2)
89
+ binding_of_caller (>= 0.7)
90
+ pry (>= 0.9.11)
91
+ rack (2.0.1)
92
+ rack-test (0.6.3)
93
+ rack (>= 1.0)
94
+ rails-dom-testing (2.0.2)
95
+ activesupport (>= 4.2.0, < 6.0)
96
+ nokogiri (~> 1.6)
97
+ rails-html-sanitizer (1.0.3)
98
+ loofah (~> 2.0)
99
+ railties (5.1.0)
100
+ actionpack (= 5.1.0)
101
+ activesupport (= 5.1.0)
102
+ method_source
103
+ rake (>= 0.8.7)
104
+ thor (>= 0.18.1, < 2.0)
105
+ rainbow (2.2.2)
106
+ rake
107
+ rake (10.5.0)
108
+ rb-fsevent (0.9.8)
109
+ rb-inotify (0.9.8)
110
+ ffi (>= 0.5.0)
111
+ rspec (3.6.0)
112
+ rspec-core (~> 3.6.0)
113
+ rspec-expectations (~> 3.6.0)
114
+ rspec-mocks (~> 3.6.0)
115
+ rspec-core (3.6.0)
116
+ rspec-support (~> 3.6.0)
117
+ rspec-expectations (3.6.0)
118
+ diff-lcs (>= 1.2.0, < 2.0)
119
+ rspec-support (~> 3.6.0)
120
+ rspec-mocks (3.6.0)
121
+ diff-lcs (>= 1.2.0, < 2.0)
122
+ rspec-support (~> 3.6.0)
123
+ rspec-support (3.6.0)
124
+ rubocop (0.48.1)
125
+ parser (>= 2.3.3.1, < 3.0)
126
+ powerpack (~> 0.1)
127
+ rainbow (>= 1.99.1, < 3.0)
128
+ ruby-progressbar (~> 1.7)
129
+ unicode-display_width (~> 1.0, >= 1.0.1)
130
+ ruby-progressbar (1.8.1)
131
+ ruby_dep (1.5.0)
132
+ shellany (0.0.1)
133
+ slop (3.6.0)
134
+ sqlite3 (1.3.13)
135
+ standalone_migrations (5.2.0)
136
+ activerecord (>= 4.2.7, < 5.2.0)
137
+ railties (>= 4.2.7, < 5.2.0)
138
+ rake (~> 10.0)
139
+ thor (0.19.4)
140
+ thread_safe (0.3.6)
141
+ tzinfo (1.2.3)
142
+ thread_safe (~> 0.1)
143
+ unicode-display_width (1.2.1)
144
+
145
+ PLATFORMS
146
+ ruby
147
+
148
+ DEPENDENCIES
149
+ bundler (~> 1.14)
150
+ coltrane!
151
+ guard
152
+ guard-rspec
153
+ paint
154
+ pry
155
+ pry-rescue
156
+ pry-stack_explorer
157
+ rake (~> 10.0)
158
+ rspec
159
+ rubocop
160
+ sqlite3
161
+ standalone_migrations (= 5.2.0)
162
+
163
+ BUNDLED WITH
164
+ 1.15.0
@@ -0,0 +1,71 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ # rubocop:disable Metrics/BlockLength
28
+ guard :rspec, cmd: 'bundle exec rspec' do
29
+ require 'guard/rspec/dsl'
30
+ dsl = Guard::RSpec::Dsl.new(self)
31
+
32
+ # Feel free to open issues for suggestions and improvements
33
+
34
+ # RSpec files
35
+ rspec = dsl.rspec
36
+ watch(rspec.spec_helper) { rspec.spec_dir }
37
+ watch(rspec.spec_support) { rspec.spec_dir }
38
+ watch(rspec.spec_files)
39
+
40
+ # Ruby files
41
+ ruby = dsl.ruby
42
+ dsl.watch_spec_files_for(ruby.lib_files)
43
+
44
+ # Rails files
45
+ rails = dsl.rails(view_extensions: %w[erb haml slim])
46
+ dsl.watch_spec_files_for(rails.app_files)
47
+ dsl.watch_spec_files_for(rails.views)
48
+
49
+ watch(rails.controllers) do |m|
50
+ [
51
+ rspec.spec.call("routing/#{m[1]}_routing"),
52
+ rspec.spec.call("controllers/#{m[1]}_controller"),
53
+ rspec.spec.call("acceptance/#{m[1]}")
54
+ ]
55
+ end
56
+
57
+ # Rails config changes
58
+ watch(rails.spec_helper) { rspec.spec_dir }
59
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
60
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
61
+
62
+ # Capybara features specs
63
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
64
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
65
+
66
+ # Turnip features and steps
67
+ watch(%r{^spec/acceptance/(.+)\.feature$})
68
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
69
+ Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
70
+ end
71
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Pedro Maciel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Coltrane
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/coltrane`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'coltrane'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install coltrane
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/coltrane. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
@@ -0,0 +1,6 @@
1
+ ENV['RAILS_ENV'] = 'production'
2
+ ENV['DISABLE_DATABASE_ENVIRONMENT_CHECK'] = '1'
3
+ require 'standalone_migrations'
4
+ StandaloneMigrations::Tasks.load_tasks
5
+ require "bundler/gem_tasks"
6
+ task :default => :spec
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application '_guard-core' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("guard", "_guard-core")
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'bundler' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("bundler", "bundler")