lib/capitate/cap_ext/variables.rb in capitate-0.2.11 vs lib/capitate/cap_ext/variables.rb in capitate-0.2.13

- old
+ new

@@ -5,11 +5,11 @@ def self.included(base) #:nodoc: base.send :alias_method, :fetch_without_capitate, :fetch base.send :alias_method, :fetch, :fetch_with_capitate end - # Fetch (alias method chained) variable. + # Fetch. # Displays usage message from recipe docs if variable not found. # # See capistrano fetch for usage info. # def fetch_with_capitate(variable, *args) @@ -70,11 +70,11 @@ end end nil end - # Fetch roles with name and options + # Fetch roles with name and options. # I don't actually use this. # # ==== Options # +name+:: Role name to look for # +options+:: Options to match on, e.g. :primary => true @@ -121,9 +121,16 @@ # def fetch_role(name, options = {}) matched = fetch_roles(name, options) return matched.first if matched nil + end + + + 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 \ No newline at end of file