autodoc 0.7.7 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90d6e102506091c10a1fc1406473218b594323fed27e1e45bfef8f400ba68224
4
- data.tar.gz: 6b849d38814134089c42761c74023c00d81f1fd42fd7605cebd6b3ab471288b8
3
+ metadata.gz: 9183278ddda7427ccdc155a3ad69f43f034b294464550527c07af123faa644db
4
+ data.tar.gz: a7ef37d9c410a0ce89e3075db76113539593ea470cbef85177d258358222a9b8
5
5
  SHA512:
6
- metadata.gz: a5735483d6d426ca94f09f06b25fcba57d04d9e6c36fc430bea071c09aac59316184f7376525894a8e6b3b38957eabd64efec5dbcd20e1c3c7476af5059ebbc0
7
- data.tar.gz: 32f6204f0a142cf6b503d2ac9e1ee0b1fc194235eaa18f00651903a33127a6e948b9a2af88ffa82b29d1a2beecf0ea8709d25031e3fd71af6d75e01e381ae68f
6
+ metadata.gz: 33ccf53ad9a5b809b1a7f48e5e59a31f6379f20575ee792c698211f3734f77ddef99788f542d093bb69c60d0e5f0b443998795110412d08b593df981ddf5c315
7
+ data.tar.gz: 49a7f2cffb288e4d87f7bcaef467cdab1e3236080fac816907d9914d7d0105591395710a030b2f77c647ae93e947d79807ba1d88301c51204c0aceae22c48ca1
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.8.1 - 2025-05-14
11
+
12
+ ### Fixed
13
+
14
+ - Silence string literal freeze warnings on Ruby 3.4.
15
+
16
+ ## 0.8.0 - 2022-12-23
17
+
18
+ ### Fixed
19
+
20
+ - Change the order of documents to match the order of tests.
21
+
10
22
  ## 0.7.7 - 2022-05-17
11
23
 
12
24
  ### Fixed
data/Gemfile CHANGED
@@ -2,6 +2,11 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
+ gem "bundler"
6
+ gem "rails"
7
+ gem "rake"
8
+ gem "sqlite3"
9
+
5
10
  group :test do
6
11
  gem "pry-rails"
7
12
  if ENV['RSPEC2']
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- autodoc (0.7.7)
4
+ autodoc (0.8.1)
5
5
  actionpack
6
6
  activesupport (>= 3.0.0)
7
7
  rspec
@@ -9,168 +9,197 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.2.2)
13
- actionpack (= 5.2.2)
12
+ actioncable (7.0.4.1)
13
+ actionpack (= 7.0.4.1)
14
+ activesupport (= 7.0.4.1)
14
15
  nio4r (~> 2.0)
15
16
  websocket-driver (>= 0.6.1)
16
- actionmailer (5.2.2)
17
- actionpack (= 5.2.2)
18
- actionview (= 5.2.2)
19
- activejob (= 5.2.2)
17
+ actionmailbox (7.0.4.1)
18
+ actionpack (= 7.0.4.1)
19
+ activejob (= 7.0.4.1)
20
+ activerecord (= 7.0.4.1)
21
+ activestorage (= 7.0.4.1)
22
+ activesupport (= 7.0.4.1)
23
+ mail (>= 2.7.1)
24
+ net-imap
25
+ net-pop
26
+ net-smtp
27
+ actionmailer (7.0.4.1)
28
+ actionpack (= 7.0.4.1)
29
+ actionview (= 7.0.4.1)
30
+ activejob (= 7.0.4.1)
31
+ activesupport (= 7.0.4.1)
20
32
  mail (~> 2.5, >= 2.5.4)
33
+ net-imap
34
+ net-pop
35
+ net-smtp
21
36
  rails-dom-testing (~> 2.0)
22
- actionpack (5.2.2)
23
- actionview (= 5.2.2)
24
- activesupport (= 5.2.2)
25
- rack (~> 2.0)
37
+ actionpack (7.0.4.1)
38
+ actionview (= 7.0.4.1)
39
+ activesupport (= 7.0.4.1)
40
+ rack (~> 2.0, >= 2.2.0)
26
41
  rack-test (>= 0.6.3)
27
42
  rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.2.2)
30
- activesupport (= 5.2.2)
43
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
44
+ actiontext (7.0.4.1)
45
+ actionpack (= 7.0.4.1)
46
+ activerecord (= 7.0.4.1)
47
+ activestorage (= 7.0.4.1)
48
+ activesupport (= 7.0.4.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (7.0.4.1)
52
+ activesupport (= 7.0.4.1)
31
53
  builder (~> 3.1)
32
54
  erubi (~> 1.4)
33
55
  rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.2.2)
36
- activesupport (= 5.2.2)
56
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
57
+ activejob (7.0.4.1)
58
+ activesupport (= 7.0.4.1)
37
59
  globalid (>= 0.3.6)
