Class: Epic::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/epic/base.rb

Direct Known Subclasses

Compressor, Validator::Base

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configurationObject



8
9
10
# File 'lib/epic/base.rb', line 8

def configuration
  @configuration ||= Epic::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



12
13
14
# File 'lib/epic/base.rb', line 12

def configure
  yield configuration
end

Instance Method Details

#base_pathObject



30
31
32
# File 'lib/epic/base.rb', line 30

def base_path      
  configuration.base_path || ""
end

#configurationObject



17
18
19
# File 'lib/epic/base.rb', line 17

def configuration
  Epic::Base.configuration
end

#display_path(filename = nil) ⇒ Object

Parses out the base_path setting from a path to display it in a less verbose way.



24
25
26
27
28
# File 'lib/epic/base.rb', line 24

def display_path(filename=nil)
  filename ||= path
  display_path = File.expand_path(filename)
  display_path.gsub(base_path.to_s, "")
end

#tmp_pathObject



34
35
36
# File 'lib/epic/base.rb', line 34

def tmp_path
  configuration.tmp_path || "#{base_path}/tmp" || ""
end