apipie-dsl 2.2.8 → 2.2.9

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: 4621977ecc3d0783dc21032bb8790fd1d2a1c7cc81635f91932813d1ce2a9148
4
- data.tar.gz: bb80ac4c8d298274fadf8edaf25d1ca77e98cb094d7d81f6e7fcb78db85318b5
3
+ metadata.gz: 06cfa92a5d84bc9ca6db419ec1948d66541b414a57a68cc5316c335142b98c8f
4
+ data.tar.gz: 5b2a03b6201ddcd2a61fd8e481be673a0383e06b012ba433f0b76cf266094f05
5
5
  SHA512:
6
- metadata.gz: 1d4c14f184ca3595052c95dfab5f2df1cd52bebddfc466dbe47eb43a13eb1d19ba680db6455d61c0d3ba3e776a3b7ee3fb3a78d4f0eb296c56da5931277cc2ff
7
- data.tar.gz: eb47d1566806421e25164d76ac6e3afb20d55733e4ae94bc358c5e24cf411b92f10829e9a960823a1f9a192d07aa83b23d675d3970be9ee5e20b98a6e3a1cef0
6
+ metadata.gz: f9684334d6aa6a515e4993601ca0b5f53187aebe2e64de43baad932f95abc51f5730945b8d81260baf61cc4af934b235d51bef161593334f4369111f9fc568e5
7
+ data.tar.gz: 77a23f53bb07eb0795a709f15b492e1cad04912770e0f32328092ba5cbe6cd1c70bc94f05564a05c97fa397daa8ac61ac9f44f6d0ab8fe9dd784364eebf4389d
@@ -12,8 +12,26 @@ module ApipieDslHelper
12
12
  end
13
13
  end
14
14
 
15
- def escaped_method_name(method, escaping = '')
16
- return method.gsub('?', escaping) if method.is_a?(String)
15
+ def escaped_method_name(method, options = {})
16
+ options[:escaping] ||= ''
17
+ options[:pattern] ||= /[?]/
18
+ return method.gsub(options[:pattern], options[:escaping]) if method.is_a?(String)
19
+ end
20
+
21
+ def apipie_dsl_menu
22
+ content_tag(:ul, class: 'breadcrumb') do
23
+ content = dsl_sections.map do |section|
24
+ content_tag(:li, class: section == @section ? 'active' : '') do
25
+ link_to(t("apipie_dsl.#{section}"), @doc[:doc_url] + section_ext(section) + @doc[:link_extension])
26
+ end
27
+ end.join(' | ').html_safe
28
+
29
+ unless ApipieDSL.configuration.help_layout.nil?
30
+ content += content_tag(:li, class: "pull-right #{'active' if @section == 'help'}") do
31
+ link_to(t("apipie_dsl.help"), @doc[:doc_url] + section_ext('help') + @doc[:link_extension])
32
+ end
33
+ end
34
+ end
17
35
  end
18
36
 
19
37
  def apipie_dsl_example(source, output = nil)
@@ -45,6 +63,8 @@ module ApipieDslHelper
45
63
  'nil'
46
64
  when ''
47
65
  "\"\""
66
+ when Symbol
67
+ ":#{default}"
48
68
  else
49
69
  default
50
70
  end
@@ -1,7 +1,7 @@
1
1
  <% if prop[:show] %>
2
2
  <tr>
3
3
  <td>
4
- <a href='<%= doc_url %><%= link_extension %>#link-description-<%= escaped_method_name(prop[:name], '_') %>'>
4
+ <a href='<%= doc_url %><%= link_extension %>#link-description-<%= escaped_method_name(prop[:name], escaping: '_') %>'>
5
5
  <%= prop[:name] %>
6
6
  </a>
7
7
  <% if prop[:deprecated] %>
@@ -8,7 +8,7 @@
8
8
  <div>
9
9
  <% (meth[:signature] || [method_signature(meth)]).each do |signature| %>
10
10
  <h2>
11
- <a href='#description-<%= escaped_method_name(meth[:name], '_') %>'
11
+ <a href='#description-<%= escaped_method_name(meth[:name], escaping: '_') %>'
12
12
  class='accordion-toggle'
13
13
  data-toggle='collapse'
14
14
  data-parent='#meth-accordion'>
@@ -29,7 +29,7 @@
29
29
  Also see <%= meth[:see].map { |s| link_to(s[:description] || s[:link], "#{s[:url]}#{link_extension}") }.to_sentence.html_safe %>.
30
30
  <% end %>
31
31
 
32
- <div id='description-<%= escaped_method_name(meth[:name], '_') %>' class='collapse accordion-body'>
32
+ <div id='description-<%= escaped_method_name(meth[:name], escaping: '_') %>' class='collapse accordion-body'>
33
33
  <%= render partial: 'method_detail', locals: { method: meth, h_level: 3 } %>
