Skip to content

Commit

Permalink
🐭
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Apr 7, 2024
1 parent 2280cee commit b6305c6
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/pkg/
/spec/reports/
/tmp/
/.gem_rbs_collection
29 changes: 29 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# D = Steep::Diagnostic
#
# target :lib do
# signature "sig"
#
# check "lib" # Directory name
# check "Gemfile" # File name
# check "app/models/**/*.rb" # Glob
# # ignore "lib/templates/*.rb"
#
# # library "pathname" # Standard libraries
# # library "strong_json" # Gems
#
# # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
# # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
# # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
# # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
# # configure_code_diagnostics do |hash| # You can setup everything yourself
# # hash[D::Ruby::NoMethod] = :information
# # end
# end

# target :test do
# signature "sig", "sig-private"
#
# check "test"
#
# # library "pathname" # Standard libraries
# end
36 changes: 36 additions & 0 deletions lib/rbs/inline/ast.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module RBS
module Inline
module AST
module Member
class RubyDef
end

class RubyAlias
end

class RubyMixin
end

class RubyAttr
end

class RBSDef
end

class RBSAlias
end

class RBSAttr
end
end

module Declaration
class ModuleDecl
end

class ClassDecl
end
end
end
end
end
64 changes: 64 additions & 0 deletions rbs_collection.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
path: ".gem_rbs_collection"
gems:
- name: abbrev
version: '0'
source:
type: stdlib
- name: fileutils
version: '0'
source:
type: stdlib
- 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: prism
version: 0.24.0
source:
type: rubygems
- name: rake
version: '13.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: e047afdf7e470acf0d0cdff31bd9c3123be3ea39
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: rbs
version: 3.4.4
source:
type: rubygems
- name: rdoc
version: '0'
source:
type: stdlib
- name: tsort
version: '0'
source:
type: stdlib
gemfile_lock_path: Gemfile.lock
19 changes: 19 additions & 0 deletions rbs_collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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:
# # If you want to avoid installing rbs files for gems, you can specify them here.
# - name: GEM_NAME
# ignore: true
12 changes: 12 additions & 0 deletions sig/rbs/inline/ast.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module RBS
module Inline
module AST
module Member
type t = MethodDefinition
end

module Declaration
end
end
end
end
6 changes: 6 additions & 0 deletions yard-samples/hello.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require "prism"

ast = Prism.parse_file("yard-samples/sample1.rb")

pp ast.value
pp ast.comments
26 changes: 26 additions & 0 deletions yard-samples/sample1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module Foo
# This is `Foo#foo` method
#
# @param i [Integer] Size of something
# @param j [Symbol,Integer] Something doing meaningful
# @return [String?] Returns a string or nil
#
#
# @rbs.method (Integer, String) -> void
# | [A] () { () [self: String] -> A } -> A?
#
def foo(i, j)

end

# @rbs.inline
# attr_reader hoge: String
# attr_reader name: String?
def hoge

end

class Foo
# @rbs.inline include Foo[String]
end
end

0 comments on commit b6305c6

Please sign in to comment.