docs_api 0.0.3 → 0.0.4

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: 7d81c63260bf847a66a56c297c3486510d3ee4348bfba3dd539ba3d0dcec4f1c
4
- data.tar.gz: 0c66680a6615dffd2c34344718181c0d7a7dcdd1bf717c213735f95603c374c1
3
+ metadata.gz: da9991deb15eae7e90ea47c66053f9f760500dbffc0e11fbf428df4f588e6540
4
+ data.tar.gz: f04f6ad8cd08e3552b0213bbbf64df92c70799867c47384148cb7c198915f526
5
5
  SHA512:
6
- metadata.gz: d7099df07584103a9463dfb4313a23ec0258c580da95c1d5d311417e8fcda22bcc41f2ea52af9fc15c27a3b5c363cab6b2c25603844be9b789165b2639707efd
7
- data.tar.gz: 80886c27f4a1ccf1a6833f34ae381b9998c76483f8545122aa6f978ba76d34b8a7936eff33baaef81b393613560360b72e7d4c222c3260d0a4cb5fc58fbe5af2
6
+ metadata.gz: fb83abe6c7c452e587706c134585d57f3abef70d0ee96315bd9de6519cef792c47805de1ca21c272707dcec8a78e789b6f2e4897812c9a3a0b0722c9ba0fe9c2
7
+ data.tar.gz: ca1404f75076100eced273929ee30bc5ef4265b69ccf0b2932100ac973d9a28a095961acd81e749573f759068be5389e735220cc39d2c5b9febeb4a09a34ba44
@@ -15,10 +15,18 @@ module DocsApi
15
15
  raise ActiveRecord::RecordNotFound if docs.blank?
16
16
 
17
17
  url = request.protocol + request.host_with_port
18
- @api_text = "FORMAT: 1A\nHOST: #{url}\n# #{url}\nAPI doc\n"
18
+ @api_text = "FORMAT: 1A\nHOST: #{url}\n# API: #{url}\n"
19
+ intro_path = Rails.root.join('app', 'docs', params[:id], '_introduction.md')
20
+
21
+ @api_text += if File.exists?(intro_path)
22
+ File.read(intro_path)
23
+ else
24
+ 'API doc'
25
+ end
26
+ @api_text += "\n\n"
19
27
 
20
28
  docs.sort_by { |d| d.split('/').last }.each do |doc|
21
- @api_text += File.read(doc) + "\n"
29
+ @api_text += File.read(doc) + "\n" unless doc =~ /introduction.md\z/i
22
30
  end
23
31
  end
24
32
  end
@@ -1,3 +1,3 @@
1
1
  module DocsApi
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docs_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex M
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails