rbs_discard 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bb5871880723cc38c79cb94b0cb842970fd73f2774868bf15c26891d1ba1bee9
4
+ data.tar.gz: 992f1729ee3c71fb446fcbb5fc6f2d5edbdc62bf0166ac26d7bcb3d578c7192a
5
+ SHA512:
6
+ metadata.gz: f2640c58ca91c63ecffb863af1061346a05872b53e7667cab85655a74770f1530dfecfbc1aefa25c980d2402fa1184ba5dc0e8a28e3653fc178b83019b5446f6
7
+ data.tar.gz: 03d9a68fa4e0de5851a449591fb7558fdb793eea891a98267b48b736e9dec5a741002194594a8450825c2d97644d20ace7d9bc84439033d4c3ad6c4749376494
data/.rubocop.yml ADDED
@@ -0,0 +1,23 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/Documentation:
5
+ Enabled: false
6
+
7
+ Style/StringLiterals:
8
+ Enabled: true
9
+ EnforcedStyle: double_quotes
10
+
11
+ Style/StringLiteralsInInterpolation:
12
+ Enabled: true
13
+ EnforcedStyle: double_quotes
14
+
15
+ Layout/BlockLength:
16
+ Exclude:
17
+ - "spec/**/*_spec.rb"
18
+
19
+ Layout/LineLength:
20
+ Max: 120
21
+
22
+ Layout/MethodLength:
23
+ Max: 20
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "shopify.ruby-lsp",
4
+ "soutaro.steep-vscode",
5
+ "tk0miya.rspec-daemon",
6
+ "tk0miya.rbs-helper"
7
+ ]
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "[ruby]": {
3
+ "editor.defaultFormatter": "Shopify.ruby-lsp",
4
+ },
5
+ "rbs-helper.signature-directory": "sig"
6
+ }
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at i.tkomiya@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Takeshi KOMIYA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # rbs_discard
2
+
3
+ rbs_discard is a RBS generator for [discard](https://github.com/jhawthorn/discard).
4
+
5
+ ## Installation
6
+
7
+ Add a new entry to your Gemfile and run `bundle install`.
8
+
9
+ group :development do
10
+ gem 'rbs_discard', require: false
11
+ end
12
+
13
+ After the installation, please run rake task generator:
14
+
15
+ bundle exec rails g rbs_discard:install
16
+
17
+ ## Usage
18
+
19
+ Run `rbs:discard:setup` task:
20
+
21
+ bundle exec rake rbs:discard:setup
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also
26
+ run `bin/console` for an interactive prompt that will allow you to experiment.
27
+
28
+ To install this gem onto your local machine, run `bundle exec rake install`.
29
+
30
+ To release a new version, update the version number in `version.rb`, and then put
31
+ a git tag (ex. `git tag v1.0.0`) and push it to the GitHub. Then GitHub Actions
32
+ will release a new package to [rubygems.org](https://rubygems.org) automatically.
33
+
34
+ ## Contributing
35
+
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/tk0miya/rbs_discard.
37
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are
38
+ expected to adhere to the [code of conduct](https://github.com/tk0miya/rbs_discard/blob/main/CODE_OF_CONDUCT.md).
39
+
40
+ ## License
41
+
42
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
43
+
44
+ ## Code of Conduct
45
+
46
+ Everyone interacting in the RbsDiscard project's codebases and issue trackers is expected to
47
+ follow the [code of conduct](https://github.com/tk0miya/rbs_discard/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/Steepfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ D = Steep::Diagnostic
4
+
5
+ target :lib do
6
+ signature "sig"
7
+
8
+ check "lib"
9
+
10
+ configure_code_diagnostics(D::Ruby.lenient)
11
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+
5
+ module RbsDiscard
6
+ class InstallGenerator < ::Rails::Generators::Base
7
+ def create_raketask
8
+ create_file "lib/tasks/rbs_discard.rake", <<~RUBY
9
+ begin
10
+ require "rbs_discard/rake_task"
11
+ RbsDiscard::RakeTask.new
12
+ rescue LoadError
13
+ # failed to load rbs_discard. Skip to load rbs_discard tasks.
14
+ end
15
+ RUBY
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rbs"
4
+ require "rbs_rails"
5
+
6
+ module RbsDiscard
7
+ module Discard
8
+ def self.all
9
+ ObjectSpace.each_object.select do |obj|
10
+ obj.is_a?(Class) && obj.ancestors.include?(::Discard::Model)
11
+ rescue StandardError
12
+ nil
13
+ end
14
+ end
15
+
16
+ def self.class_to_rbs(klass)
17
+ Generator.new(klass).generate
18
+ end
19
+
20
+ class Generator
21
+ attr_reader :klass, :klass_name
22
+
23
+ def initialize(klass)
24
+ @klass = klass
25
+ @klass_name = RbsRails::Util.module_name(klass)
26
+ end
27
+
28
+ def generate
29
+ RbsRails::Util.format_rbs klass_decl
30
+ end
31
+
32
+ private
33
+
34
+ def klass_decl
35
+ <<~RBS
36
+ #{header}
37
+ class ActiveRecord_Relation
38
+ include Discard::Model::Relation
39
+ end
40
+
41
+ class ActiveRecord_Associations_CollectionProxy
42
+ include Discard::Model::Relation
43
+ end
44
+
45
+ include Discard::Model
46
+ extend Discard::Model::ClassMethods
47
+
48
+ def self.kept: () -> #{klass_name}::ActiveRecord_Relation
49
+ def self.with_discarded: () -> #{klass_name}::ActiveRecord_Relation
50
+ #{footer}
51
+ RBS
52
+ end
53
+
54
+ def header
55
+ namespace = +""
56
+ klass_name.split("::").map do |mod_name|
57
+ namespace += "::#{mod_name}"
58
+ mod_object = Object.const_get(namespace)
59
+ case mod_object
60
+ when Class
61
+ # @type var superclass: Class
62
+ superclass = _ = mod_object.superclass
63
+ superclass_name = RbsRails::Util.module_name(superclass)
64
+
65
+ "class #{mod_name} < ::#{superclass_name}"
66
+ when Module
67
+ "module #{mod_name}"
68
+ else
69
+ raise "unreachable"
70
+ end
71
+ end.join("\n")
72
+ end
73
+
74
+ def footer
75
+ "end\n" * klass.module_parents.size
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ require "rake/tasklib"
5
+
6
+ module RbsDiscard
7
+ class RakeTask < Rake::TaskLib
8
+ attr_accessor :name, :signature_root_dir
9
+
10
+ def initialize(name = :"rbs:discard", &block)
11
+ super()
12
+
13
+ @name = name
14
+ @signature_root_dir = Rails.root / "sig/discard"
15
+
16
+ block&.call(self)
17
+
18
+ define_clean_task
19
+ define_generate_base_class_task
20
+ define_generate_task
21
+ define_setup_task
22
+ end
23
+
24
+ def define_setup_task
25
+ desc "Run all tasks of rbs_discard"
26
+
27
+ deps = [:"#{name}:clean", :"#{name}:base_class:generate", :"#{name}:generate"]
28
+ task("#{name}:setup" => deps)
29
+ end
30
+
31
+ def define_generate_base_class_task
32
+ desc "Generate RBS files for base classes"
33
+ task "#{name}:base_class:generate": :environment do
34
+ signature_root_dir.mkpath
35
+ basedir = Pathname(__FILE__).dirname
36
+ FileUtils.cp basedir / "sig/discard.rbs", signature_root_dir
37
+ end
38
+ end
39
+
40
+ def define_generate_task
41
+ desc "Generate RBS files for discardable models"
42
+ task "#{name}:generate" do
43
+ require "rbs_discard" # load RbsDraper lazily
44
+
45
+ Rails.application.eager_load!
46
+
47
+ RbsDiscard::Discard.all.each do |klass|
48
+ rbs = RbsDiscard::Discard.class_to_rbs(klass)
49
+ path = signature_root_dir / "app/models/#{klass.name.underscore}.rbs"
50
+ path.dirname.mkpath
51
+ path.write(rbs)
52
+ end
53
+ end
54
+ end
55
+
56
+ def define_clean_task
57
+ desc "Clean RBS files for discardable models"
58
+ task "#{name}:clean" do
59
+ signature_root_dir.rmtree if signature_root_dir.exist?
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,27 @@
1
+ module Discard
2
+ module Model
3
+ module ClassMethods
4
+ def before_discard: (*untyped) ? { () -> void } -> void
5
+ def after_discard: (*untyped) ? { () -> void } -> void
6
+ def discard_all: () -> void
7
+ def discard_all!: () -> void
8
+ def undiscard_all: () -> void
9
+ def undiscard_all!: () -> void
10
+ end
11
+
12
+ module Relation
13
+ def kept: () -> self
14
+ def with_discarded: () -> self
15
+ def discard_all: () -> void
16
+ def discard_all!: () -> void
17
+ def undiscard_all: () -> void
18
+ def undiscard_all!: () -> void
19
+ end
20
+
21
+ def discard: () -> bool
22
+ def discard!: () -> void
23
+ def discarded?: () -> bool
24
+ def undiscarded?: () -> bool
25
+ def kept?: () -> bool
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RbsDiscard
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rbs_discard/discard"
4
+ require_relative "rbs_discard/version"
5
+
6
+ module RbsDiscard
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
@@ -0,0 +1,114 @@
1
+ ---
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
6
+ remote: https://github.com/ruby/gem_rbs_collection.git
7
+ repo_dir: gems
8
+ path: ".gem_rbs_collection"
9
+ gems:
10
+ - name: activemodel
11
+ version: '7.0'
12
+ source:
13
+ type: git
14
+ name: ruby/gem_rbs_collection
15
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
16
+ remote: https://github.com/ruby/gem_rbs_collection.git
17
+ repo_dir: gems
18
+ - name: activerecord
19
+ version: '7.0'
20
+ source:
21
+ type: git
22
+ name: ruby/gem_rbs_collection
23
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
24
+ remote: https://github.com/ruby/gem_rbs_collection.git
25
+ repo_dir: gems
26
+ - name: activesupport
27
+ version: '7.0'
28
+ source:
29
+ type: git
30
+ name: ruby/gem_rbs_collection
31
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
32
+ remote: https://github.com/ruby/gem_rbs_collection.git
33
+ repo_dir: gems
34
+ - name: ast
35
+ version: '2.4'
36
+ source:
37
+ type: git
38
+ name: ruby/gem_rbs_collection
39
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
40
+ remote: https://github.com/ruby/gem_rbs_collection.git
41
+ repo_dir: gems
42
+ - name: base64
43
+ version: '0'
44
+ source:
45
+ type: stdlib
46
+ - name: concurrent-ruby
47
+ version: '1.1'
48
+ source:
49
+ type: git
50
+ name: ruby/gem_rbs_collection
51
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
52
+ remote: https://github.com/ruby/gem_rbs_collection.git
53
+ repo_dir: gems
54
+ - name: date
55
+ version: '0'
56
+ source:
57
+ type: stdlib
58
+ - name: i18n
59
+ version: '1.10'
60
+ source:
61
+ type: git
62
+ name: ruby/gem_rbs_collection
63
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
64
+ remote: https://github.com/ruby/gem_rbs_collection.git
65
+ repo_dir: gems
66
+ - name: json
67
+ version: '0'
68
+ source:
69
+ type: stdlib
70
+ - name: logger
71
+ version: '0'
72
+ source:
73
+ type: stdlib
74
+ - name: minitest
75
+ version: '0'
76
+ source:
77
+ type: stdlib
78
+ - name: monitor
79
+ version: '0'
80
+ source:
81
+ type: stdlib
82
+ - name: mutex_m
83
+ version: '0'
84
+ source:
85
+ type: stdlib
86
+ - name: parallel
87
+ version: '1.20'
88
+ source:
89
+ type: git
90
+ name: ruby/gem_rbs_collection
91
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
92
+ remote: https://github.com/ruby/gem_rbs_collection.git
93
+ repo_dir: gems
94
+ - name: rainbow
95
+ version: '3.0'
96
+ source:
97
+ type: git
98
+ name: ruby/gem_rbs_collection
99
+ revision: a4c633634493ab7ae73219022f56acff56ab69af
100
+ remote: https://github.com/ruby/gem_rbs_collection.git
101
+ repo_dir: gems
102
+ - name: securerandom
103
+ version: '0'
104
+ source:
105
+ type: stdlib
106
+ - name: singleton
107
+ version: '0'
108
+ source:
109
+ type: stdlib
110
+ - name: time
111
+ version: '0'
112
+ source:
113
+ type: stdlib
114
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,18 @@
1
+ # Download sources
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ remote: https://github.com/ruby/gem_rbs_collection.git
6
+ revision: main
7
+ repo_dir: gems
8
+
9
+ # You can specify local directories as sources also.
10
+ # - type: local
11
+ # path: path/to/your/local/repository
12
+
13
+ # A directory to install the downloaded RBSs
14
+ path: .gem_rbs_collection
15
+
16
+ gems:
17
+ # Skip loading rbs gem's RBS.
18
+ # It's unnecessary if you don't use rbs as a library.
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rbs_discard/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rbs_discard"
7
+ spec.version = RbsDiscard::VERSION
8
+ spec.authors = ["Takeshi KOMIYA"]
9
+ spec.email = ["i.tkomiya@gmail.com"]
10
+
11
+ spec.summary = "A RBS files generator for discard gem"
12
+ spec.description = "A RBS files generator for discard gem"
13
+ spec.homepage = "https://github.com/tk0miya/rbs_discard"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = spec.homepage
20
+
21
+ spec.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ (File.expand_path(f) == __FILE__) ||
24
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "discard"
32
+ spec.add_dependency "rbs_rails"
33
+
34
+ # For more information and examples about making a new gem, check out our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+ end
@@ -0,0 +1,5 @@
1
+ module RbsDiscard
2
+ class InstallGenerator < ::Rails::Generators::Base
3
+ def create_raketask: () -> void
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+ module RbsDiscard
2
+ module Discard
3
+ def self.all: () -> Array[singleton(Discard::Model)]
4
+ def self.class_to_rbs: (singleton(Discard::Model) klass) -> String
5
+
6
+ class Generator
7
+ attr_reader klass: singleton(Discard::Model)
8
+ attr_reader klass_name: String
9
+
10
+ def initialize: (singleton(Discard::Model) klass) -> void
11
+ def generate: () -> String
12
+
13
+ private
14
+
15
+ def klass_decl: () -> String
16
+ def header: () -> String
17
+ def footer: () -> String
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,12 @@
1
+ module RbsDiscard
2
+ class RakeTask < Rake::TaskLib
3
+ attr_accessor name: Symbol
4
+ attr_accessor signature_root_dir: Pathname
5
+
6
+ def initialize: (?Symbol name) ? { (RakeTask) -> void } -> void
7
+ def define_setup_task: () -> void
8
+ def define_generate_base_class_task: () -> void
9
+ def define_generate_task: () -> void
10
+ def define_clean_task: () -> void
11
+ end
12
+ end
@@ -0,0 +1,4 @@
1
+ module RbsDiscard
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,4 @@
1
+ module Discard
2
+ module Model
3
+ end
4
+ end
@@ -0,0 +1,18 @@
1
+ module Rake
2
+ class TaskLib
3
+ include Rake::DSL
4
+ end
5
+
6
+ module DSL
7
+ private
8
+
9
+ def desc: (String description) -> void
10
+ def file: (*untyped args) ?{ () -> void } -> void
11
+ def import: (*String fns) -> void
12
+ def multitask: (*untyped args) ?{ () -> void } -> void
13
+ def namespace: (?String? name) ?{ () -> void } -> void
14
+ def rule: (*untyped args) ?{ () -> void } -> void
15
+ def task: (*untyped args) ?{ () -> void } -> void
16
+ def sh: (*String cmd) ?{ (bool, Process::Status) -> void } -> void
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rbs_discard
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takeshi KOMIYA
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: discard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rbs_rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A RBS files generator for discard gem
42
+ email:
43
+ - i.tkomiya@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".rubocop.yml"
49
+ - ".vscode/extensions.json"
50
+ - ".vscode/settings.json"
51
+ - CODE_OF_CONDUCT.md
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - Steepfile
56
+ - lib/generators/rbs_discard/install_generator.rb
57
+ - lib/rbs_discard.rb
58
+ - lib/rbs_discard/discard.rb
59
+ - lib/rbs_discard/rake_task.rb
60
+ - lib/rbs_discard/sig/discard.rbs
61
+ - lib/rbs_discard/version.rb
62
+ - rbs_collection.lock.yaml
63
+ - rbs_collection.yaml
64
+ - rbs_discard.gemspec
65
+ - sig/generators/rbs_discard/install_generator.rbs
66
+ - sig/rbs_discard.rbs
67
+ - sig/rbs_discard/discard.rbs
68
+ - sig/rbs_discard/rake_task.rbs
69
+ - sig/shims/discard.rbs
70
+ - sig/shims/rake.rbs
71
+ homepage: https://github.com/tk0miya/rbs_discard
72
+ licenses:
73
+ - MIT
74
+ metadata:
75
+ homepage_uri: https://github.com/tk0miya/rbs_discard
76
+ source_code_uri: https://github.com/tk0miya/rbs_discard
77
+ changelog_uri: https://github.com/tk0miya/rbs_discard
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 2.6.0
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.4.10
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: A RBS files generator for discard gem
97
+ test_files: []