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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d38bed5c3657ba9db0ae2e8de9e6ce07ddf4062d61a86f4dd0e9ffd65a0bdd1
4
- data.tar.gz: a6eaaa72fe09b42400974d97f96ae5f74efe2e430b28506c3e6d0212b19c43b7
3
+ metadata.gz: 1722bad9e3428906554dbe8f5322b6a13b9cce47ba0791b50dd30e1090b4e6fc
4
+ data.tar.gz: 4a26cbf29a27ada2172d097e5496bcfefeefea66a170a895760311bf816579cf
5
5
  SHA512:
6
- metadata.gz: 699caa09b6c2f86d13dca8192a37ee586a86f69a427873758b7f3754ca814428d2f66e4419d1aa82d41c4e6d22f49fa91a001e8bc44f13456aed3f8687b80608
7
- data.tar.gz: 01fc8825a49e2955f588461b90b1bcb78436161fa6f6f287a48f6e77db3ad91039b4a5778eb15ec3676366ba98af1007e99ec8b8afcba6cf3e486543ab8d7c0b
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)
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Api
3
- VERSION = "1.6.35"
3
+ VERSION = "1.6.36"
4
4
  end
5
5
  end
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.35
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-01 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard