fret_viewer 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6e9193ce02a380783603449cbd0b59ce5f2a0f311af9ab354614259da7cbfff4
4
+ data.tar.gz: 2265aa3cbf6d23bdaa9d870b12d3075efa6b6ee7361a214775e32ea9368510df
5
+ SHA512:
6
+ metadata.gz: 828128e2a5d422a4c4e15a487a512183bfdb21dab042eed4ddf02a0ee173008394367aaecb58bda5258000c68587313c7e4485bf34566a21775828c405a90675
7
+ data.tar.gz: 222bd3b45f16048442ac33c52cbd866b4781b8cc0279cda4d007c85baf4da0e98ffd67b7d46fd4d7ed2b8097aa2a261a56d9c683ed9d880cc20c86985bcad7c4
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ patreon: tomtt
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
+ # uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
28
+ with:
29
+ ruby-version: 2.6
30
+ - name: Install dependencies
31
+ run: bundle install
32
+ - name: Run tests
33
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ Gemfile.lock
13
+ dummy
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format progress
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,18 @@
1
+ Layout/LineLength:
2
+ Max: 120
3
+ Style/Documentation:
4
+ Enabled: false
5
+ Style/FrozenStringLiteralComment:
6
+ Enabled: false
7
+ Style/StringLiterals:
8
+ Enabled: false
9
+ Style/BlockDelimiters:
10
+ EnforcedStyle: semantic
11
+ Layout/SpaceInsideHashLiteralBraces:
12
+ EnforcedStyle: no_space
13
+ AllCops:
14
+ TargetRubyVersion: 2.4.0
15
+ NewCops: enable
16
+ Metrics/BlockLength:
17
+ Exclude:
18
+ - 'spec/**/*_spec.rb'
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.2
6
+ before_install: gem install bundler -v 2.1.4
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at tom.tenthij@fuga.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in fret_viewer.gemspec
4
+ gemspec
5
+
6
+ gem "guard-rspec"
7
+ gem "pry-byebug"
8
+ gem "rake", "~> 12.0"
9
+ gem "rspec", "~> 3.10.0"
10
+ gem "simplecov"
11
+ gem "solargraph"
12
+ gem "standard"
data/Guardfile ADDED
@@ -0,0 +1,6 @@
1
+ guard :rspec, cmd: "rspec", failed_mode: :keep do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^spec/support/(.+)\.rb$})
4
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
5
+ watch("spec/spec_helper.rb") { "spec" }
6
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Tom ten Thij
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.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # FretViewer
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/fret_viewer`. 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 'fret_viewer'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install fret_viewer
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. Then, run `rake spec` to run the tests. 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 the created tag, 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/tomtt/fret_viewer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/tomtt/fret_viewer/blob/master/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the FretViewer project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/tomtt/fret_viewer/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fret_viewer"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/fret_viewer ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # This script can only be run from elsewhere if BUNDLE_GEMFILE of this project
3
+ # has been set.
4
+
5
+ require "fret_viewer"
6
+ FretViewer::Shell.run(ARGV, out: $stdout, err: $stderr) do |options|
7
+ FretViewer::DoSomething.new(options, out: $stdout, err: $stderr).show
8
+ end
@@ -0,0 +1,24 @@
1
+ require_relative "lib/fret_viewer/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "fret_viewer"
5
+ spec.version = FretViewer::VERSION
6
+ spec.authors = ["Tom ten Thij"]
7
+ spec.email = ["code@tomtenthij.nl"]
8
+
9
+ spec.summary = "A skeleton to start a gem from"
10
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
11
+
12
+ # Specify which files should be added to the gem when it is released.
13
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
14
+ spec.files = Dir.chdir(File.expand_path(__dir__)) {
15
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ # Just an example dependency using in example DoSomething class
22
+ spec.add_dependency("curses")
23
+ spec.add_dependency("zeitwerk")
24
+ end
@@ -0,0 +1,200 @@
1
+ require "curses"
2
+ require "pry-byebug"
3
+ Encoding.default_external = "UTF-8"
4
+ module FretViewer
5
+
6
+ NOTES = {
7
+ sharp: ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"],
8
+ flat: ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"],
9
+ fsharp: ["C", "C#", "D", "D#", "E", "E#", "F#", "G", "G#", "A", "A#", "B"]
10
+ }
11
+ SHARP_FLAT_MAP = {
12
+ "C" => :sharp,
13
+ "C#" => :sharp,
14
+ "D" => :sharp,
15
+ "D#" => :flat,
16
+ "E" => :sharp,
17
+ "F" => :flat,
18
+ "F#" => :fsharp,
19
+ "G" => :sharp,
20
+ "G#" => :flat,
21
+ "A" => :sharp,
22
+ "A#" => :flat,
23
+ "B" => :sharp
24
+ }
25
+ ROMAN = {
26
+ 1 => "I",
27
+ 2 => "II",
28
+ 3 => "III",
29
+ 4 => "IV",
30
+ 5 => "V",
31
+ 6 => "VI",
32
+ 7 => "VII"
33
+ }
34
+
35
+ STRINGS = ["E", "A", "D", "G", "B", "E"]
36
+
37
+ class DoSomething
38
+ include Curses
39
+
40
+ def initialize(options, out: stdout, err: stderr)
41
+ @options = options
42
+ @out = out
43
+ @err = err
44
+ end
45
+
46
+ def note_on_string(note)
47
+ return note if note.size == 2
48
+
49
+ "#{note}-"
50
+ end
51
+
52
+ def show_string(string_note, root_note:, scale:, flat_or_sharp: :sharp)
53
+ # result = "#{note_on_string(string_note)}-||"
54
+ result = ""
55
+ note_index_of_string_note = NOTES[:sharp].index string_note
56
+ note_index_of_root_note = NOTES[:sharp].index root_note
57
+ (0..12).each_with_index do |fret, index|
58
+ fret_end = index.zero? ? '||' : '-|'
59
+ index_of_note_on_this_fret = (note_index_of_string_note + fret) % 12
60
+ if scale.include?((index_of_note_on_this_fret - note_index_of_root_note) % 12)
61
+ result += "-#{note_on_string(NOTES[flat_or_sharp][index_of_note_on_this_fret])}#{fret_end}"
62
+ else
63
+ result += "---#{fret_end}"
64
+ end
65
+ end
66
+ result
67
+ end
68
+
69
+ def show
70
+ root_note = @options[:key].upcase
71
+ unless NOTES[:sharp].include? root_note
72
+ puts "Note #{@options[:key]} not recognized yet"
73
+ exit 1
74
+ end
75
+
76
+ full_scale = [0, 2, 4, 5, 7, 9, 11]
77
+ chords = {
78
+ "a" => {
79
+ scale: [ 0, 4, 7],
80
+ label: ''
81
+ },
82
+ "s" => {
83
+ scale: [ 2, 5, 9],
84
+ label: 'm'
85
+ },
86
+ "d" => {
87
+ scale: [ 4, 7,11],
88
+ label: 'm'
89
+ },
90
+ "f" => {
91
+ scale: [ 5, 9, 0],
92
+ label: ''
93
+ },
94
+ "g" => {
95
+ scale: [ 7,11, 2],
96
+ label: ''
97
+ },
98
+ "h" => {
99
+ scale: [ 9, 0, 4],
100
+ label: 'm'
101
+ },
102
+ "j" => {
103
+ scale: [11, 2, 5],
104
+ label: '0'
105
+ },
106
+ "q" => {
107
+ scale: [ 0, 4, 7,11],
108
+ label: 'maj7'
109
+ },
110
+ "w" => {
111
+ scale: [ 2, 5, 9, 0],
112
+ label: 'm7'
113
+ },
114
+ "e" => {
115
+ scale: [ 4, 7,11, 2],
116
+ label: 'm7'
117
+ },
118
+ "r" => {
119
+ scale: [ 5, 9, 0, 4],
120
+ label: 'maj7'
121
+ },
122
+ "t" => {
123
+ scale: [ 7,11, 2, 5],
124
+ label: '7'
125
+ },
126
+ "y" => {
127
+ scale: [ 9, 0, 4, 7],
128
+ label: 'm7'
129
+ },
130
+ "u" => {
131
+ scale: [11, 2, 5, 9],
132
+ label: 'o'
133
+ },
134
+ "1" => {
135
+ scale: [0, 2, 4, 7, 9],
136
+ label: ' M pent'
137
+ },
138
+ "2" => {
139
+ scale: [0, 2, 5, 7, 9],
140
+ label: ' m pent'
141
+ },
142
+ "3" => {
143
+ scale: [2, 4, 7, 9, 11],
144
+ label: ' m pent'
145
+ },
146
+ }
147
+ note_index_of_root_note = NOTES[:sharp].index root_note
148
+ key_name = root_note
149
+
150
+ init_screen
151
+ begin
152
+ crmode
153
+
154
+ input_key = nil
155
+ input_to_show = " "
156
+
157
+ until input_key == ' ' do
158
+ if input_key == input_to_show && chords.keys.include?(input_key)
159
+ input_key = 'p' # toggle between chord and full scale
160
+ end
161
+ if input_key == 'z'
162
+ note_index_of_root_note = (note_index_of_root_note + 5) % 12
163
+ elsif input_key == 'x'
164
+ note_index_of_root_note = (note_index_of_root_note - 5) % 12
165
+ else
166
+ input_to_show = input_key
167
+ end
168
+
169
+ root_note = NOTES[:sharp][note_index_of_root_note]
170
+ chord = chords[input_to_show]
171
+ scale = chord && chord[:scale] || full_scale
172
+ note_name = NOTES[:sharp][(scale[0] + note_index_of_root_note) % 12]
173
+ flat_or_sharp = SHARP_FLAT_MAP[note_name]
174
+ note_name_human = NOTES[flat_or_sharp][(scale[0] + note_index_of_root_note) % 12]
175
+ root_note_human = NOTES[flat_or_sharp][note_index_of_root_note]
176
+ label = chord && "#{note_name_human}#{chord[:label]}" || "#{root_note_human} major"
177
+ refresh
178
+ STRINGS.reverse.each_with_index do |s, index|
179
+ setpos(index,0)
180
+ addstr(show_string(s, root_note:, scale:, flat_or_sharp:))
181
+ end
182
+ setpos(6,0)
183
+ if chords.keys.include?(input_to_show)
184
+ chord_num = ['a', 's', 'd', 'f', 'g', 'h', 'j', 'q', 'w', 'e', 'r', 't', 'y', 'u', '1', '2', '3'].index(input_to_show) % 7 + 1
185
+ roman = ROMAN[chord_num]
186
+ addstr("Chord: #{label} (#{roman}#{chord[:label]})#{" " * 40}")
187
+ else
188
+ addstr("Scale: #{label}#{" " * 40}")
189
+ end
190
+ setpos(7,0)
191
+ addstr("Key: #{root_note_human} ")
192
+ setpos(8,0)
193
+ input_key = getch
194
+ end
195
+ ensure
196
+ close_screen
197
+ end
198
+ end
199
+ end
200
+ end
@@ -0,0 +1,47 @@
1
+ require "optparse"
2
+
3
+ module FretViewer
4
+ class Shell
5
+ BANNER = <<~"MSG".freeze
6
+ usage: #{$PROGRAM_NAME} [key]
7
+
8
+ Show a guitar fretboard in the specified key
9
+ MSG
10
+
11
+ def self.usage(err: $stderr)
12
+ err.puts BANNER
13
+ exit 1
14
+ end
15
+
16
+ def self.run(argv, out: $stdout, err: $stderr)
17
+ options = gather_options(argv)
18
+
19
+ out.puts "version: #{FretViewer::VERSION}" if options.delete(:show_version)
20
+
21
+ options[:key] = argv[0] || "C"
22
+
23
+ yield(options)
24
+ end
25
+
26
+ def self.gather_options(argv) # rubocop:disable Metrics/MethodLength
27
+ options = {
28
+ show_version: false
29
+ }
30
+
31
+ OptionParser.new { |parser|
32
+ parser.banner = BANNER
33
+
34
+ parser.on("-v", "--version", "Show version") do |version|
35
+ options[:show_version] = version
36
+ end
37
+
38
+ parser.on("-h", "--help", "Prints this help") do
39
+ puts parser
40
+ exit
41
+ end
42
+ }.parse! argv
43
+
44
+ options
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ module FretViewer
2
+ VERSION = "0.0.3".freeze
3
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ Encoding.default_external = "UTF-8"
4
+
5
+ require "fret_viewer/version"
6
+ require "zeitwerk"
7
+
8
+ module FretViewer
9
+ class << self
10
+ attr_reader :loader
11
+
12
+ def root
13
+ Pathname.new(File.absolute_path(File.join(File.dirname(__FILE__), "..")))
14
+ end
15
+
16
+ def setup_loader
17
+ @loader = Zeitwerk::Loader.for_gem
18
+ @loader.enable_reloading
19
+ # @loader.push_dir(ActiveCore.root.join("non-lib/code_dir"))
20
+ @loader.setup
21
+ @loader.eager_load
22
+ end
23
+ end
24
+ end
25
+
26
+ FretViewer.setup_loader
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fret_viewer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Tom ten Thij
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: curses
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: zeitwerk
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ email:
41
+ - code@tomtenthij.nl
42
+ executables:
43
+ - fret_viewer
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".github/FUNDING.yml"
48
+ - ".github/workflows/ruby.yml"
49
+ - ".gitignore"
50
+ - ".rspec"
51
+ - ".rubocop.yml"
52
+ - ".travis.yml"
53
+ - CODE_OF_CONDUCT.md
54
+ - Gemfile
55
+ - Guardfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - bin/console
60
+ - bin/setup
61
+ - exe/fret_viewer
62
+ - fret_viewer.gemspec
63
+ - lib/fret_viewer.rb
64
+ - lib/fret_viewer/do_something.rb
65
+ - lib/fret_viewer/shell.rb
66
+ - lib/fret_viewer/version.rb
67
+ licenses: []
68
+ metadata: {}
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 2.4.0
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubygems_version: 3.6.8
84
+ specification_version: 4
85
+ summary: A skeleton to start a gem from
86
+ test_files: []