Method: Spider::SetupTask#initialize
- Defined in:
- lib/spiderfw/setup/setup_task.rb
#initialize(path, up = nil, down = nil) ⇒ SetupTask
Returns a new instance of SetupTask.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/spiderfw/setup/setup_task.rb', line 38 def initialize(path, up=nil, down=nil) @path = path name = File.basename(path, '.rb') if (name =~ /^((?:\d\.?){1,3})/) version = $1 version = version[0..-2] if version[-1].chr == '.' desc = name[(version.length+1)..-1] else version = name desc = nil end @version = Gem::Version.new(version) @desc = desc end |