Class: SiSU_Utils::Path
- Inherits:
-
Object
- Object
- SiSU_Utils::Path
- Defined in:
- lib/sisu/utils.rb
Instance Method Summary collapse
- #base_markup(call_path = nil) ⇒ Object
- #base_markup_stub ⇒ Object
- #bmd ⇒ Object
- #image_src ⇒ Object
-
#initialize(dir = Dir.pwd) ⇒ Path
constructor
A new instance of Path.
Constructor Details
#initialize(dir = Dir.pwd) ⇒ Path
Returns a new instance of Path.
179 180 181 |
# File 'lib/sisu/utils.rb', line 179 def initialize(dir=Dir.pwd) @dir=dir end |
Instance Method Details
#base_markup(call_path = nil) ⇒ Object
182 183 184 185 186 187 |
# File 'lib/sisu/utils.rb', line 182 def base_markup(call_path=nil) call_path = call_path \ ? call_path \ : Dir.pwd (/(\S+?)(?:\/(?:#{Px[:lng_lst_rgx]}))?$/).match(call_path)[1] end |
#base_markup_stub ⇒ Object
188 189 190 191 |
# File 'lib/sisu/utils.rb', line 188 def base_markup_stub m=/.+\/(?:src\/)?(\S+)/im base_markup[m,1] end |
#bmd ⇒ Object
199 200 201 |
# File 'lib/sisu/utils.rb', line 199 def bmd base_markup end |
#image_src ⇒ Object
192 193 194 195 196 197 198 |
# File 'lib/sisu/utils.rb', line 192 def image_src if base_markup =~/sisupod\/doc[\/]?$/ base_markup.gsub(/\/doc[\/]?$/,'/image') elsif FileTest.directory?("#{base_markup}/_sisu/image") "#{base_markup}/_sisu/image" end end |