Module: Evecache

Defined in:
lib/evecache.rb,
lib/evecache.rb

Defined Under Namespace

Classes: MarketList

Constant Summary collapse

VERSION =
"0.42.0"
@@path =
""

Class Method Summary collapse

Class Method Details

.list_filesObject



78
79
80
# File 'lib/evecache.rb', line 78

def list_files
  Dir.glob(@@path+"/*.cache")
end

.open(filename) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/evecache.rb', line 58

def open(filename)
    filename = path(filename) unless File.exists? filename
    raise StandardError.new "File not found: #{filename}!" unless File.exists? filename
    list = MarketParser.new(filename).getList            
  raise StandardError.new "Could not read MarketList! Invalid file?!" if list.invalid?      
	list
end

.path(filename = "") ⇒ Object



70
71
72
73
74
75
76
# File 'lib/evecache.rb', line 70

def path(filename="")
	if filename.empty?
      @@path
    else
      @@path+"/"+filename+(filename.end_with?(".cache") ? "" : ".cache")
    end
end

.path=(path) ⇒ Object



66
67
68
# File 'lib/evecache.rb', line 66

def path=(path)
	@@path=path
end