34
34
  </div>
35
35
  </td>
@@ -4,7 +4,7 @@
4
4
  <td>
5
5
  <div>
6
6
  <h2>
7
- <a id='link-description-<%= escaped_method_name(prop[:name], '_') %>' href='#description-<%= escaped_method_name(prop[:name], '_') %>'
7
+ <a id='link-description-<%= escaped_method_name(prop[:name], escaping: '_', pattern: /[?!]/) %>' href='#description-<%= escaped_method_name(prop[:name], escaping: '_', pattern: /[?!]/) %>'
8
8
  class='accordion-toggle'
9
9
  data-toggle='collapse'
10
10
  data-parent='#prop-accordion'>
@@ -15,7 +15,7 @@
15
15
  </h2>
16
16
  </div>
17
17
 
18
- <div id='description-<%= escaped_method_name(prop[:name], '_') %>' class='collapse accordion-body'>
18
+ <div id='description-<%= escaped_method_name(prop[:name], escaping: '_', pattern: /[?!]/) %>' class='collapse accordion-body'>
19
19
  <%= render partial: 'property_detail', locals: { property: prop, h_level: 3 } %>
20
20
  </div>
21
21
  </td>
@@ -1,18 +1,4 @@
1
- <ul class='breadcrumb'>
2
- <% dsl_sections.each do |section| %>
3
- <% if section == @section %>
4
- <li class='active'><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{@section}") %></a></li>
5
- <% else %>
6
- <li><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a></li>
7
- <% end %>
8
- <% end %>
9
- <% unless ApipieDSL.configuration.help_layout.nil? %>
10
- <li class='pull-right'>
11
- <% section = 'help' %>
12
- <a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a>
13
- </li>
14
- <% end %>
15
- </ul>
1
+ <%= apipie_dsl_menu %>
16
2
  <ul class='breadcrumb'>
17
3
  <li>
18
4
  <a href='<%= @doc[:doc_url] %><%= section_ext(@section) %><%= @doc[:link_extension] %>'><%= @doc[:name] %> <%= @klass[:version] %></a>
@@ -1,12 +1,4 @@
1
1
  <% if ApipieDSL.configuration.help_layout %>
2
- <ul class='breadcrumb'>
3
- <% dsl_sections.each do |section| %>
4
- <li><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a></li>
5
- <% end %>
6
- <li class='active pull-right'>
7
- <% section = 'help' %>
8
- <a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a>
9
- </li>
10
- </ul>
2
+ <%= apipie_dsl_menu %>
11
3
  <%= render_help %>
12
4
  <% end %>
@@ -1,18 +1,5 @@
1
- <ul class='breadcrumb'>
2
- <% dsl_sections.each do |section| %>
3
- <% if section == @section %>
4
- <li class='active'><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{@section}") %></a></li>
5
- <% else %>
6
- <li><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a></li>
7
- <% end %>
8
- <% end %>
9
- <% unless ApipieDSL.configuration.help_layout.nil? %>
10
- <li class='pull-right'>
11
- <% section = 'help' %>
12
- <a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a>
13
- </li>
14
- <% end %>
15
- </ul>
1
+ <%= apipie_dsl_menu %>
2
+
16
3
  <ul class='breadcrumb'>
17
4
  <li class='active'><a href='<%= @doc[:doc_url] %><%= section_ext(@section) %><%= @doc[:link_extension] %>'><%= @doc[:name] %> <%= current_version(@doc[:classes]) %></a></li>
18
5
  <%= render(partial: 'languages', locals: { doc_url: @doc[:doc_url] + section_ext(@section) }) %>
@@ -1,18 +1,4 @@
1
- <ul class='breadcrumb'>
2
- <% dsl_sections.each do |section| %>
3
- <% if section == @section %>
4
- <li class='active'><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{@section}") %></a></li>
5
- <% else %>
6
- <li><a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a></li>
7
- <% end %>
8
- <% end %>
9
- <% unless ApipieDSL.configuration.help_layout.nil? %>
10
- <li class='pull-right'>
11
- <% section = 'help' %>
12
- <a href='<%= @doc[:doc_url] %><%= section_ext(section) %><%= @doc[:link_extension] %>'><%= t("apipie_dsl.#{section}") %></a>
13
- </li>
14
- <% end %>
15
- </ul>
1
+ <%= apipie_dsl_menu %>
16
2
  <ul class='breadcrumb'>
17
3
  <li>
18
4
  <a href='<%= @doc[:doc_url] %><%= section_ext(@section) %><%= @doc[:link_extension] %>'><%= @doc[:name] %> <%= @klass[:version] %></a>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApipieDSL
4
- VERSION = '2.2.8'
4
+ VERSION = '2.2.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Fedorenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-07 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler