Module: Pa::Path
- Included in:
- Pa
- Defined in:
- lib/tagen/core/pa/path.rb
Overview
attribute absolute and dir return String, method absolute_path(), dirname() return Pa Pa(“/home/a”).dir #=> “/home” Pa(“/home/a”).dirname #=> Pa(“/home”)
methods from String
-
+
- g]sub[!
-
match =~
-
start_with? end_with?
Instance Attribute Summary collapse
- #absolute ⇒ String (also: #a) readonly
- #base ⇒ String (also: #b) readonly
- #dir ⇒ String (also: #d) readonly
- #ext ⇒ String (also: #e) readonly
- #fext ⇒ String (also: #fe) readonly
- #name ⇒ String (also: #n) readonly
- #short ⇒ String readonly
Instance Method Summary collapse
-
#+(str) ⇒ Pa
add string to path.
- #==(other) ⇒ Object
- #=~(regexp) ⇒ Object
-
#absolute_path ⇒ Pa
Absolute path.
-
#dirname ⇒ Pa
Dirname.
- #end_with?(*args) ⇒ Boolean
- #gsub(*args, &blk) ⇒ Pa
- #gsub!(*args, &blk) ⇒ Pa
- #initialize_variables ⇒ Object
- #match(*args, &blk) ⇒ MatchData
- #start_with?(*args) ⇒ Boolean
- #sub(*args, &blk) ⇒ Pa
- #sub!(*args, &blk) ⇒ Pa
Instance Attribute Details
#absolute ⇒ String (readonly) Also known as: a
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def absolute @absolute end |
#base ⇒ String (readonly) Also known as: b
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def base @base end |
#dir ⇒ String (readonly) Also known as: d
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def dir @dir end |
#ext ⇒ String (readonly) Also known as: e
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def ext @ext end |
#fext ⇒ String (readonly) Also known as: fe
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def fext @fext end |
#name ⇒ String (readonly) Also known as: n
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def name @name end |
#short ⇒ String (readonly)
229 230 231 |
# File 'lib/tagen/core/pa/path.rb', line 229 def short @short end |
Instance Method Details
#+(str) ⇒ Pa
add string to path
263 |
# File 'lib/tagen/core/pa/path.rb', line 263 def +(str) Pa(path+str) end |
#==(other) ⇒ Object
288 |
# File 'lib/tagen/core/pa/path.rb', line 288 def ==(other) self.path == other.path end |
#=~(regexp) ⇒ Object
286 |
# File 'lib/tagen/core/pa/path.rb', line 286 def =~(regexp) path =~ regexp end |
#absolute_path ⇒ Pa
Returns absolute path.
249 |
# File 'lib/tagen/core/pa/path.rb', line 249 def absolute_path() Pa(absolute) end |
#dirname ⇒ Pa
Returns dirname.
253 |
# File 'lib/tagen/core/pa/path.rb', line 253 def dirname() Pa(dir) end |
#end_with?(*args) ⇒ Boolean
284 |
# File 'lib/tagen/core/pa/path.rb', line 284 def end_with?(*args) path.end_with?(*args) end |
#gsub(*args, &blk) ⇒ Pa
269 |
# File 'lib/tagen/core/pa/path.rb', line 269 def gsub(*args,&blk) Pa(path.gsub(*args,&blk)) end |
#gsub!(*args, &blk) ⇒ Pa
275 |
# File 'lib/tagen/core/pa/path.rb', line 275 def gsub!(*args,&blk) self.replace path.gsub(*args,&blk) end |
#initialize_variables ⇒ Object
231 232 233 234 235 236 237 238 239 |
# File 'lib/tagen/core/pa/path.rb', line 231 def initialize_variables super @absolute = Pa.absolute(@path) @dir = Pa.dirname(@path) @base = Pa.basename(@path) @name, @ext = Pa.basename(@path, ext: true) @fext = @ext.empty? ? "" : "."+@ext @short = Pa.shorten(@path) end |
#match(*args, &blk) ⇒ MatchData
278 |
# File 'lib/tagen/core/pa/path.rb', line 278 def match(*args,&blk) path.match(*args,&blk) end |
#start_with?(*args) ⇒ Boolean
281 |
# File 'lib/tagen/core/pa/path.rb', line 281 def start_with?(*args) path.start_with?(*args) end |
#sub(*args, &blk) ⇒ Pa
266 |
# File 'lib/tagen/core/pa/path.rb', line 266 def sub(*args,&blk) Pa(path.sub(*args,&blk)) end |
#sub!(*args, &blk) ⇒ Pa
272 |
# File 'lib/tagen/core/pa/path.rb', line 272 def sub!(*args,&blk) self.replace path.sub(*args,&blk) end |