yard-padrino 0.0.1 → 0.0.2

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.
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module Padrino
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -0,0 +1,22 @@
1
+ <li><span class="object_link"><a title=""></a></span>Routing</li>
2
+ <ul>
3
+ <% n = 1 %>
4
+ <% @routes.each do |item| %>
5
+ <li class="r<%= n %> <%= item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
6
+ <%= linkify item, h(item.display_name) %>
7
+ <small><% if item.controller.to_s.empty? %>Global;<% else %>Controller "<%= item.controller %>";<% end %> <% if item.namespace && !item.namespace.root? %><%= item.namespace %><% else %>Top Level<% end %></small>
8
+ </li>
9
+ <% n = n == 2 ? 1 : 2 %>
10
+ <% end %>
11
+ </ul>
12
+ <li><span class="object_link"><a title=""></a></span>Handlers</li>
13
+ <ul>
14
+ <% n = 1 %>
15
+ <% @handlers.each do |item| %>
16
+ <li class="r<%= n %> <%= item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
17
+ <%= linkify item, h(item.display_name) %>
18
+ <small><% if item.controller.to_s.empty? %>Global;<% else %>Controller "<%= item.controller %>";<% end %> <% if item.namespace && !item.namespace.root? %><%= item.namespace %><% else %>Top Level<% end %></small>
19
+ </li>
20
+ <% n = n == 2 ? 1 : 2 %>
21
+ <% end %>
22
+ </ul>
@@ -0,0 +1,7 @@
1
+ def generate_padrino_handler_list
2
+ @routes = Registry.all(:padrino_route).sort
3
+ @handlers = Registry.all(:padrino_handler).sort
4
+ @list_title = 'Padrino Handler List'
5
+ @list_type = 'padrino_handler'
6
+ generate_list_contents
7
+ end
@@ -0,0 +1,17 @@
1
+ def menu_lists
2
+ list = super
3
+
4
+ item = { :type => 'padrino_handler', :title => 'Padrino Handler', :search_title => 'Padrino Handler List' }
5
+
6
+ at = -1
7
+ list.each_with_index do |item, i|
8
+ if item[:type] == 'file'
9
+ at = i
10
+ break
11
+ end
12
+ end
13
+
14
+ list[at, 0] = item
15
+
16
+ list
17
+ end
@@ -0,0 +1,19 @@
1
+ <li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
2
+ <span class="summary_signature">
3
+ <%= signature_for_padrino_handler(@item) %>
4
+ </span>
5
+ <% if object != @item.namespace %>
6
+ <span class="note title not_defined_here">
7
+ included
8
+ from <%= linkify @item, object.relative_path(@item.namespace) %>
9
+ </span>
10
+ <% end %>
11
+ <% if @item.has_tag?(:deprecated) %><span class="deprecated note title">deprecated</span><% end %>
12
+ <% if @item.has_tag?(:api) && @item.tag(:api).text == 'private' %><span class="private note title">private</span><% end %>
13
+
14
+ <% if @item.has_tag?(:deprecated) %>
15
+ <span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line @item.tag(:deprecated).text %></span>
16
+ <% else %>
17
+ <span class="summary_desc"><%= htmlify_line docstring_summary(@item) %></span>
18
+ <% end %>
19
+ </li>
@@ -0,0 +1,17 @@
1
+ <% if padrino_handlers.size > 0 %>
2
+ <div id="padrino_handlers_details" class="method_details_list">
3
+ <h2>Padrino Handlers Details</h2>
4
+ <% padrino_handlers_listing.each do |item| %>
5
+ <h3>
6
+ <% if item[:controller].empty? %>
7
+ Global Controller
8
+ <% else %>
9
+ Controller <%= h(item[:controller]) %>
10
+ <% end %>
11
+ </h3>
12
+ <% item[:handlers].each_with_index do |handler, i| %>
13
+ <%= yieldall :object => handler, :owner => object, :index => i %>
14
+ <% end %>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% if padrino_handlers.size > 0 %>
2
+ <h2>
3
+ Padrino Handlers Summary
4
+ </h2>
5
+ <% padrino_handlers_listing.each do |item| %>
6
+ <h3>
7
+ <% if item[:controller].empty? %>
8
+ Global Controller
9
+ <% else %>
10
+ Controller <%= h(item[:controller]) %>
11
+ <% end %>
12
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
13
+ </h3>
14
+ <ul class="summary">
15
+ <% item[:handlers].each do |handler| %>
16
+ <%= yieldall :item => handler %>
17
+ <% end %>
18
+ </ul>
19
+ <% end %>
20
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <% if padrino_routes.size > 0 %>
2
+ <div id="padrino_routes_details" class="method_details_list">
3
+ <h2>Padrino Routing Details</h2>
4
+ <% padrino_routes_listing.each do |item| %>
5
+ <h3>
6
+ <% if item[:controller].empty? %>
7
+ Global Controller
8
+ <% else %>
9
+ Controller <%= h(item[:controller]) %>
10
+ <% end %>
11
+ </h3>
12
+ <% item[:routes].each_with_index do |route, i| %>
13
+ <%= yieldall :object => route, :owner => object, :index => i %>
14
+ <% end %>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% if padrino_routes.size > 0 %>
2
+ <h2>
3
+ Padrino Routing Summary
4
+ </h2>
5
+ <% padrino_routes_listing.each do |item| %>
6
+ <h3>
7
+ <% if item[:controller].empty? %>
8
+ Global Controller
9
+ <% else %>
10
+ Controller <%= h(item[:controller]) %>
11
+ <% end %>
12
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
13
+ </h3>
14
+ <ul class="summary">
15
+ <% item[:routes].each do |route| %>
16
+ <%= yieldall :item => route %>
17
+ <% end %>
18
+ </ul>
19
+ <% end %>
20
+ <% end %>
@@ -0,0 +1,75 @@
1
+ def init
2
+ super
3
+
4
+ padrino_summaries = [
5
+ :padrino_routes_summary, [ :padrino_handler_summary ],
6
+ :padrino_handlers_summary, [ :padrino_handler_summary ],
7
+ ]
8
+ padrino_details = [
9
+ :padrino_routes_details_list, [T('padrino_handler_details')],
10
+ :padrino_handlers_details_list, [T('padrino_handler_details')],
11
+ ]
12
+
13
+ sections.place(padrino_summaries).before(:method_summary)
14
+ sections.place(padrino_details).before(:method_details_list)
15
+ end
16
+
17
+ def padrino_routes
18
+ unless @routes
19
+ @routes = object.children.select { |o| o.is_a?(YARD::Padrino::RouteObject) }.sort
20
+ end
21
+
22
+ @routes
23
+ end
24
+
25
+ def padrino_handlers
26
+ unless @handlers
27
+ @handlers = object.children.select { |o| o.is_a?(YARD::Padrino::GeneralHandlerObject) }.sort
28
+ end
29
+
30
+ @handlers
31
+ end
32
+
33
+ def padrino_routes_listing
34
+ unless @routes_listing
35
+ routes = padrino_routes
36
+ methods = {}
37
+ routes.each do |route|
38
+ controller = (route.controller || "").to_s
39
+ methods[controller] ||= []
40
+ methods[controller] << route
41
+ end
42
+
43
+ @routes_listing = []
44
+ methods.keys.sort.each do |controller|
45
+ @routes_listing << {
46
+ controller: controller,
47
+ routes: methods[controller]
48
+ }
49
+ end
50
+ end
51
+
52
+ @routes_listing
53
+ end
54
+
55
+ def padrino_handlers_listing
56
+ unless @handlers_listing
57
+ handlers = padrino_handlers
58
+ methods = {}
59
+ handlers.each do |handler|
60
+ controller = (handler.controller || "").to_s
61
+ methods[controller] ||= []
62
+ methods[controller] << handler
63
+ end
64
+
65
+ @handlers_listing = []
66
+ methods.keys.sort.each do |controller|
67
+ @handlers_listing << {
68
+ controller: controller,
69
+ handlers: methods[controller]
70
+ }
71
+ end
72
+ end
73
+
74
+ @handlers_listing
75
+ end
@@ -0,0 +1,3 @@
1
+ <div class="method_details <%= @index == 0 ? 'first' : '' %>">
2
+ <%= yieldall %>
3
+ </div>
@@ -0,0 +1,3 @@
1
+ <h3 class="signature <%= 'first' if @index == 0 %>" id="<%= anchor_for(object) %>">
2
+ <%= signature_for_padrino_handler(object) %>
3
+ </h3>
@@ -0,0 +1,10 @@
1
+ <table class="source_code">
2
+ <tr>
3
+ <td>
4
+ <pre class="lines"><%= "\n\n\n" %><%= h format_lines(object) %></pre>
5
+ </td>
6
+ <td>
7
+ <pre class="code"><span class="info file"># File '<%= h object.file %>'<% if object.line %>, line <%= object.line %><% end %></span><%= "\n\n" %><%= html_syntax_highlight object.source %></pre>
8
+ </td>
9
+ </tr>
10
+ </table>
@@ -0,0 +1,8 @@
1
+ def init
2
+ sections :header, [:method_signature, T('docstring'), :source]
3
+ end
4
+
5
+ def source
6
+ return if object.source.nil?
7
+ erb(:source)
8
+ end
data/yard-padrino.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["daydream.trippers@gmail.com"]
11
11
  spec.description = %q{YARD plugin for Padrino controllers.}
12
12
  spec.summary = %q{YARD plugin for Padrino controllers.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/dayflower/yard-padrino"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = [
@@ -22,6 +22,19 @@ Gem::Specification.new do |spec|
22
22
  "lib/yard-padrino.rb",
23
23
  "lib/yard/padrino/version.rb",
24
24
  "lib/yard/padrino.rb",
25
+ "templates/default/fulldoc/html/full_list_padrino_handler.erb",
26
+ "templates/default/fulldoc/html/setup.rb",
27
+ "templates/default/layout/html/setup.rb",
28
+ "templates/default/module/html/padrino_handler_summary.erb",
29
+ "templates/default/module/html/padrino_handlers_details_list.erb",
30
+ "templates/default/module/html/padrino_handlers_summary.erb",
31
+ "templates/default/module/html/padrino_routes_details_list.erb",
32
+ "templates/default/module/html/padrino_routes_summary.erb",
33
+ "templates/default/module/setup.rb",
34
+ "templates/default/padrino_handler_details/html/header.erb",
35
+ "templates/default/padrino_handler_details/html/method_signature.erb",
36
+ "templates/default/padrino_handler_details/html/source.erb",
37
+ "templates/default/padrino_handler_details/setup.rb",
25
38
  ]
26
39
 
27
40
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-padrino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-16 00:00:00.000000000 Z
12
+ date: 2013-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -74,7 +74,20 @@ files:
74
74
  - lib/yard-padrino.rb
75
75
  - lib/yard/padrino/version.rb
76
76
  - lib/yard/padrino.rb
77
- homepage: ''
77
+ - templates/default/fulldoc/html/full_list_padrino_handler.erb
78
+ - templates/default/fulldoc/html/setup.rb
79
+ - templates/default/layout/html/setup.rb
80
+ - templates/default/module/html/padrino_handler_summary.erb
81
+ - templates/default/module/html/padrino_handlers_details_list.erb
82
+ - templates/default/module/html/padrino_handlers_summary.erb
83
+ - templates/default/module/html/padrino_routes_details_list.erb
84
+ - templates/default/module/html/padrino_routes_summary.erb
85
+ - templates/default/module/setup.rb
86
+ - templates/default/padrino_handler_details/html/header.erb
87
+ - templates/default/padrino_handler_details/html/method_signature.erb
88
+ - templates/default/padrino_handler_details/html/source.erb
89
+ - templates/default/padrino_handler_details/setup.rb
90
+ homepage: https://github.com/dayflower/yard-padrino
78
91
  licenses:
79
92
  - MIT
80
93
  post_install_message:
@@ -89,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
102
  version: '0'
90
103
  segments:
91
104
  - 0
92
- hash: -1963093461128883186
105
+ hash: 4358559917686168360
93
106
  required_rubygems_version: !ruby/object:Gem::Requirement
94
107
  none: false
95
108
  requirements:
@@ -98,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
111
  version: '0'
99
112
  segments:
100
113
  - 0
101
- hash: -1963093461128883186
114
+ hash: 4358559917686168360
102
115
  requirements: []
103
116
  rubyforge_project:
104
117
  rubygems_version: 1.8.23