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.
178 179 180 |
# File 'lib/sisu/utils.rb', line 178 def initialize(dir=Dir.pwd) @dir=dir end |
Instance Method Details
#base_markup(call_path = nil) ⇒ Object
181 182 183 184 185 186 |
# File 'lib/sisu/utils.rb', line 181 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
187 188 189 190 |
# File 'lib/sisu/utils.rb', line 187 def base_markup_stub m=/.+\/(?:src\/)?(\S+)/im base_markup[m,1] end |
#bmd ⇒ Object
198 199 200 |
# File 'lib/sisu/utils.rb', line 198 def bmd base_markup end |
#image_src ⇒ Object
191 192 193 194 195 196 197 |
# File 'lib/sisu/utils.rb', line 191 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 |