aasm_rbs 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -1
- data/exe/aasm_rbs +1 -1
- data/lib/aasm_rbs/version.rb +1 -1
- data/lib/aasm_rbs.rb +1 -1
- data/sig/aasm_rbs.rbs +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ddfc302bf61720f7444bbd35a41071341e1bccf688c1c2132c3e87545360125
|
4
|
+
data.tar.gz: d4b4678955f896fef85efd6d9011563df8f09c79d36e84979f22d4f009a226ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb93b9cf0fa7a90dc315ebcf13d48cab132539f01cd4235784e16224a6ea6fe8dd72834e083f561e54d341399d00647ccb11305d18ce7a4c7e3dd7a4a6588566
|
7
|
+
data.tar.gz: a0488476811cd0bcc2a1aefddd06c96a34ade62c8aeb797d8df7aea13354111b72f8a002a0a91a612015376010f2332217408513123658bcc55967f54b45b9ae
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# AASM RBS Generator
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/aasm_rbs.svg)](https://badge.fury.io/rb/aasm_rbs) [![Gem Downloads](https://badgen.net/rubygems/dt/aasm_rbs)](https://rubygems.org/gems/aasm_rbs) [![Linters](https://github.com/Uaitt/aasm_rbs/actions/workflows/linters.yml/badge.svg)](https://github.com/Uaitt/aasm_rbs/actions/workflows/linters.yml) [![Specs](https://github.com/Uaitt/aasm_rbs/actions/workflows/specs.yml/badge.svg)](https://github.com/Uaitt/aasm_rbs/actions/workflows/specs.yml)
|
4
|
+
|
2
5
|
Easily generate RBS signatures for all the AASM automatically generated methods and constants of your ruby classes.
|
3
6
|
|
4
7
|
## Description
|
@@ -26,11 +29,30 @@ gem 'aasm_rbs'
|
|
26
29
|
Then, execute `bundle install` in order to load the gem's code.
|
27
30
|
|
28
31
|
## Usage
|
32
|
+
At the moment AASM RBS only supports pure-ruby projects or Rails applications.
|
33
|
+
|
34
|
+
This gem assumes that your project is arranged with a traditional structure:
|
35
|
+
- If dealing with a Rails app, your classes should be in any folder nested inside of `app/` or `lib/`
|
36
|
+
- If dealing with a Ruby project, your actual classes should go inside of `lib/` and arranged as:
|
37
|
+
```
|
38
|
+
lib/
|
39
|
+
├── foo/
|
40
|
+
│ ├── bar.rb # contains Foo::Bar
|
41
|
+
│ ├── baz.rb # contains Foo::Baz
|
42
|
+
│── foo.rb # contains Foo
|
43
|
+
```
|
44
|
+
|
45
|
+
For more information about how to structure your projects, take a look at the following articles:
|
46
|
+
- [Autoloading and reloading constants](https://guides.rubyonrails.org/autoloading_and_reloading_constants.html) from the Rails guides
|
47
|
+
- [Exploring the structure of a Ruby gem](https://www.cloudbees.com/blog/exploring-structure-ruby-gems) fantastic article from cloudbees (a little bit old but still relevant)
|
48
|
+
|
29
49
|
Generating the RBS signatures is as easy as launching the following command from the command-line:
|
30
50
|
```
|
31
|
-
bundle exec aasm_rbs ClassName
|
51
|
+
bundle exec aasm_rbs Namespace::ClassName
|
32
52
|
```
|
33
53
|
|
54
|
+
If your class is namespaced inside of other modules/classes, please pass the whole name as you see in the previous command to AASM RBS or it won't be able to infer the path.
|
55
|
+
|
34
56
|
The generated signatures will appear in `stdout`.
|
35
57
|
|
36
58
|
|
data/exe/aasm_rbs
CHANGED
data/lib/aasm_rbs/version.rb
CHANGED
data/lib/aasm_rbs.rb
CHANGED
data/sig/aasm_rbs.rbs
CHANGED