-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Uaitt/feat/gem-release
Feat/gem release
- Loading branch information
Showing
8 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ AllCops: | |
Exclude: | ||
- bin/* | ||
- vendor/**/* | ||
- exe/* | ||
NewCops: enable | ||
TargetRubyVersion: 3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
source 'https://rubygems.org' | ||
|
||
gem 'aasm' | ||
gemspec | ||
|
||
group :development, :test do | ||
gem 'activerecord' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2023 Lorenzo Zabot | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
# AASM RBS Generator | ||
Easily generate `RBS` signatures of all the `AASM`-automatically generated methods and constants of your ruby classes. | ||
|
||
## Description | ||
If you have found this gem, you probably are adding a type system with `RBS` on top of your `Ruby` project or `Rails` application, and you are managing the state of some of your classes with the `AASM` gem. | ||
|
||
If you have no idea about what `AASM` is, you should take a look at their [README]() first. | ||
|
||
You should now know that when you `include AASM` on a Ruby class and you define states, events and transitions, your classes will automatically get a few things, including: | ||
- a constant for every state | ||
- instance methods for every state | ||
- scopes for every state if the class is an `ActiveRecord` model | ||
- instance methods for every event | ||
|
||
The problem is that when writing `RBS` you should write the signatures for the previous things one-by-one and it can get really frustrating/boring when dealing with large classes. | ||
|
||
With this small gem, you can now generate all those signatures automatically with a single command, and save time for doing something more meaningful. | ||
|
||
## Installation | ||
Add the following line to your application's `Gemfile`: | ||
|
||
```rb | ||
gem 'aasm_rbs' | ||
``` | ||
|
||
Then, execute `bundle install` in order to load the gem's code. | ||
|
||
## Usage | ||
Generating the `RBS` signatures is as easy as launching the following command from the command-line: | ||
``` | ||
bundle exec aasm_rbs ClassName | ||
``` | ||
|
||
The generated signatures should appear in `stdout`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'lib/aasm_rbs/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = 'aasm_rbs' | ||
spec.version = AasmRbs::VERSION | ||
spec.summary = 'AASM RBS' | ||
spec.description = 'Easily generate RBS signatures for all the Ruby classes that implement a state-machine with AASM' | ||
spec.license = 'MIT' | ||
|
||
spec.required_ruby_version = '>= 3.0.0' | ||
|
||
spec.author = 'Lorenzo Zabot' | ||
spec.email = ['lorenzozabot@gmail.com'] | ||
spec.homepage = '/~https://github.com/Uaitt/aasm_rbs' | ||
|
||
spec.metadata = { | ||
'allowed_push_host' => 'https://rubygems.org', | ||
'homepage_uri' => spec.homepage, | ||
'source_code_uri' => spec.homepage, | ||
'rubygems_mfa_required' => 'true' | ||
} | ||
|
||
spec.files = Dir['lib/**/*', 'LICENSE', 'README.md'] | ||
spec.require_paths = ['lib'] | ||
spec.executables = 'exe/aasm_rbs' | ||
spec.bindir = 'exe' | ||
|
||
spec.add_runtime_dependency 'aasm', '~> 5' | ||
end |
This file was deleted.
Oops, something went wrong.
File renamed without changes.