bullet_train-api 1.6.35 → 1.6.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/api/open_api_helper.rb +16 -0
- data/lib/bullet_train/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1722bad9e3428906554dbe8f5322b6a13b9cce47ba0791b50dd30e1090b4e6fc
|
4
|
+
data.tar.gz: 4a26cbf29a27ada2172d097e5496bcfefeefea66a170a895760311bf816579cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50c4ccc7f92b826554ee805f70aa9eb8cc8b65194d6abfbfb4f88bcc13aa1a5b4d494fd004846f24a9a4261d9d72332f6f20a0516deb380ed91e664765fe59b
|
7
|
+
data.tar.gz: 13ccb3a89a16f1acbacb66da97348071646a71888835061d19d46fc2e10c1f35a2852c6e34a6598036331cb34519addd692755eb7372bf84274874e73dc063f2
|
@@ -131,6 +131,22 @@ module Api
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
+
def external_doc(filename)
|
135
|
+
caller_path, line_number = caller.find { |line| line.include?(".yaml.erb:") }.split(":")
|
136
|
+
indentation = File.readlines(caller_path)[line_number.to_i - 1].match(/^(\s*)/)[1]
|
137
|
+
path = "app/views/api/#{@version}/open_api/docs/#{filename}.md"
|
138
|
+
|
139
|
+
raise "Markdown file not found: #{path}" unless File.exist?(path)
|
140
|
+
|
141
|
+
File.read(path).lines.map { |line| " #{indentation}#{line}".rstrip }.join("\n").prepend("|\n").html_safe
|
142
|
+
rescue Errno::ENOENT, Errno::EACCES, RuntimeError => e
|
143
|
+
"Error loading markdown description: #{e.message}"
|
144
|
+
end
|
145
|
+
|
146
|
+
def description_for(model)
|
147
|
+
external_doc "#{model.name.underscore}_description"
|
148
|
+
end
|
149
|
+
|
134
150
|
private
|
135
151
|
|
136
152
|
def has_strong_parameters?(controller)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|