Method: Cog::Plugin#initialize

Defined in:
lib/cog/plugin.rb

#initialize(cogfile_path) ⇒ Plugin

Returns a new instance of Plugin.

Parameters:

  • path to the plugin Cogfile



19
20
21
22
23
24
25
26
27
# File 'lib/cog/plugin.rb', line 19

def initialize(cogfile_path)
  unless File.exists?(cogfile_path)
    raise Errors::InvalidPluginConfiguration.new :cogfile => cogfile_path
  end
  @cogfile_path = File.expand_path cogfile_path
  @path = File.dirname @cogfile_path
  @name = File.basename @path
  @name = $1 if /^(.+?)\-(\d|\.)+(rc2)?$/ =~ @name
end