rbs_devise 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dafe37d38c6866a82af54d137fbcc8edaf36069f56102793f95bc3aa9044e5d
4
- data.tar.gz: 3979e58f38c53794c72f1afa44a25b1705586d0d79b74da1685960e1d08099ed
3
+ metadata.gz: 3879b95db460f238ea805b89aec709db6433e67587be58572294612fdfe56337
4
+ data.tar.gz: 529bc991ab6349cb235919e68fb5ae0fbace74776a359c238ac352e4a938fe16
5
5
  SHA512:
6
- metadata.gz: 53a45411c3da3f173f6f49ec6c8c3911ce8a428845203d77684b39553c15a7d886b83a0adeccc02576a469421660676a02d70b624fca6b0032352426dca7f276
7
- data.tar.gz: ef58061ff72492f68f3f481b3cf8177ca3ddd01701151a7c8eaf64227fb9ee5ebab6b4d3ed1ab45b8f6e7b54ba1bab6a80aa092ae0c3bfbcb7af1ed20134018e
6
+ metadata.gz: 0c44228c2bb3e41967b9f5fda159ebf6d8ddcaa90f0f480d75ed809ac329e48e923ef5674cbd6c152c0b3980ab21728f20eddf12140066ca8e37cb4c30073ed7
7
+ data.tar.gz: fd5f7aba1e09a1c3c673d9182e85ee17782fdbfa891c764096d9b4e12418d8d603e4fb3122327a6cad00a23babe46b9571e268ea9a7ad9d82f80a05e4f982ea2
@@ -6,8 +6,11 @@ module RbsDevise
6
6
  class InstallGenerator < ::Rails::Generators::Base
7
7
  def create_raketask
8
8
  create_file "lib/tasks/rbs_devise.rake", <<~RUBY
9
+ # frozen_string_literal: true
10
+
9
11
  begin
10
12
  require "rbs_devise/rake_task"
13
+
11
14
  RbsDevise::RakeTask.new
12
15
  rescue LoadError
13
16
  # failed to load rbs_devise. Skip to load rbs_devise tasks.
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "devise"
4
4
  require "rbs"
5
- require "rbs_rails"
6
5
 
7
6
  module RbsDevise
8
7
  module Devise
@@ -18,13 +17,7 @@ module RbsDevise
18
17
 
19
18
  class Generator
20
19
  def generate
21
- RbsRails::Util.format_rbs klass_decl
22
- end
23
-
24
- private
25
-
26
- def klass_decl
27
- <<~RBS
20
+ format <<~RBS
28
21
  module Devise
29
22
  #{devise_controllers_signinout_decl}
30
23
  #{device_helpers_decl}
@@ -38,6 +31,15 @@ module RbsDevise
38
31
  RBS
39
32
  end
40
33
 
34
+ private
35
+
36
+ def format(rbs)
37
+ parsed = RBS::Parser.parse_signature(rbs)
38
+ StringIO.new.tap do |out|
39
+ RBS::Writer.new(out: out).write(parsed[1] + parsed[2])
40
+ end.string
41
+ end
42
+
41
43
  def devise_controllers_signinout_decl
42
44
  resource_type = resource_classes.join(" | ")
43
45
  <<~RBS
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsDevise
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -2,7 +2,7 @@
2
2
  sources:
3
3
  - type: git
4
4
  name: ruby/gem_rbs_collection
5
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
5
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
6
6
  remote: https://github.com/ruby/gem_rbs_collection.git
7
7
  repo_dir: gems
8
8
  path: ".gem_rbs_collection"
@@ -171,6 +171,10 @@ gems:
171
171
  revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
172
172
  remote: https://github.com/ruby/gem_rbs_collection.git
173
173
  repo_dir: gems
174
+ - name: pathname
175
+ version: '0'
176
+ source:
177
+ type: stdlib
174
178
  - name: rack
175
179
  version: '2.2'
176
180
  source:
data/rbs_collection.yaml CHANGED
@@ -16,3 +16,5 @@ path: .gem_rbs_collection
16
16
  gems:
17
17
  # Skip loading rbs gem's RBS.
18
18
  # It's unnecessary if you don't use rbs as a library.
19
+
20
+ - name: pathname
data/rbs_devise.gemspec CHANGED
@@ -30,7 +30,6 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_dependency "devise"
32
32
  spec.add_dependency "rails"
33
- spec.add_dependency "rbs_rails"
34
33
 
35
34
  # For more information and examples about making a new gem, check out our
36
35
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -8,13 +8,15 @@ module RbsDevise
8
8
 
9
9
  private
10
10
 
11
- def klass_decl: () -> String
12
- def sessions_controller_decl: () -> String
11
+ def format: (String rbs) -> String
13
12
  def devise_controllers_signinout_decl: () -> String
14
13
  def device_helpers_decl: () -> String
15
14
  def device_helpers_methods: () -> String
15
+ def device_models_decl: () -> String
16
16
  def devise_controller_decl: () -> String
17
+ def devise_sessions_controller_decl: () -> String
17
18
  def actioncontroller_base_decl: () -> String
19
+ def activerecord_base_decl: () -> String
18
20
  def parent_controller: () -> String
19
21
  def resource_classes: () -> Array[String]
20
22
  end
@@ -0,0 +1,5 @@
1
+ class Thor
2
+ module Actions
3
+ def create_file: (String destination, *String? args, ?config: bool) ?{ () -> void } -> untyped
4
+ end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi KOMIYA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-31 00:00:00.000000000 Z
11
+ date: 2023-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rbs_rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  description: A RBS files generator for discard gem
56
42
  email:
57
43
  - i.tkomiya@gmail.com
@@ -81,6 +67,7 @@ files:
81
67
  - sig/rbs_devise/devise.rbs
82
68
  - sig/rbs_devise/rake_task.rbs
83
69
  - sig/shims/rake.rbs
70
+ - sig/shims/thor.rbs
84
71
  homepage: https://github.com/tk0miya/rbs_devise
85
72
  licenses:
86
73
  - MIT