banana_docs 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a2717932252f4322d63198f1f2f9efc29aeff517
4
+ data.tar.gz: 5f870a37343468a76c5696843a11572b89ce8043
5
+ SHA512:
6
+ metadata.gz: 17d6607340a19989a424a5888c9ebbfdf43556767cafa8da084ab773275b27bfd4f20d05a29fed49565eba22513c62589c2fbec6a42a238effa8b1de9bc625ea
7
+ data.tar.gz: 86d3d773482f659e66d9911724a5df32bf9fdd0c1e0823fb24d0610ce1d3a452a0d4360b292793ca48453ced4ce51b7e854baf19e457a4e208aef0900abe4b34
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  This gem will provide a simple way to build documentation for API project
4
4
 
5
+ *This gem is not a generic gem yet.For while, it's specific for CDA-API project :(, sorry.*
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -16,19 +18,16 @@ Or install it yourself as:
16
18
 
17
19
  $ gem install banana_docs
18
20
 
19
- ## Usage()
20
-
21
- After install the gem in your project, by terminal execute:
22
-
23
- $ banana doc/main.slim public/documentation
21
+ ## Usage
24
22
 
25
- Open the file: doc/index.html and write your documentation, using gem helpers, and then run the command:
23
+ After install the gem in your project, you need to create a file where you will write you documentation.
24
+ For example, in folder ``doc`` create a file called ``index.slim``. Write your documentation using the gem's helpers.
25
+ And then, execute this in your terminal:
26
26
 
27
- $ banana doc/main.slim
27
+ $ banana doc/index.slim public/documentation
28
28
 
29
29
  This will generate documentation.
30
30
 
31
-
32
31
  ## Helpers
33
32
 
34
33
  To create a new section in documentation:
@@ -117,4 +116,18 @@ When some empty Array is returned from response:
117
116
  = code
118
117
  = key_with_block 'addresses'
119
118
  = empty
119
+ ```
120
+
121
+ To build your navigation menu (menu is based in all section itens):
122
+
123
+ > show_nav_menu
124
+ ```ruby
125
+ = show_nav_menu
126
+ ```
127
+
128
+ To include assets in header:
129
+
130
+ > include_assets
131
+ ```ruby
132
+ = include_assets
120
133
  ```
data/bin/banana CHANGED
@@ -22,17 +22,16 @@ input_file = ARGV[0] || 'doc/index.slim'
22
22
  output_dir = ARGV[1] || 'public/documentation'
23
23
 
24
24
  unless Dir.exists?(output_dir)
25
- puts " é burro cara... esse diretório #{output_dir} não existe! Como você é burro!"
26
- exit 1
25
+ puts "Creating folder: #{output_dir}"
26
+ Dir.mkdir output_dir
27
27
  end
28
28
 
29
29
  unless File.exists?(input_file)
30
- puts " é burro cara... esse arquivo #{input_file} não existe! Como você é burro!"
31
- exit 2
30
+ puts "Are you stupid? This file doesn't exists you newbie. Check the right file name and then run the command again."
31
+ exit 1
32
32
  end
33
33
 
34
34
  FileUtils.cp_r(File.join(banana_dir, 'assets'), output_dir)
35
-
36
35
  helpers = BananaDocs::Helpers.new
37
36
  output_file = File.join(output_dir, 'index.html')
38
37
  File.write(output_file, Slim::Template.new(input_file).render(helpers))
@@ -113,6 +113,10 @@ class BananaDocs::Helpers
113
113
  "..."
114
114
  end
115
115
 
116
+ def include_assets
117
+ render 'assets'
118
+ end
119
+
116
120
  def encode(string)
117
121
  @coder ||= HTMLEntities.new
118
122
  @coder.encode(string, :named).html_safe
@@ -1,3 +1,3 @@
1
1
  module BananaDocs
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banana_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Luiz Cezer
@@ -10,76 +9,67 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-11-22 00:00:00.000000000 Z
12
+ date: 2013-11-25 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: actionpack
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rspec
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: slim
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: htmlentities
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: bundler
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
74
  - - ~>
85
75
  - !ruby/object:Gem::Version
@@ -87,7 +77,6 @@ dependencies:
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
81
  - - ~>
93
82
  - !ruby/object:Gem::Version
@@ -95,17 +84,15 @@ dependencies:
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: rake
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  description: Simple gem to build documentation for CDA-API
@@ -142,27 +129,26 @@ files:
142
129
  homepage: https://github.com/lccezinha/banana_docs
143
130
  licenses:
144
131
  - MIT
132
+ metadata: {}
145
133
  post_install_message:
146
134
  rdoc_options: []
147
135
  require_paths:
148
136
  - lib
149
137
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
138
  requirements:
152
- - - ! '>='
139
+ - - '>='
153
140
  - !ruby/object:Gem::Version
154
141
  version: '0'
155
142
  required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
143
  requirements:
158
- - - ! '>='
144
+ - - '>='
159
145
  - !ruby/object:Gem::Version
160
146
  version: '0'
161
147
  requirements: []
162
148
  rubyforge_project:
163
- rubygems_version: 1.8.25
149
+ rubygems_version: 2.0.2
164
150
  signing_key:
165
- specification_version: 3
151
+ specification_version: 4
166
152
  summary: Gem used to provide a simple and nice way to write documentations for API
167
153
  applications. This gem is not a generic gem, for while, it's specific for CDA-API
168
154
  project :(.