Class: Epic::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/epic/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.configuration ⇒ Object
8
9
10
|
# File 'lib/epic/base.rb', line 8
def configuration
@configuration ||= Epic::Configuration.new
end
|
12
13
14
|
# File 'lib/epic/base.rb', line 12
def configure
yield configuration
end
|
Instance Method Details
#base_path ⇒ Object
30
31
32
|
# File 'lib/epic/base.rb', line 30
def base_path
configuration.base_path || ""
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_path ⇒ Object
34
35
36
|
# File 'lib/epic/base.rb', line 34
def tmp_path
configuration.tmp_path || "#{base_path}/tmp" || ""
end
|