Class: Epic::Validator::Base

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

Direct Known Subclasses

HTML, JavaScript, Stylesheet

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configurationObject



15
16
17
# File 'lib/epic.rb', line 15

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

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

Yields:



19
20
21
# File 'lib/epic.rb', line 19

def configure
  yield configuration
end

Instance Method Details

#base_pathObject



36
37
38
# File 'lib/epic.rb', line 36

def base_path      
  configuration.base_path || ""
end

#configurationObject



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

def configuration
  self.class.configuration
end

#display_path(path) ⇒ Object

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



31
32
33
34
# File 'lib/epic.rb', line 31

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

#tmp_pathObject



40
41
42
# File 'lib/epic.rb', line 40

def tmp_path
  configuration.tmp_path || ""
end