-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikolai Weibull
committed
Apr 6, 2012
0 parents
commit 1bc9beb
Showing
8 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
YARD Method Overrides | |||
|
|||
A YARD plugin that adds tags for specifying method overrides. The tags added | |||
are @extension and @override, which allow you to tag a method as either an | |||
extension of a superclass’ definition or a complete override of a superclass’ | |||
definition. This makes it easy for the reader to see what’s going on may | |||
read up on what may be going on in the superclass. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
require 'inventory/rake/tasks' | |||
|
|||
$:.unshift File.expand_path('../lib', __FILE__) | |||
require 'yard-method-overrides/version' | |||
|
|||
Inventory::Rake::Tasks.define YardMethodOverrides::Version, :gem => proc{ |_, s| | |||
s.author = 'Nikolai Weibull' | |||
s.email = 'now@bitwi.se' | |||
s.homepage = 'https://github.com/now/yard-method-overrides' | |||
|
|||
s.add_runtime_dependency 'inventory', '~> 0.2.0' | |||
s.add_runtime_dependency 'yard', '~> 0.7.0' | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
YARD::Templates::Engine.register_template_path File.expand_path('../../templates', __FILE__) | |||
YARD::Tags::Library.define_tag 'Extending Method', :extension | |||
YARD::Tags::Library.define_tag 'Overriding Method', :override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
require 'inventory' | |||
|
|||
module YardMethodOverrides | |||
Version = Inventory.new(0, 1, 0){ | |||
def additional_files | |||
%w' | |||
templates/default/tags/html/extension.erb | |||
templates/default/tags/html/override.erb | |||
templates/default/tags/setup.rb | |||
' | |||
end | |||
|
|||
def unit_tests | |||
[] | |||
end | |||
} | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
<p>This method is an extension of <%= linkify(object.overridden_method) %>.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
<p>This method overrides <%= linkify(object.overridden_method) %>.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
def init | |||
sections.push :extension, :override | |||
end | |||
|
|||
def extension | |||
erb(:extension) if object.has_tag? :extension and object.respond_to? :overridden_method and object.overridden_method | |||
end | |||
|
|||
def override | |||
erb(:override) if object.has_tag? :override and object.respond_to? :overridden_method and object.overridden_method | |||
end |