Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Bundle/Yard] Update and use of flawored markdown for documentation.

  • Loading branch information...
commit a1013d1d50ce73e8d040d9dc5dd769aa9750e0d9 1 parent d648263
@fabiopelosin fabiopelosin authored
Showing with 5 additions and 47 deletions.
  1. +2 −0  .yardopts
  2. +1 −0  Gemfile
  3. +2 −0  Gemfile.lock
  4. +0 −47 yard_extensions.rb
View
2  .yardopts
@@ -0,0 +1,2 @@
+--markup-provider=redcarpet
+--markup=markdown
View
1  Gemfile
@@ -10,5 +10,6 @@ end
group :documentation do
gem "redcarpet"
+ gem "github-markup"
gem "yard"
end
View
2  Gemfile.lock
@@ -12,6 +12,7 @@ GEM
multi_json (~> 1.0)
bacon (1.1.0)
ffi (1.1.5)
+ github-markup (0.7.4)
i18n (0.6.1)
kicker (2.6.1)
listen
@@ -34,6 +35,7 @@ PLATFORMS
DEPENDENCIES
bacon
+ github-markup
kicker
rake
redcarpet
View
47 yard_extensions.rb
@@ -1,47 +0,0 @@
-# encoding: utf-8
-require 'yard/handlers/ruby/base'
-require 'yard/core_ext/symbol_hash'
-
-require File.expand_path('../lib/xcodeproj/inflector', __FILE__)
-
-class PBXObjectAttributeHandler < YARD::Handlers::Ruby::Base
- handles method_call(:attribute)
- namespace_only
-
- def process
- if comments = statement.comments
- # Matches: "[type] description"
- # Should not end with a dot.
- type, description = comments.match(/^\[(.+?)\]\s+(.+?)$/).to_a.last(2)
- end
- type ||= 'Object'
-
- snake_case_name = statement.parameters(false).jump(:ident).source
- camelized_name = snake_case_name.camelize(:lower)
-
- { :read => snake_case_name, :write => "#{snake_case_name}=" }.each do |accessor_type, method|
- MethodObject.new(namespace, method, scope) do |o|
- doc = []
- if accessor_type == :write
- o.parameters = [['value', nil]]
- if description
- doc << "Assigns #{description}."
- else
- doc << "Assigns the `attributes` value for key ‘`#{camelized_name}`’."
- end
- doc << "@param [#{type}] value The value to assign to the `attributes` value for key ‘`#{camelized_name}`’ to."
- doc << "@return [#{type}] The value."
- else
- if description
- doc << "Returns #{description}."
- doc << "@return [#{type}] The `attributes` value for key ‘`#{camelized_name}`’."
- else
- doc << "@return [#{type}] Returns the `attributes` value for key ‘`#{camelized_name}`’."
- end
- end
- o.docstring = doc.join("\n")
- o.visibility = visibility
- end
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.