create-ruby-app 1.1.0 → 1.3.0
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/CHANGELOG.md +13 -0
- data/CLAUDE.md +74 -0
- data/CODE_REVIEW.md +1659 -0
- data/LICENSE +13 -21
- data/README.md +5 -5
- data/REFACTORING_PLAN.md +543 -0
- data/bin/create-ruby-app +1 -3
- data/lib/create_ruby_app/actions/create_directories.rb +10 -2
- data/lib/create_ruby_app/actions/generate_files.rb +7 -4
- data/lib/create_ruby_app/actions/install_gems.rb +10 -2
- data/lib/create_ruby_app/actions/make_script_executable.rb +10 -2
- data/lib/create_ruby_app/actions/set_ruby_implementation.rb +52 -0
- data/lib/create_ruby_app/app.rb +9 -8
- data/lib/create_ruby_app/cli.rb +58 -41
- data/lib/create_ruby_app/templates/Gemfile.erb +1 -3
- data/lib/create_ruby_app/templates/lib_file.erb +0 -2
- data/lib/create_ruby_app/templates/script_file.erb +0 -2
- data/lib/create_ruby_app/templates/spec_helper.erb +0 -2
- data/lib/create_ruby_app/version.rb +1 -3
- data/lib/create_ruby_app.rb +1 -3
- data/spec/integration/app_creation_spec.rb +170 -0
- data/spec/lib/create_ruby_app/actions/create_directories_spec.rb +1 -3
- data/spec/lib/create_ruby_app/actions/generate_files_spec.rb +13 -20
- data/spec/lib/create_ruby_app/actions/install_gems_spec.rb +1 -3
- data/spec/lib/create_ruby_app/actions/make_script_executable_spec.rb +1 -3
- data/spec/lib/create_ruby_app/actions/set_ruby_implementation_spec.rb +194 -0
- data/spec/lib/create_ruby_app/app_spec.rb +4 -4
- data/spec/lib/create_ruby_app/cli_spec.rb +112 -0
- data/spec/spec_helper.rb +6 -2
- metadata +52 -20
- data/lib/create_ruby_app/actions/null_action.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d20405b454bfa2076a2b9af3df3f6e0cd7f864df681bc6aeb55975779e32e41
|
4
|
+
data.tar.gz: 92cadf1af6d1f69721697279393ddadde6aa8382cc1b563be2700813a8bd4c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad20bf6ea501cc36c5e88f1fff6dfa7d367003976f9ebc2916b9cb0027a545951645e31eed7847ba0904ee000c12ede3e8d982c32f4263c60e7b7a07e0f38eb3
|
7
|
+
data.tar.gz: 88ad3c979c2be0ad4b3ada569ce34f3eb6ca540060920e1cbae39dd7765ac4c85f67896759e0e4ddf5f4df2aa50a88c7ef21a8124165dfe42d8cd276c487f217
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# 1.3.0
|
2
|
+
- Bump dependencies and Ruby version to 3.4.5.
|
3
|
+
- Read locally installed Ruby implementation and version (Ruby, TruffleRuby,
|
4
|
+
JRuby, MRuby, etc.) if none is found.
|
5
|
+
- Add integration tests.
|
6
|
+
- Add test coverage using
|
7
|
+
[SimpleCov](https://github.com/simplecov-ruby/simplecov).
|
8
|
+
- Replace [Thor](https://github.com/rails/thor) with
|
9
|
+
[`dry-cli`](https://github.com/dry-rb/dry-cli) for command-line interface.
|
10
|
+
|
11
|
+
# 1.2.0
|
12
|
+
- Bump Ruby version to 2.7.1.
|
13
|
+
|
1
14
|
# 1.1.0
|
2
15
|
- Disable monkey patching for RSpec.
|
3
16
|
- Bump Ruby version to 2.6.2.
|
data/CLAUDE.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# CLAUDE.md
|
2
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with
|
3
|
+
code in this repository.
|
4
|
+
|
5
|
+
## Project Overview
|
6
|
+
`create-ruby-app` is a CLI gem that scaffolds Ruby applications, similar to
|
7
|
+
Create React App but for Ruby. It generates minimal project structures for
|
8
|
+
non-Rails Ruby applications.
|
9
|
+
|
10
|
+
## Commands
|
11
|
+
### Testing
|
12
|
+
- `bundle exec rspec` - Run all tests
|
13
|
+
- `bundle exec rspec spec/path/to/specific_spec.rb` - Run a specific test file
|
14
|
+
- `rake test` or `rake` - Run tests via Rake (default task)
|
15
|
+
|
16
|
+
### Development
|
17
|
+
- `bundle install` - Install dependencies
|
18
|
+
- `gem build create_ruby_app.gemspec` - Build the gem
|
19
|
+
- `gem install create-ruby-app-*.gem` - Install built gem locally
|
20
|
+
|
21
|
+
### CLI Usage
|
22
|
+
- `create-ruby-app new NAME` - Generate new Ruby app
|
23
|
+
- `create-ruby-app new NAME --ruby RUBY_VERSION` - Generate with specific Ruby
|
24
|
+
version
|
25
|
+
- `create-ruby-app new NAME --gems gem1,gem2` - Generate with specific gems
|
26
|
+
- `create-ruby-app --version` - Show version
|
27
|
+
|
28
|
+
## Architecture
|
29
|
+
The codebase follows a modular action-based architecture:
|
30
|
+
|
31
|
+
### Core Components
|
32
|
+
- `CreateRubyApp::CLI` - Thor-based command line interface
|
33
|
+
(lib/create_ruby_app/cli.rb)
|
34
|
+
- `CreateRubyApp::App` - Main application orchestrator that executes actions
|
35
|
+
sequentially (lib/create_ruby_app/app.rb)
|
36
|
+
- Actions pattern - Each major operation is encapsulated in an action class in
|
37
|
+
`lib/create_ruby_app/actions/`
|
38
|
+
|
39
|
+
### Action Flow
|
40
|
+
The app runs actions in this order:
|
41
|
+
1. `CreateDirectories` - Creates project directory structure
|
42
|
+
2. `FindRubyImplementation` - Determines Ruby version to use
|
43
|
+
3. `GenerateFiles` - Creates files from ERB templates
|
44
|
+
4. `MakeScriptExecutable` - Sets executable permissions on bin script
|
45
|
+
5. `InstallGems` - Runs bundle install
|
46
|
+
6. `NullAction` - Completion message
|
47
|
+
|
48
|
+
### File Structure
|
49
|
+
- `lib/create_ruby_app/` - Main library code
|
50
|
+
- `lib/create_ruby_app/actions/` - Action classes implementing the Command
|
51
|
+
pattern
|
52
|
+
- `lib/create_ruby_app/templates/` - ERB templates for generated files
|
53
|
+
- `spec/` - RSpec tests mirroring lib structure
|
54
|
+
- `bin/create-ruby-app` - Executable script
|
55
|
+
|
56
|
+
### Testing
|
57
|
+
- Uses RSpec with `expect` syntax and monkey patching disabled
|
58
|
+
- Tests are organized to mirror the lib directory structure
|
59
|
+
- Each action class has corresponding tests in
|
60
|
+
`spec/lib/create_ruby_app/actions/`
|
61
|
+
|
62
|
+
## Key Implementation Details
|
63
|
+
- Uses Thor for CLI parsing and command definition
|
64
|
+
- Implements logging via Ruby's standard Logger class
|
65
|
+
- Template generation uses ERB for dynamic file creation
|
66
|
+
- Name normalization converts dashes to underscores for Ruby compatibility
|
67
|
+
- Actions follow a callable interface pattern where each action responds to `.call(app)`
|
68
|
+
|
69
|
+
## Coding style
|
70
|
+
- Adhere to Rubocop recommendations and hints
|
71
|
+
- Use double-quotes instead of single quotes
|
72
|
+
- Follow DRY and SOLID coding style principles, design patterns when meaningful,
|
73
|
+
but do not overdo it. Prefer a functional programming style where possible.
|
74
|
+
- Aim at a minimum of 90 percent in test coverage for all new code written.
|