Skip to content

Commit

Permalink
Merge pull request #13 from taka0125/feature/Rbs
Browse files Browse the repository at this point in the history
型情報を足してみた
  • Loading branch information
taka0125 committed Dec 17, 2023
2 parents d386718 + 97cfbd1 commit 47ae324
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ Gemfile.lock

gemfiles/*.gemfile.lock

.bash_history
.bash_history

.gem_rbs_collection
12 changes: 12 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
D = Steep::Diagnostic

target :lib do
signature "sig"

check "lib" # Directory name

repo_path ".gem_rbs_collection"
library "activerecord"

configure_code_diagnostics(D::Ruby.all_error)
end
2 changes: 2 additions & 0 deletions gizzard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", ">= 12.3.3"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "typeprof"
spec.add_development_dependency "steep"
end
2 changes: 1 addition & 1 deletion lib/gizzard/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Gizzard
VERSION = "0.9.0"
VERSION = "0.9.1"
end
140 changes: 140 additions & 0 deletions rbs_collection.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
path: ".gem_rbs_collection"
gems:
- name: abbrev
version: '0'
source:
type: stdlib
- name: activemodel
version: '7.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: activerecord
version: '7.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: activesupport
version: '7.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: concurrent-ruby
version: '1.1'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: date
version: '0'
source:
type: stdlib
- name: dbm
version: '0'
source:
type: stdlib
- name: erb
version: '0'
source:
type: stdlib
- name: fileutils
version: '0'
source:
type: stdlib
- name: i18n
version: '1.10'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: json
version: '0'
source:
type: stdlib
- name: logger
version: '0'
source:
type: stdlib
- name: minitest
version: '0'
source:
type: stdlib
- name: monitor
version: '0'
source:
type: stdlib
- name: mutex_m
version: '0'
source:
type: stdlib
- name: optparse
version: '0'
source:
type: stdlib
- name: pathname
version: '0'
source:
type: stdlib
- name: pstore
version: '0'
source:
type: stdlib
- name: psych
version: '0'
source:
type: stdlib
- name: rake
version: '13.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: rbs
version: 3.3.2
source:
type: rubygems
- name: rdoc
version: '0'
source:
type: stdlib
- name: securerandom
version: '0'
source:
type: stdlib
- name: singleton
version: '0'
source:
type: stdlib
- name: thor
version: '1.2'
source:
type: git
name: ruby/gem_rbs_collection
revision: 20e6e0f0685139dbd29df50e03367e222aa5d1b8
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: time
version: '0'
source:
type: stdlib
- name: tsort
version: '0'
source:
type: stdlib
gemfile_lock_path: Gemfile.lock
17 changes: 17 additions & 0 deletions rbs_collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Download sources
sources:
- type: git
name: ruby/gem_rbs_collection
remote: https://github.com/ruby/gem_rbs_collection.git
revision: main
repo_dir: gems

# You can specify local directories as sources also.
# - type: local
# path: path/to/your/local/repository

# A directory to install the downloaded RBSs
path: .gem_rbs_collection

gems:
- name: activerecord
45 changes: 45 additions & 0 deletions sig/gizzard.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# TypeProf 0.21.8

# Classes
module Gizzard
VERSION: String

class Error < StandardError
end

module Base
extend ActiveSupport::Concern
extend ActiveRecord::Core::ClassMethods

module ClassMethods
def preload_associations: (records: untyped, associations: untyped, ?scope: nil) -> nil
def delete_all_by_id: (?batch_size: Integer) -> untyped
def less_than_id: (Integer id) -> ActiveRecord::Relation
def greater_than_id: (Integer id) -> ActiveRecord::Relation
def less_than: (String | Symbol key, untyped value) -> ActiveRecord::Relation
def less_than_equal: (String | Symbol key, untyped value) -> ActiveRecord::Relation
def greater_than: (String | Symbol key, untyped value) -> ActiveRecord::Relation
def greater_than_equal: (String | Symbol key, untyped value) -> ActiveRecord::Relation
end
end

module Mysql
include Base
extend Base::ClassMethods

module ClassMethods
def lock_in_share: -> ActiveRecord::Relation
def order_by_field: (String | Symbol column, [untyped] values) -> ActiveRecord::Relation
def order_by_id_field: ([untyped] ids) -> ActiveRecord::Relation
def use_index: (String | [String] indexes) -> ActiveRecord::Relation
def force_index: (String | [String] indexes) -> ActiveRecord::Relation
def joins_with_use_index: (String | Symbol relation_name, String | [String] indexes) -> ActiveRecord::Relation
def joins_with_force_index: (String | Symbol relation_name, String | [String] indexes) -> ActiveRecord::Relation
def left_outer_joins_with_use_index: (String | Symbol relation_name, String | [String] indexes) -> ActiveRecord::Relation
def left_outer_joins_with_force_index: (String | Symbol relation_name, String | [String] indexes) -> ActiveRecord::Relation
end

def to_id: -> Integer
def lock_in_share!: -> untyped
end
end

0 comments on commit 47ae324

Please sign in to comment.