rbs_rails 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +13 -2
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +4 -1
- data/bin/gem_rbs +2 -2
- data/bin/setup +1 -0
- data/lib/rbs_rails/active_record.rb +6 -0
- data/lib/rbs_rails/rake_task.rb +2 -3
- data/lib/rbs_rails/version.rb +1 -1
- data/rbs_rails.gemspec +1 -1
- data/sig/rbs_rails/active_record.rbs +1 -0
- metadata +3 -4
- data/.gitattributes +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30c59f478f8fa0cd0c41751feb468a04208e057ff318edf80717b63d2f4664b8
|
4
|
+
data.tar.gz: f382afdc82aaa47b6fe14cba2cdcbb62f127dc04d95020b71ed1b6c1aa8dfd9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ca5ed84a59c4e67892f8c4e72cdc190420d457345523eb11b3dd4efe7dde5d8662afc7ace9dbee3be1aa5577b257b028ccdba20297b45332919999ac648914
|
7
|
+
data.tar.gz: 61ba620c335f27ddb58ce96d4bf3d03ea61071c528b587b7fa419d93c462ba6d96e6ad4e508243a1e6aff903966bfa49e18a02ecf9eb69f053c2cdd215da20a7
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,13 +1,21 @@
|
|
1
1
|
name: CI
|
2
2
|
|
3
|
-
on:
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
types:
|
9
|
+
- opened
|
10
|
+
- synchronize
|
11
|
+
- reopened
|
4
12
|
|
5
13
|
jobs:
|
6
14
|
test:
|
7
15
|
strategy:
|
8
16
|
fail-fast: false
|
9
17
|
matrix:
|
10
|
-
ruby: [2.6, 2.7, '3.0']
|
18
|
+
ruby: [2.6, 2.7, '3.0', head]
|
11
19
|
runs-on: ubuntu-latest
|
12
20
|
steps:
|
13
21
|
- uses: actions/checkout@v2
|
@@ -15,4 +23,7 @@ jobs:
|
|
15
23
|
with:
|
16
24
|
ruby-version: ${{ matrix.ruby }}
|
17
25
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
26
|
+
- env:
|
27
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
28
|
+
run: bin/gem_rbs
|
18
29
|
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.8.1 (2021-01-09)
|
6
|
+
|
7
|
+
* Skip generation RBS fro class that doesn't have table in DB. [#95](https://github.com/pocke/rbs_rails/pull/95)
|
8
|
+
|
5
9
|
## 0.8.0 (2020-12-31)
|
6
10
|
|
7
11
|
* **[BREAKING]** Move RBS files that are copied by `rbs_rails:copy_signature_files` task to [ruby/gem_rbs](https://github.com/ruby/gem_rbs) repository [#90](https://github.com/pocke/rbs_rails/pull/90)
|
data/README.md
CHANGED
@@ -73,7 +73,10 @@ You need to put RBS repo to `path/to/rbs_repo`. See https://github.com/ruby/gem_
|
|
73
73
|
|
74
74
|
## Development
|
75
75
|
|
76
|
-
After checking out the repo, run `bin/setup` to install dependencies.
|
76
|
+
After checking out the repo, run `GITHUB_TOKEN=xxx bin/setup` to install dependencies.
|
77
|
+
`GITHUB_TOKEN` environment variable is required to fetch RBS from [ruby/gem_rbs](https://github.com/ruby/gem_rbs) repository.
|
78
|
+
|
79
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
77
80
|
|
78
81
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
79
82
|
|
data/bin/gem_rbs
CHANGED
data/bin/setup
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
module RbsRails
|
2
2
|
module ActiveRecord
|
3
3
|
|
4
|
+
def self.generatable?(klass)
|
5
|
+
return false if klass.abstract_class?
|
6
|
+
|
7
|
+
klass.connection.table_exists?(klass.table_name)
|
8
|
+
end
|
9
|
+
|
4
10
|
def self.class_to_rbs(klass, dependencies: [])
|
5
11
|
Generator.new(klass, dependencies: dependencies).generate
|
6
12
|
end
|
data/lib/rbs_rails/rake_task.rb
CHANGED
@@ -35,9 +35,8 @@ module RbsRails
|
|
35
35
|
|
36
36
|
dep_builder = DependencyBuilder.new
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
next if klass.abstract_class?
|
38
|
+
::ActiveRecord::Base.descendants.each do |klass|
|
39
|
+
next unless RbsRails::ActiveRecord.generatable?(klass)
|
41
40
|
next if ignore_model_if&.call(klass)
|
42
41
|
|
43
42
|
path = signature_root_dir / "app/models/#{klass.name.underscore}.rbs"
|
data/lib/rbs_rails/version.rb
CHANGED
data/rbs_rails.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
21
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
23
|
end
|
24
24
|
spec.bindir = "exe"
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -45,7 +45,6 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ".gitattributes"
|
49
48
|
- ".github/workflows/ci.yml"
|
50
49
|
- ".gitignore"
|
51
50
|
- ".gitmodules"
|
@@ -103,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
102
|
- !ruby/object:Gem::Version
|
104
103
|
version: '0'
|
105
104
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.3.0.dev
|
107
106
|
signing_key:
|
108
107
|
specification_version: 4
|
109
108
|
summary: A RBS files generator for Rails application
|
data/.gitattributes
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
gem_rbs/gems/* linguist-generated=true
|