spell_craft 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 337df1b211ee709a6ce91e2ffdeb96301c2aa9453e2a141da3435673d0c3b3da
4
+ data.tar.gz: d533542e00a753c14d70678bd732a66cc5354a2550babce1b3830c64d8c0f86a
5
+ SHA512:
6
+ metadata.gz: 8d7efc88b0a6f666e66f83ebf80a7541b8a837e007c7c2cc3f97df638c5a95dd0b57c182ebc3d3b0db8bd89119e2480d53f7ccb941ea226f1544c22e85788fe4
7
+ data.tar.gz: 391c4897bdcfd0b3a5311af8e8b57fb51208b15e6fbc9ff56c34294417678bbf50799ed68fec89572c177af3b7d85b944a30cb6a80805ab5bcbe987ad12e7d05
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2023 dry-rb team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # Spell craft
2
+
3
+ The goal for this project is to provide a CLI that facilite boilerplate generation on ruby projects such as:
4
+
5
+ 1. Adding or removing support for REPL (IRB or pry)
6
+ 2. Adding or removing support for tests (RSpec, Minitest)
7
+ 3. Adding or removing auto loading/requiring (using zeitwerk)
8
+
9
+ In the future, this project should enable configuration of [dry-rb](https://dry-rb.org) related gems such as *dry-system*, *dry-cli*, etc...
10
+
11
+ ## Commands
12
+
13
+ - [ ] `add`: A branch to add configurations
14
+ - [ ] `repl`: This command should prompt to choose from IRB or pry and add correct configuration to `bin/console`, for pry it should install common extensions like pry reload and pry rescue.
15
+ - [ ] `autoload`: This command should add the configuration necessary to use zeitwerk on the current project.
16
+ - [ ] `remove`: A branch to remove configurations
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ require 'zeitwerk'
5
+ require 'pathname'
6
+
7
+ root = Pathname('.')
8
+
9
+ loader = Zeitwerk::Loader.new
10
+
11
+ loader.push_dir(root.join('lib').realpath)
12
+ loader.push_dir(root.join('config').realpath)
13
+
14
+ loader.setup
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ module Cmd
5
+ module Add
6
+ class Repl < Dry::CLI::Command
7
+ extend T::Sig
8
+
9
+ desc 'Allow adding configuration for REPL support on the current application, being either pry or irb'
10
+
11
+ option :irb, type: :boolean, default: true,
12
+ desc: '(This is the default): Enable the code generator to assume IRB as the REPL of choice'
13
+ option :pry, type: :boolean, default: false,
14
+ desc: 'Enable the code generator to assume Pry as the REPL of choice'
15
+
16
+ def call(irb:, pry:)
17
+ install_deps if pry
18
+
19
+ puts 'Hello world'
20
+ end
21
+
22
+ private
23
+
24
+ sig { void }
25
+ def install_deps
26
+ puts 'installing deps'
27
+ end
28
+ end
29
+ end
30
+ end
data/lib/cmd/cli.rb ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ module Cmd
5
+ class Cli
6
+ extend Dry::CLI::Registry
7
+
8
+ register 'version', Version, aliases: ['v', '-v', '--version']
9
+ register 'add', aliases: ['a'] do |prefix|
10
+ prefix.register 'repl', Add::Repl
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ module Cmd
5
+ class Version < Dry::CLI::Command
6
+ desc 'Print version'
7
+
8
+ def call
9
+ puts '0.0.1'
10
+ end
11
+ end
12
+ end
data/main.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ require 'sorbet-runtime'
5
+ require "dry/cli"
6
+
7
+ require_relative 'config/application'
8
+
9
+ Dry::CLI.new(Cmd::Cli).call
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ config = File.expand_path('config', __dir__)
7
+ $LOAD_PATH.unshift(config) unless $LOAD_PATH.include?(config)
8
+
9
+ Gem::Specification.new do |spec|
10
+ spec.name = 'spell_craft'
11
+ spec.version = '0.1.0'
12
+ spec.summary = 'Yet another code generator to make you type less stuff'
13
+ spec.description = 'Yet another code generator to make you type less stuff'
14
+ spec.authors = ['Cherry Ramatis']
15
+ spec.homepage = 'https://github.com/cherryramatisdev/spell_craft.git'
16
+ spec.license = 'MIT'
17
+
18
+ spec.required_ruby_version = '>= 3.2.0'
19
+
20
+ spec.require_paths = ['lib']
21
+ spec.files = Dir['LICENSE', 'README.md', 'spell_craft.gemspec', 'main.rb', 'config/**/*', 'lib/**/*']
22
+
23
+ spec.add_dependency 'sorbet-runtime', '~> 0.5.11026'
24
+ spec.metadata['rubygems_mfa_required'] = 'true'
25
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spell_craft
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Cherry Ramatis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sorbet-runtime
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.11026
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.11026
27
+ description: Yet another code generator to make you type less stuff
28
+ email:
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE
34
+ - README.md
35
+ - config/application.rb
36
+ - lib/cmd/add/repl.rb
37
+ - lib/cmd/cli.rb
38
+ - lib/cmd/version.rb
39
+ - main.rb
40
+ - spell_craft.gemspec
41
+ homepage: https://github.com/cherryramatisdev/spell_craft.git
42
+ licenses:
43
+ - MIT
44
+ metadata:
45
+ rubygems_mfa_required: 'true'
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubygems_version: 3.4.18
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Yet another code generator to make you type less stuff
65
+ test_files: []