38
- activemodel (5.2.2)
39
- activesupport (= 5.2.2)
40
- activerecord (5.2.2)
41
- activemodel (= 5.2.2)
42
- activesupport (= 5.2.2)
43
- arel (>= 9.0)
44
- activestorage (5.2.2)
45
- actionpack (= 5.2.2)
46
- activerecord (= 5.2.2)
47
- marcel (~> 0.3.1)
48
- activesupport (5.2.2)
60
+ activemodel (7.0.4.1)
61
+ activesupport (= 7.0.4.1)
62
+ activerecord (7.0.4.1)
63
+ activemodel (= 7.0.4.1)
64
+ activesupport (= 7.0.4.1)
65
+ activestorage (7.0.4.1)
66
+ actionpack (= 7.0.4.1)
67
+ activejob (= 7.0.4.1)
68
+ activerecord (= 7.0.4.1)
69
+ activesupport (= 7.0.4.1)
70
+ marcel (~> 1.0)
71
+ mini_mime (>= 1.1.0)
72
+ activesupport (7.0.4.1)
49
73
  concurrent-ruby (~> 1.0, >= 1.0.2)
50
- i18n (>= 0.7, < 2)
51
- minitest (~> 5.1)
52
- tzinfo (~> 1.1)
53
- arel (9.0.0)
74
+ i18n (>= 1.6, < 2)
75
+ minitest (>= 5.1)
76
+ tzinfo (~> 2.0)
54
77
  builder (3.2.4)
55
78
  coderay (1.1.3)
56
79
  concurrent-ruby (1.1.10)
57
80
  crass (1.0.6)
81
+ date (3.4.1)
58
82
  diff-lcs (1.5.0)
59
- erubi (1.10.0)
60
- globalid (1.0.0)
83
+ erubi (1.12.0)
84
+ globalid (1.0.1)
61
85
  activesupport (>= 5.0)
62
- i18n (1.10.0)
86
+ i18n (1.12.0)
63
87
  concurrent-ruby (~> 1.0)
64
- loofah (2.16.0)
88
+ loofah (2.19.1)
65
89
  crass (~> 1.0.2)
66
90
  nokogiri (>= 1.5.9)
67
- mail (2.7.1)
91
+ mail (2.8.0.1)
68
92
  mini_mime (>= 0.1.1)
69
- marcel (0.3.3)
70
- mimemagic (~> 0.3.2)
93
+ net-imap
94
+ net-pop
95
+ net-smtp
96
+ marcel (1.0.2)
71
97
  method_source (1.0.0)
72
- mimemagic (0.3.10)
73
- nokogiri (~> 1)
74
- rake
75
98
  mini_mime (1.1.2)
76
- mini_portile2 (2.8.0)
77
- minitest (5.15.0)
99
+ mini_portile2 (2.8.1)
100
+ minitest (5.17.0)
101
+ net-imap (0.3.9)
102
+ date
103
+ net-protocol
104
+ net-pop (0.1.2)
105
+ net-protocol
106
+ net-protocol (0.2.2)
107
+ timeout
108
+ net-smtp (0.3.3)
109
+ net-protocol
78
110
  nio4r (2.5.8)
79
- nokogiri (1.13.4)
111
+ nokogiri (1.14.3)
80
112
  mini_portile2 (~> 2.8.0)
81
113
  racc (~> 1.4)
82
- pry (0.14.1)
114
+ pry (0.14.2)
83
115
  coderay (~> 1.1)
84
116
  method_source (~> 1.0)
85
117
  pry-rails (0.3.9)
86
118
  pry (>= 0.10.4)
87
- racc (1.6.0)
88
- rack (2.2.3)
89
- rack-test (1.1.0)
90
- rack (>= 1.0, < 3)
91
- rails (5.2.2)
92
- actioncable (= 5.2.2)
93
- actionmailer (= 5.2.2)
94
- actionpack (= 5.2.2)
95
- actionview (= 5.2.2)
96
- activejob (= 5.2.2)
97
- activemodel (= 5.2.2)
98
- activerecord (= 5.2.2)
99
- activestorage (= 5.2.2)
100
- activesupport (= 5.2.2)
101
- bundler (>= 1.3.0)
102
- railties (= 5.2.2)
103
- sprockets-rails (>= 2.0.0)
119
+ racc (1.6.2)
120
+ rack (2.2.14)
121
+ rack-test (2.0.2)
122
+ rack (>= 1.3)
123
+ rails (7.0.4.1)
124
+ actioncable (= 7.0.4.1)
125
+ actionmailbox (= 7.0.4.1)
126
+ actionmailer (= 7.0.4.1)
127
+ actionpack (= 7.0.4.1)
128
+ actiontext (= 7.0.4.1)
129
+ actionview (= 7.0.4.1)
130
+ activejob (= 7.0.4.1)
131
+ activemodel (= 7.0.4.1)
132
+ activerecord (= 7.0.4.1)
133
+ activestorage (= 7.0.4.1)
134
+ activesupport (= 7.0.4.1)
135
+ bundler (>= 1.15.0)
136
+ railties (= 7.0.4.1)
104
137
  rails-dom-testing (2.0.3)
