yardocco 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Add dependencies to develop your gem here.
4
+ # Include everything needed to run rake, tests, features, etc.
5
+ group :development do
6
+ gem "bundler", "~> 1.0.0"
7
+ gem "jeweler", "~> 1.5.2"
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ git (1.2.5)
5
+ jeweler (1.5.2)
6
+ bundler (~> 1.0.0)
7
+ git (>= 1.2.5)
8
+ rake
9
+ rake (0.8.7)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.0.0)
16
+ jeweler (~> 1.5.2)
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Andrew Rudenko
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = yardocco
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to yardocco
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Andrew Rudenko. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "yardocco"
16
+ gem.homepage = "http://github.com/prepor/yardocco"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Docco-style YARD template}
19
+ gem.description = %Q{Docco-style YARD template}
20
+ gem.email = "ceo@prepor.ru"
21
+ gem.authors = ["Andrew Rudenko"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
data/lib/yardocco.rb ADDED
@@ -0,0 +1 @@
1
+ YARD::Templates::Engine.register_template_path Pathname.new(File.dirname(__FILE__)).join('..', 'templates')
@@ -0,0 +1,27 @@
1
+ <style type="text/css" media="screen">
2
+ <%= @stylesheet %>
3
+ </style>
4
+ <div class="murdoc_wrapper">
5
+ <div class="murdoc">
6
+ <% @annotations.each do |a| %>
7
+ <% need_line, need_method = @definitions.shift %>
8
+ <% a.paragraphs.each do |p| %>
9
+ <% unless p.annotation.empty? %>
10
+ <section><%= htmlify Docstring.new(p.annotation) %></section>
11
+ <% end %>
12
+ <% unless p.source.empty? %>
13
+ <figure>
14
+ <ol>
15
+ <% 1.upto(p.source.split("\n").size) do |i| %>
16
+ <li<% if i + p.starting_line == need_line %>
17
+ id="<%= anchor_for(need_method) %>"
18
+ <% need_line, need_method = @definitions.shift; end %>> <%= i + p.starting_line %> </li>
19
+ <% end %>
20
+ </ol>
21
+ <code><%= p.formatted_source %></code>
22
+ </figure>
23
+ <% end %>
24
+ <% end %>
25
+ <% end %>
26
+ </div>
27
+ </div>
@@ -0,0 +1,147 @@
1
+ .murdoc {
2
+ min-height: 100%;
3
+ line-height: 1.5; }
4
+
5
+ .murdoc p, .murdoc h1, .murdoc h2, .murdoc h3, .murdoc ol, .murdoc li, .murdoc ul, .murdoc dt, .murdoc dd, .murdoc dl, .murdoc {
6
+ padding: 0;
7
+ margin: 0; }
8
+
9
+ .murdoc {
10
+ width: 40%;
11
+ padding-left: 2.5%;
12
+ padding-right: 2.5%;
13
+ background: #ffffff;
14
+ font-family: Helvetica; }
15
+ .murdoc:after {
16
+ content: ".";
17
+ font-size: 0.01em;
18
+ line-height: 0.01em;
19
+ display: block;
20
+ clear: both; }
21
+
22
+ .murdoc figure#relations h2 ~ h2 {
23
+ margin-top: 1.5em; }
24
+
25
+ .murdoc > * {
26
+ padding-left: 6%;
27
+ padding-right: 6%; }
28
+
29
+ .murdoc_wrapper {
30
+ background: #F5F5FF; }
31
+
32
+ .murdoc section {
33
+ float: left;
34
+ clear: both;
35
+ width: 88%;
36
+ overflow: auto; }
37
+
38
+ .murdoc p {
39
+ margin-top: 1.5em; }
40
+
41
+ .murdoc ol, .murdoc li {
42
+ margin-left: 1em; }
43
+
44
+ .murdoc > p, .murdoc > h1, .murdoc > h2 {
45
+ clear: left; }
46
+
47
+ .murdoc dl {
48
+ clear: left; }
49
+ .murdoc dl dt, .murdoc dl dd {
50
+ float: left; }
51
+ .murdoc dl dt {
52
+ clear: left; }
53
+ .murdoc dl dd {
54
+ margin-left: 1em; }
55
+
56
+ .murdoc figure {
57
+ display: block;
58
+ float: right;
59
+ margin-right: -140%;
60
+ width: 122.75%;
61
+ clear: right;
62
+ padding: 1.5em 5% 3em; }
63
+ .murdoc figure > ol {
64
+ text-shadow: 0 1px 0 #FFDE40;
65
+ -moz-text-shadow: 0 1px 0 #FFDE40;
66
+ -webkit-text-shadow: 0 1px 0 #FFDE40;
67
+ width: 7.5%;
68
+ text-align: right;
69
+ float: left;
70
+ font-size: 1em;
71
+ -webkit-border-radius: 0.2em;
72
+ background: rgba(166, 137, 0, 0.1);
73
+ border: 1px solid rgba(0, 0, 0, 0.3);
74
+ list-style: none;
75
+ margin-left: -9.25%; }
76
+ .murdoc figure > ol li {
77
+ margin: 0; }
78
+ .murdoc figure > code, figure > ol {
79
+ font-size: 1em;
80
+ font-family: monospace; }
81
+ .murdoc figure > code {
82
+ white-space: pre; }
83
+
84
+ /*---------------------- Syntax Highlighting -----------------------------*/
85
+ td.linenos { background-color: #f0f0f0; padding-right: 10px; }
86
+ span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
87
+ body .hll { background-color: #ffffcc }
88
+ body .c { color: #408080; font-style: italic } /* Comment */
89
+ body .err { border: 1px solid #FF0000 } /* Error */
90
+ body .k { color: #954121 } /* Keyword */
91
+ body .o { color: #666666 } /* Operator */
92
+ body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
93
+ body .cp { color: #BC7A00 } /* Comment.Preproc */
94
+ body .c1 { color: #408080; font-style: italic } /* Comment.Single */
95
+ body .cs { color: #408080; font-style: italic } /* Comment.Special */
96
+ body .gd { color: #A00000 } /* Generic.Deleted */
97
+ body .ge { font-style: italic } /* Generic.Emph */
98
+ body .gr { color: #FF0000 } /* Generic.Error */
99
+ body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
100
+ body .gi { color: #00A000 } /* Generic.Inserted */
101
+ body .go { color: #808080 } /* Generic.Output */
102
+ body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
103
+ body .gs { font-weight: bold } /* Generic.Strong */
104
+ body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
105
+ body .gt { color: #0040D0 } /* Generic.Traceback */
106
+ body .kc { color: #954121 } /* Keyword.Constant */
107
+ body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
108
+ body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
109
+ body .kp { color: #954121 } /* Keyword.Pseudo */
110
+ body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
111
+ body .kt { color: #B00040 } /* Keyword.Type */
112
+ body .m { color: #666666 } /* Literal.Number */
113
+ body .s { color: #219161 } /* Literal.String */
114
+ body .na { color: #7D9029 } /* Name.Attribute */
115
+ body .nb { color: #954121 } /* Name.Builtin */
116
+ body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
117
+ body .no { color: #880000 } /* Name.Constant */
118
+ body .nd { color: #AA22FF } /* Name.Decorator */
119
+ body .ni { color: #999999; font-weight: bold } /* Name.Entity */
120
+ body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
121
+ body .nf { color: #0000FF } /* Name.Function */
122
+ body .nl { color: #A0A000 } /* Name.Label */
123
+ body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
124
+ body .nt { color: #954121; font-weight: bold } /* Name.Tag */
125
+ body .nv { color: #19469D } /* Name.Variable */
126
+ body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
127
+ body .w { color: #bbbbbb } /* Text.Whitespace */
128
+ body .mf { color: #666666 } /* Literal.Number.Float */
129
+ body .mh { color: #666666 } /* Literal.Number.Hex */
130
+ body .mi { color: #666666 } /* Literal.Number.Integer */
131
+ body .mo { color: #666666 } /* Literal.Number.Oct */
132
+ body .sb { color: #219161 } /* Literal.String.Backtick */
133
+ body .sc { color: #219161 } /* Literal.String.Char */
134
+ body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
135
+ body .s2 { color: #219161 } /* Literal.String.Double */
136
+ body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
137
+ body .sh { color: #219161 } /* Literal.String.Heredoc */
138
+ body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
139
+ body .sx { color: #954121 } /* Literal.String.Other */
140
+ body .sr { color: #BB6688 } /* Literal.String.Regex */
141
+ body .s1 { color: #219161 } /* Literal.String.Single */
142
+ body .ss { color: #19469D } /* Literal.String.Symbol */
143
+ body .bp { color: #954121 } /* Name.Builtin.Pseudo */
144
+ body .vc { color: #19469D } /* Name.Variable.Class */
145
+ body .vg { color: #19469D } /* Name.Variable.Global */
146
+ body .vi { color: #19469D } /* Name.Variable.Instance */
147
+ body .il { color: #666666 } /* Literal.Number.Integer.Long */
@@ -0,0 +1,21 @@
1
+ require 'murdoc'
2
+ require 'benchmark'
3
+ def init
4
+ sections :header, :box_info, :children,
5
+ :constant_summary, [T('docstring')], :inherited_constants,
6
+ :attribute_summary, [:item_summary],
7
+ :method_summary, [:item_summary],
8
+ :murdoc
9
+ end
10
+
11
+ def murdoc
12
+ @@murdoc_annotations ||= {}
13
+ @stylesheet = file('style.css')
14
+ files = {}
15
+ @definitions = (method_listing + attr_listing).map { |v| files[v.file] = true; [v.line, v] }.sort_by { |line, o| line }
16
+ @annotations = files.keys.map do |file_name|
17
+ @@murdoc_annotations[file_name] ||= Murdoc::Annotator.from_file(file_name, nil)
18
+ end
19
+
20
+ erb(:murdoc)
21
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yardocco
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Andrew Rudenko
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-25 00:00:00 +03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ prerelease: false
23
+ name: bundler
24
+ type: :development
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 23
31
+ segments:
32
+ - 1
33
+ - 0
34
+ - 0
35
+ version: 1.0.0
36
+ requirement: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ prerelease: false
39
+ name: jeweler
40
+ type: :development
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ hash: 7
47
+ segments:
48
+ - 1
49
+ - 5
50
+ - 2
51
+ version: 1.5.2
52
+ requirement: *id002
53
+ description: Docco-style YARD template
54
+ email: ceo@prepor.ru
55
+ executables: []
56
+
57
+ extensions: []
58
+
59
+ extra_rdoc_files:
60
+ - LICENSE.txt
61
+ - README.rdoc
62
+ files:
63
+ - .document
64
+ - Gemfile
65
+ - Gemfile.lock
66
+ - LICENSE.txt
67
+ - README.rdoc
68
+ - Rakefile
69
+ - VERSION
70
+ - lib/yardocco.rb
71
+ - templates/default/module/html/murdoc.erb
72
+ - templates/default/module/html/style.css
73
+ - templates/default/module/setup.rb
74
+ has_rdoc: true
75
+ homepage: http://github.com/prepor/yardocco
76
+ licenses:
77
+ - MIT
78
+ post_install_message:
79
+ rdoc_options: []
80
+
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ requirements: []
102
+
103
+ rubyforge_project:
104
+ rubygems_version: 1.4.2
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: Docco-style YARD template
108
+ test_files: []
109
+