Sha256: 92157131c3f63cd50fcbb271fe0f8fbb146ea3ef6e828208b88c4aba40996918

Contents?: true

Size: 701 Bytes

Versions: 9

Compression:

Stored size: 701 Bytes

Contents

module Capitate
  
  module CapExt
    
    module Docs
      
      # Get link to github source, so we can refer to recipe code.
      #
      # ==== Options
      # +recipe+:: Recipe path, probably use __FILE__
      #
      # ==== Examples
      #   # In a lib/recipes/foo/foo.rb
      #   link_to_source(__FILE__) => "http://github.com/gabriel/capitate/tree/master/lib/recipes/foo/foo.rb"
      #
      def link_to_source(recipe_path)
        full_path = File.expand_path(recipe_path)
        project_path = File.expand_path(File.dirname(__FILE__) + "/../../../")
        "http://github.com/gabriel/capitate/tree/master#{full_path.sub(project_path, "")}"
      end
      
    end
    
  end
  
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
calas-capitate-0.3.6 lib/capitate/cap_ext/docs.rb
capitate-0.2.14 lib/capitate/cap_ext/docs.rb
capitate-0.2.15 lib/capitate/cap_ext/docs.rb
capitate-0.3.3 lib/capitate/cap_ext/docs.rb
capitate-0.3.5 lib/capitate/cap_ext/docs.rb
capitate-0.3.6 lib/capitate/cap_ext/docs.rb
capitate-0.3.1 lib/capitate/cap_ext/docs.rb
capitate-0.3.4 lib/capitate/cap_ext/docs.rb
capitate-0.3.2 lib/capitate/cap_ext/docs.rb