105
138
  activesupport (>= 4.2.0)
106
139
  nokogiri (>= 1.6)
107
- rails-html-sanitizer (1.4.2)
108
- loofah (~> 2.3)
109
- railties (5.2.2)
110
- actionpack (= 5.2.2)
111
- activesupport (= 5.2.2)
140
+ rails-html-sanitizer (1.4.4)
141
+ loofah (~> 2.19, >= 2.19.1)
142
+ railties (7.0.4.1)
143
+ actionpack (= 7.0.4.1)
144
+ activesupport (= 7.0.4.1)
112
145
  method_source
113
- rake (>= 0.8.7)
114
- thor (>= 0.19.0, < 2.0)
146
+ rake (>= 12.2)
147
+ thor (~> 1.0)
148
+ zeitwerk (~> 2.5)
115
149
  rake (13.0.6)
116
150
  redcarpet (3.5.1)
117
151
  responders (3.0.1)
118
152
  actionpack (>= 5.0)
119
153
  railties (>= 5.0)
120
- rspec (3.11.0)
121
- rspec-core (~> 3.11.0)
122
- rspec-expectations (~> 3.11.0)
123
- rspec-mocks (~> 3.11.0)
124
- rspec-core (3.11.0)
125
- rspec-support (~> 3.11.0)
126
- rspec-expectations (3.11.0)
154
+ rspec (3.12.0)
155
+ rspec-core (~> 3.12.0)
156
+ rspec-expectations (~> 3.12.0)
157
+ rspec-mocks (~> 3.12.0)
158
+ rspec-core (3.12.0)
159
+ rspec-support (~> 3.12.0)
160
+ rspec-expectations (3.12.2)
127
161
  diff-lcs (>= 1.2.0, < 2.0)
128
- rspec-support (~> 3.11.0)
129
- rspec-mocks (3.11.1)
162
+ rspec-support (~> 3.12.0)
163
+ rspec-mocks (3.12.3)
130
164
  diff-lcs (>= 1.2.0, < 2.0)
131
- rspec-support (~> 3.11.0)
132
- rspec-rails (5.1.1)
133
- actionpack (>= 5.2)
134
- activesupport (>= 5.2)
135
- railties (>= 5.2)
136
- rspec-core (~> 3.10)
137
- rspec-expectations (~> 3.10)
138
- rspec-mocks (~> 3.10)
139
- rspec-support (~> 3.10)
140
- rspec-support (3.11.0)
141
- sprockets (4.0.3)
142
- concurrent-ruby (~> 1.0)
143
- rack (> 1, < 3)
144
- sprockets-rails (3.4.2)
145
- actionpack (>= 5.2)
146
- activesupport (>= 5.2)
147
- sprockets (>= 3.0.0)
148
- sqlite3 (1.3.13)
165
+ rspec-support (~> 3.12.0)
166
+ rspec-rails (6.0.1)
167
+ actionpack (>= 6.1)
168
+ activesupport (>= 6.1)
169
+ railties (>= 6.1)
170
+ rspec-core (~> 3.11)
171
+ rspec-expectations (~> 3.11)
172
+ rspec-mocks (~> 3.11)
173
+ rspec-support (~> 3.11)
174
+ rspec-support (3.12.0)
175
+ sqlite3 (1.6.0)
176
+ mini_portile2 (~> 2.8.0)
149
177
  thor (1.2.1)
150
- thread_safe (0.3.6)
151
- tzinfo (1.2.9)
152
- thread_safe (~> 0.1)
178
+ timeout (0.4.3)
179
+ tzinfo (2.0.5)
180
+ concurrent-ruby (~> 1.0)
153
181
  weak_parameters (0.5.0)
154
182
  rails (>= 4.0.0)
155
183
  websocket-driver (0.7.5)
156
184
  websocket-extensions (>= 0.1.0)
157
185
  websocket-extensions (0.1.5)
186
+ zeitwerk (2.6.6)
158
187
 
159
188
  PLATFORMS
160
189
  ruby
161
190
 
162
191
  DEPENDENCIES
163
192
  autodoc!
164
- bundler (~> 1.3)
193
+ bundler
165
194
  pry-rails
166
195
  rack-test
167
- rails (= 5.2.2)
196
+ rails
168
197
  rake
169
198
  redcarpet
170
199
  responders
171
200
  rspec-rails
