GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
Adding methods for basename of path and extension of path
Hemant Borole (author)
Wed Oct 01 09:45:58 -0700 2008
commit  2710593f61012fc3e81de1185e109aded3919df3
tree    ef77887ff9e11e799263434cd6e501c87d266fe0
parent  d94cbdcac9e1b0335045e7cbb5c48823e26a32e9
...
38
39
40
 
 
 
 
 
 
 
41
42
43
...
38
39
40
41
42
43
44
45
46
47
48
49
50
0
@@ -38,6 +38,13 @@ module Waves
0
     def paths( rname = nil )
0
       ( rname.nil? ? resource.class.paths : app::Resources[ rname ].paths ).new( request )
0
     end
0
+
0
+ def basename
0
+ @basename ||= path.sub(/\..*$/,"")
0
+ end
0
+ def extension
0
+ @extension ||= path.match(/\.*\./)?path.sub(/.*[\.$]/,""):""
0
+ end
0
     
0
   end
0
 

Comments

    No one has commented yet.