banana_docs 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,42 @@
1
+ body {
2
+ font-family: 'Ubuntu';
3
+ font-size: 15px;
4
+ }
5
+ code, pre { font-family: 'Ubuntu Mono';}
6
+ code {
7
+ color: #2E7A0B;
8
+ font-size: 13px;
9
+ padding: 1px 5px 3px 5px;
10
+ }
11
+ pre {
12
+ background-color: #333333;
13
+ color: #f0f0f0;
14
+ }
15
+ .nav {
16
+ font-size: 13px;
17
+ }
18
+ h5 { font-size: 16px; }
19
+
20
+ .label, .badge {
21
+ line-height: 15px;
22
+ }
23
+
24
+ .table .label-inverse {
25
+ background-color: #535353;
26
+ }
27
+
1
28
  .container { width: 80%; margin: 50px auto; }
2
- .fixed { position: fixed; right: 10%; }
29
+ .fixed { position: fixed; right: 10%; }
30
+
31
+ hr { border-top: 1px solid #DDD; }
32
+
33
+ span.response {
34
+ font-weight: bold;
35
+ font-size: 14px;
36
+ }
37
+
38
+ span.response i.icon-chevron-right {
39
+ position: relative;
40
+ left: -3px;
41
+ top: 2px;
42
+ }
@@ -5,7 +5,7 @@ class BananaDocs::Helpers
5
5
  include ActionView::Helpers::TagHelper
6
6
  include ActionView::Helpers::UrlHelper
7
7
 
8
- FIXED_COLUMNS = ['Parâmetro', 'Descrição', 'Tipo', 'Formato', 'Observações', 'Requerido?']
8
+ FIXED_COLUMNS = ['Parâmetro', 'Descrição', 'Tipo', 'Formato', 'Observações', 'Obrigatório?']
9
9
 
10
10
  def initialize
11
11
  @navigations = []
@@ -26,7 +26,7 @@ class BananaDocs::Helpers
26
26
  end
27
27
 
28
28
  def action(title, options)
29
- content_tag(:h5, encode("Ação: #{title}")) +
29
+ content_tag(:h5, encode(title)) +
30
30
  content_tag(:code, "#{options[:method]} #{options[:url]}") +
31
31
  content_tag(:br)
32
32
  end
@@ -43,10 +43,10 @@ class BananaDocs::Helpers
43
43
  end
44
44
 
45
45
  def param(name, description, type, format, options = {})
46
- obs = options[:obs].nil? ? 'Sem observações' : options[:obs]
47
- required, clazz = options[:required] ? ['Sim', 'badge badge-warning'] : ['Não', 'badge badge-info']
46
+ obs = options[:obs].nil? ? '-' : options[:obs]
47
+ required, clazz = options[:required] ? ['Sim', 'badge badge-important'] : ['Não', 'badge badge-info']
48
48
  content_tag(:tr) do
49
- content_tag(:td, build_span(name, 'badge badge-default')) +
49
+ content_tag(:td, build_span(name, 'label label-inverse')) +
50
50
  content_tag(:td, encode(description)) +
51
51
  content_tag(:td, encode(type)) +
52
52
  content_tag(:td, encode(format)) +
@@ -78,9 +78,8 @@ class BananaDocs::Helpers
78
78
  end
79
79
 
80
80
  def response(&block)
81
- content_tag(:hr).html_safe +
82
81
  content_tag(:div) do
83
- content_tag(:span, 'Exemplos de respostas', class: 'badge badge-info').html_safe +
82
+ content_tag(:span, content_tag(:i, "", class: 'icon-chevron-right').html_safe + 'Exemplos de respostas', class: 'response') +
84
83
  content_tag(:br) +
85
84
  yield.html_safe
86
85
  end
@@ -97,12 +96,12 @@ class BananaDocs::Helpers
97
96
  end
98
97
 
99
98
  def key_value(key, value, show_keys = true)
100
- value = value.starts_with?('[') ? value : "\"#{value}\""
101
- (show_keys ? "{ \"#{key}\":#{value} }" : "\"#{key}\": #{value}, ").html_safe
99
+ value = value.starts_with?('[') ? encode(value) : "\"#{encode value}\""
100
+ (show_keys ? "{ \"#{encode key}\":#{encode value} }" : "\"#{encode key}\": #{encode value}, ").html_safe
102
101
  end
103
102
 
104
103
  def key_with_block(key, &block)
105
- "{ \"#{key}\": { #{yield} } }".html_safe
104
+ "{ \"#{encode key}\": { #{yield} } }".html_safe
106
105
  end
107
106
 
108
107
  def empty
@@ -1,3 +1,3 @@
1
1
  module BananaDocs
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banana_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: