yard-slipstream 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,6 +16,8 @@ tmtags
16
16
  ## PROJECT::GENERAL
17
17
  coverage
18
18
  rdoc
19
+ doc
20
+ .yardoc
19
21
  pkg
20
22
 
21
23
  ## PROJECT::SPECIFIC
data/Rakefile CHANGED
@@ -49,11 +49,19 @@ end
49
49
 
50
50
  task :default => :spec
51
51
 
52
- begin
53
- require 'yard'
54
- YARD::Rake::YardocTask.new
55
- rescue LoadError
56
- task :yardoc do
57
- abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
58
- end
52
+ require 'yard'
53
+ YARD::Rake::YardocTask.new do |t|
54
+ t.after = lambda { `touch doc/.nojekyll` }
55
+ end
56
+
57
+ Jeweler::GhpagesTasks.new do |ghpages|
58
+ ghpages.push_on_release = true
59
+ ghpages.set_repo_homepage = true
60
+ ghpages.user_github_com = false
61
+ ghpages.doc_task = "yard"
62
+ ghpages.keep_files = []
63
+ ghpages.map_paths = {
64
+ ".nojekyll" => "",
65
+ "doc" => "",
66
+ }
59
67
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,5 +1,26 @@
1
1
  dir = File.dirname(__FILE__)
2
2
  $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
3
3
 
4
+ require 'rubygems'
5
+ require 'yard/core_ext/symbol_hash'
6
+ require 'yard/templates/helpers/html_helper'
7
+
8
+ module YARD
9
+ module Templates
10
+ module Helpers
11
+ module HtmlHelper
12
+ def link_url(url, title = nil, params = {})
13
+ params = SymbolHash.new(false).update(
14
+ :href => url,
15
+ :title => h(title || url),
16
+ :target => "_self"
17
+ ).update(params)
18
+ "<a #{tag_attrs(params)}>#{title}</a>"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
4
25
  YARD::Templates::Engine.register_template_path dir + '/../templates'
5
26
 
@@ -20,7 +20,7 @@
20
20
  window.onload = frame_saver;
21
21
  </script>
22
22
  </head>
23
- <frameset cols="20%,*">
23
+ <frameset cols="20%,*" border="1" bordercolor="CCC">
24
24
  <frame name="list" src="class_list.html" />
25
25
  <frame name="main" />
26
26
  </frameset>
@@ -18,7 +18,7 @@ function createDefineLinks() {
18
18
  tHeight = $(this).parent().prev().height();
19
19
  $(this).prev().show();
20
20
  $(this).parent().prev().height($(this).parent().height());
21
- $(this).text("(less)");
21
+ $(this).text("...less");
22
22
  },
23
23
  function() {
24
24
  $(this).prev().hide();
@@ -1,6 +1,10 @@
1
1
  <div id="menu">
2
2
  <% if object.is_a?(CodeObjects::Base) && @file.nil? %>
3
- <a href="<%= url_for('object_index.html') %>"><% if object.root? || object.type == :method %>Index<% else %>Index (<%= object.name.to_s[0,1] %>)<% end %></a> &raquo;
3
+ <% if object.root? || object.type == :method %>
4
+ <%= link_url('object_index.html', 'Index') %>
5
+ <% else %>
6
+ <%= link_url('object_index.html', "Index (#{object.name.to_s[0,1]})") %>
7
+ <% end %> &raquo;
4
8
  <%= @breadcrumb.map {|obj| "<span class='title'>" + linkify(obj, obj.name) + "</span>" }.join(" &raquo; ") %>
5
9
  <%= @breadcrumb.size > 0 ? " &raquo; " : "" %>
6
10
  <span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
@@ -10,6 +10,7 @@
10
10
  relpath = '<%= url_for('') %>';
11
11
  if (relpath != '') relpath += '/';
12
12
  </script>
13
+ <base id="base_target" target="_top" />
13
14
  <script type="text/javascript" charset="utf-8" src="<%= url_for("js/jquery.js") %>"></script>
14
15
  <script type="text/javascript" charset="utf-8" src="<%= url_for("js/autocomplete.js") %>"></script>
15
16
  <script type="text/javascript" charset="utf-8" src="<%= url_for("js/app.js") %>"></script>
@@ -1,22 +1,6 @@
1
1
  <% n = 1 %>
2
2
  <div id="info_box">
3
3
  <dl class="box">
4
- <!-- <% if CodeObjects::ClassObject === object && object.superclass %>
5
- <dt class="r<%=n%>">Inherits:</dt>
6
- <dd class="r<%=n%>">
7
- <span class="inheritName"><%= linkify object.superclass %></span>
8
- <% if object.superclass.name != :BasicObject %>
9
- <ul class="fullTree">
10
- <li><%= linkify P(:Object) %></li>
11
- <% object.inheritance_tree.reverse.each_with_index do |obj, i| %>
12
- <li class="next"><%= obj == object ? obj.path : linkify(obj) %></li>
13
- <% end %>
14
- </ul>
15
- <a href="#" class="inheritanceTree">show all</a>
16
- <% end %>
17
- </dd>
18
- <% n = 2 %>
19
- <% end %> -->
20
4
  <% [[:class, "Extends"], [:instance, "Includes"]].each do |scope, name| %>
21
5
  <% if (mix = object.mixins(scope)).size > 0 %>
22
6
  <dt class="r<%=n%>"><%= name %>:</dt>
@@ -29,10 +13,10 @@
29
13
  <dd class="r<%=n%>"><%= mixed_into.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
30
14
  <% n = n == 2 ? 1 : 2 %>
31
15
  <% end %>
32
- <% unless object.root? %>
33
- <dt class="r<%=n%> last">Defined in:</dt>
34
- <dd class="r<%=n%> last"><%= erb(:defines) %></dd>
35
- <% end %>
16
+ <dt class="r<%=n%> last">Defined in:</dt>
17
+ <dd class="r<%=n%> last">
18
+ <%= erb(:defines) %>
19
+ </dd>
36
20
  </dl>
37
21
  </div>
38
22
  <div class="clear"></div>
@@ -0,0 +1,8 @@
1
+ <% if object.root? %>
2
+ <%= child_files[0].first %><% if child_files.size > 1 %><span class="defines">,<br />
3
+ <%= child_files[1..-1].map {|f| f.first }.join(",<br /> ") %></span><% end %>
4
+ <% else %>
5
+ <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
6
+ <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></span>
7
+ <% else %><span class="defines">,<br /></span><% end %>
8
+ <% end %>
@@ -16,6 +16,24 @@ def init
16
16
  :method_details_list, [T('method_details')]
17
17
  end
18
18
 
19
+ def uniq_by(array, &blk)
20
+ require 'set'
21
+ result = []
22
+ values = Set.new
23
+ array.each do |elem|
24
+ value = yield elem
25
+ unless values.include? value
26
+ values << value
27
+ result << elem
28
+ end
29
+ end
30
+ result
31
+ end
32
+
33
+ def child_files
34
+ @child_files ||= uniq_by(object.children.map { |child| child.files }.flatten(1)) {|f| f.first}
35
+ end
36
+
19
37
  def localmethods(include_specials = true)
20
38
  method_listing(include_specials)
21
39
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{yard-slipstream}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dreamcat4"]
12
- s.date = %q{2010-04-10}
12
+ s.date = %q{2010-04-11}
13
13
  s.description = %q{yard-slipstream is a yard plugin for Yard-0.5.3 and higher. Slipstream gives users an option for faster page navigation in their yard documents. We just want to optimize the most frequent lookups and remove any duplicate info. Other than that its just plain straight Yard, with all the same "look and feel" as the default template.}
14
14
  s.email = %q{dreamcat4@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
53
53
  "templates/default/module/html/attribute_summary.erb",
54
54
  "templates/default/module/html/box_info.erb",
55
55
  "templates/default/module/html/children.erb",
56
+ "templates/default/module/html/defines.erb",
56
57
  "templates/default/module/html/local_methods.erb",
57
58
  "templates/default/module/setup.rb",
58
59
  "yard-slipstream.gemspec"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dreamcat4
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-10 00:00:00 +01:00
17
+ date: 2010-04-11 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -125,6 +125,7 @@ files:
125
125
  - templates/default/module/html/attribute_summary.erb
126
126
  - templates/default/module/html/box_info.erb
127
127
  - templates/default/module/html/children.erb
128
+ - templates/default/module/html/defines.erb
128
129
  - templates/default/module/html/local_methods.erb
129
130
  - templates/default/module/setup.rb
130
131
  - yard-slipstream.gemspec