trains 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -3
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -0
- data/README.md +13 -8
- data/Rakefile +12 -0
- data/lib/trains/version.rb +3 -0
- data/lib/trains/visitor/migration.rb +3 -1
- data/lib/trains.rb +0 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5edc43c1d03aa434cb4166f79b9687574ac14a04548a8e2e8fc7f47b005573e0
|
4
|
+
data.tar.gz: ebee4c7048d82d644e4c08de0cd9a828b2f6784747558a3ec041b0feadbc043d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7511a1b15fc8b908cee1ccacd6096d651169ee7ce5ab4eeb6b153c905b8bd949f3899fd20080b4b0f577f2c9d90260ac8e7d85940680fb7c0c74cf24386fa110
|
7
|
+
data.tar.gz: f7607d015b516c24c33e74f0473c120a25070bd146411deda8be54cbbe66e945a9ed68f56dd3122cd3c6694dae5bf3b220a836f0584f64f19aab711ba871aa54
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
-
|
5
|
+
## [0.0.2] - 2023-02-19
|
6
|
+
|
7
|
+
- Add `bin/setup` and `bin/console` for development convenience
|
8
|
+
|
9
|
+
## [0.0.1] - 2023-02-19
|
10
|
+
|
11
|
+
- Add AST visitors for controllers and models
|
12
|
+
- Controller visitor returns `DTO::Controller`
|
13
|
+
- Migration visitor returns `DTO::Model`
|
14
|
+
- `Scanner` class is the main interface of the gem
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
trains (0.0.1)
|
5
|
+
activesupport (~> 7.0)
|
6
|
+
parallel (~> 1.22)
|
7
|
+
rubocop-ast (~> 1.16)
|
8
|
+
zeitwerk (~> 2.5)
|
9
|
+
|
1
10
|
GEM
|
2
11
|
remote: https://rubygems.org/
|
3
12
|
specs:
|
@@ -17,6 +26,7 @@ GEM
|
|
17
26
|
parser (3.1.1.0)
|
18
27
|
ast (~> 2.4.1)
|
19
28
|
prettier_print (1.2.0)
|
29
|
+
rake (13.0.6)
|
20
30
|
rspec (3.12.0)
|
21
31
|
rspec-core (~> 3.12.0)
|
22
32
|
rspec-expectations (~> 3.12.0)
|
@@ -49,9 +59,11 @@ PLATFORMS
|
|
49
59
|
DEPENDENCIES
|
50
60
|
activesupport (~> 7.0)
|
51
61
|
parallel (~> 1.22)
|
62
|
+
rake (~> 13.0)
|
52
63
|
rspec (~> 3.12)
|
53
64
|
rubocop-ast
|
54
65
|
ruby-lsp (~> 0.3.7)
|
66
|
+
trains!
|
55
67
|
zeitwerk (~> 2.5)
|
56
68
|
|
57
69
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -48,10 +48,10 @@ Trains will generate the following Model definition:
|
|
48
48
|
Trains::DTO::Model(
|
49
49
|
name: 'Group',
|
50
50
|
fields:
|
51
|
-
|
52
|
-
Trains::DTO::Field(:
|
53
|
-
Trains::DTO::Field(:
|
54
|
-
Trains::DTO::Field(:
|
51
|
+
[
|
52
|
+
Trains::DTO::Field(:title, :string),
|
53
|
+
Trains::DTO::Field(:created_at, :datetime),
|
54
|
+
Trains::DTO::Field(:updated_at, :datetime),
|
55
55
|
],
|
56
56
|
version: 7.0
|
57
57
|
)
|
@@ -77,8 +77,13 @@ Trains will return the following controller definition:
|
|
77
77
|
|
78
78
|
```ruby
|
79
79
|
Trains::DTO::Controller(
|
80
|
-
|
81
|
-
|
80
|
+
name: 'BoxController',
|
81
|
+
method_list: [
|
82
|
+
Trains::DTO::Method(name: 'create', visibility: nil, source: nil),
|
83
|
+
Trains::DTO::Method(name: 'edit', visibility: nil, source: nil),
|
84
|
+
Trains::DTO::Method(name: 'update', visibility: nil, source: nil),
|
85
|
+
Trains::DTO::Method(name: 'destroy', visibility: nil, source: nil)
|
86
|
+
]
|
82
87
|
)
|
83
88
|
```
|
84
89
|
|
@@ -90,7 +95,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
90
95
|
|
91
96
|
## Contributing
|
92
97
|
|
93
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
98
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/faraazahmad/trains. 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/faraazahmad/trains/blob/master/CODE_OF_CONDUCT.md).
|
94
99
|
|
95
100
|
## License
|
96
101
|
|
@@ -98,5 +103,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
98
103
|
|
99
104
|
## Code of Conduct
|
100
105
|
|
101
|
-
Everyone interacting in the Trains project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
106
|
+
Everyone interacting in the Trains project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/faraazahmad/trains/blob/master/CODE_OF_CONDUCT.md).
|
102
107
|
|
data/Rakefile
ADDED
@@ -19,7 +19,9 @@ module Trains
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def on_class(node)
|
22
|
-
|
22
|
+
unless node.parent_class.source.include? 'ActiveRecord::Migration'
|
23
|
+
return
|
24
|
+
end
|
23
25
|
|
24
26
|
@migration_class = node.children.first.source
|
25
27
|
@migration_version = extract_version(node.parent_class.source)
|
data/lib/trains.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trains
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Syed Faraaz Ahmad
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- Gemfile.lock
|
84
84
|
- LICENSE.txt
|
85
85
|
- README.md
|
86
|
+
- Rakefile
|
86
87
|
- lib/trains.rb
|
87
88
|
- lib/trains/dto/app.rb
|
88
89
|
- lib/trains/dto/controller.rb
|
@@ -94,6 +95,7 @@ files:
|
|
94
95
|
- lib/trains/utils/logger.rb
|
95
96
|
- lib/trains/utils/rails_dir.rb
|
96
97
|
- lib/trains/utils/result.rb
|
98
|
+
- lib/trains/version.rb
|
97
99
|
- lib/trains/visitor/base.rb
|
98
100
|
- lib/trains/visitor/controller.rb
|
99
101
|
- lib/trains/visitor/helper.rb
|