172
- sqlite3 (~> 1.3.13)
201
+ sqlite3
173
202
  weak_parameters
174
203
 
175
204
  BUNDLED WITH
176
- 1.17.3
205
+ 2.4.4
data/autodoc.gemspec CHANGED
@@ -20,8 +20,4 @@ Gem::Specification.new do |spec|
20
20
  spec.add_dependency "activesupport", ">= 3.0.0"
21
21
  spec.add_dependency "actionpack"
22
22
  spec.add_dependency "rspec"
23
- spec.add_development_dependency "bundler", "~> 1.3"
24
- spec.add_development_dependency "rails", "5.2.2"
25
- spec.add_development_dependency "rake"
26
- spec.add_development_dependency "sqlite3", "~> 1.3.13"
27
23
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "action_dispatch/http/request"
2
4
  require "active_support/core_ext/hash/slice"
3
5
  require "active_support/core_ext/string/strip"
@@ -20,6 +22,10 @@ module Autodoc
20
22
  @example = example
21
23
  end
22
24
 
25
+ def line_number
26
+ @context.inspect[/:([\d]+)\)>$/, 1].to_i
27
+ end
28
+
23
29
  def pathname
24
30
  @pathname ||= begin
25
31
  Autodoc.configuration.pathname + document_path_from_example.call(example)
@@ -226,13 +232,11 @@ module Autodoc
226
232
  end
227
233
 
228
234
  def to_s
229
- string = ""
230
- string << "#{body}#{payload}"
235
+ string = "#{body}#{payload}"
231
236
 
232
237
  if validator.respond_to? :validators
233
238
  validator.validators.each do |x|
234
- string << "\n"
235
- string << Parameter.new(x).to_s.indent(2)
239
+ string += "\n#{Parameter.new(x).to_s.indent(2)}"
236
240
  end
237
241
  end
238
242
 
@@ -250,9 +254,8 @@ module Autodoc
250
254
  end
251
255
 
252
256
  def payload
253
- string = ""
254
- string << " (#{assets.join(', ')})" if assets.any?
255
- string << " - #{validator.options[:description]}" if validator.options[:description]
257
+ string = assets.any? ? " (#{assets.join(', ')})" : ""
258
+ string += " - #{validator.options[:description]}" if validator.options[:description]
256
259
  string
257
260
  end
258
261
 
@@ -23,7 +23,7 @@ module Autodoc
23
23
  def write_documents
24
24
  @table.each do |pathname, documents|
25
25
  pathname.parent.mkpath
26
- pathname.open("w") {|file| file << documents.map(&:render).join("\n").rstrip + "\n" }
26
+ pathname.open("w") {|file| file << documents.sort_by(&:line_number).map(&:render).join("\n").rstrip + "\n" }
27
27
  end
28
28
  end
29
29
 
@@ -1,3 +1,3 @@
1
1
  module Autodoc
2
- VERSION = "0.7.7"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -8,42 +8,6 @@ require "autodoc"
8
8
 
9
9
  module Dummy
10
10
  class Application < Rails::Application
11
- # Settings in config/environments/* take precedence over those specified here.
12
- # Application configuration should go into files in config/initializers
13
- # -- all .rb files in that directory are automatically loaded.
14
-
15
- # Custom directories with classes and modules you want to be autoloadable.
16
- # config.autoload_paths += %W(#{config.root}/extras)
17
-
18
- # Only load the plugins named here, in the order given (default is alphabetical).
19
- # :all can be used as a placeholder for all plugins not explicitly named.
20
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
-
22
- # Activate observers that should always be running.
23
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
-
25
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
- # config.time_zone = 'Central Time (US & Canada)'
28
-
29
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
- # config.i18n.default_locale = :de
32
-
33
- # Configure the default encoding used in templates for Ruby 1.9.
34
- config.encoding = "utf-8"
35
-
36
- # Configure sensitive parameters which will be filtered from the log file.
37
- config.filter_parameters += [:password]
38
-
39
- # Enable escaping HTML in JSON.
40
- config.active_support.escape_html_entities_in_json = true
41
-
42
- # Use SQL instead of Active Record's schema dumper when creating the database.
43
- # This is necessary if your schema can't be completely dumped by the schema dumper,
44
- # like if you have constraints or database-specific column types
45
- # config.active_record.schema_format = :sql
46
-
47
- config.active_record.sqlite3.represent_boolean_as_integer = true
11
+ config.load_defaults 7.0
48
12
  end
49
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-17 00:00:00.000000000 Z
11
+ date: 2025-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,62 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.3'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.3'
69
- - !ruby/object:Gem::Dependency
70
- name: rails
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 5.2.2
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 5.2.2
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: sqlite3
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 1.3.13
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 1.3.13
111
55
  description:
112
56
  email:
113
57
  - r7kamura@gmail.com