Files

Guard::Plugin::Base::ClassMethods

Public Instance Methods

non_namespaced_classname() click to toggle source

Returns the non-namespaced class name of the plugin

@example Non-namespaced class name for Guard::RSpec

Guard::RSpec.non_namespaced_classname
#=> "RSpec"

@return [String]

# File lib/guard/plugin/base.rb, line 30
def non_namespaced_classname
  self.to_s.sub('Guard::', '')
end
non_namespaced_name() click to toggle source

Returns the non-namespaced name of the plugin

@example Non-namespaced name for Guard::RSpec

Guard::RSpec.non_namespaced_name
#=> "rspec"

@return [String]

# File lib/guard/plugin/base.rb, line 43
def non_namespaced_name
  non_namespaced_classname.downcase
end
template(plugin_location) click to toggle source

Specify the source for the Guardfile template. Each Guard plugin can redefine this method to add its own logic.

@param [String] plugin_location the plugin location

# File lib/guard/plugin/base.rb, line 52
def template(plugin_location)
  File.read("#{ plugin_location }/lib/guard/#{ non_namespaced_name }/templates/Guardfile")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.