Permalink
Browse files

Merge branch 'master' of git://github.com/elliottcable/extlib into ec

Conflicts:

	lib/extlib/symbol.rb
  • Loading branch information...
2 parents 6925b32 + 0fde3a3 commit ebef531b1b742da83eb5ee38b2e47981a6a494a9 @sam sam committed Sep 8, 2008
Showing with 21 additions and 0 deletions.
  1. +1 −0 lib/extlib.rb
  2. +12 −0 lib/extlib/symbol.rb
  3. +8 −0 spec/symbol_spec.rb
View
@@ -14,6 +14,7 @@
require dir / "object_space"
require dir / "string"
+require dir / "symbol"
require dir / "hash"
require dir / "mash"
require dir / "virtual_file"
View
@@ -1,5 +1,17 @@
class Symbol
+
def try_dup
self
end
+
+ ##
+ # @param o<String, Symbol> The path component to join with the string.
+ #
+ # @return <String> The original path concatenated with o.
+ #
+ # @example
+ # :merb/"core_ext" #=> "merb/core_ext"
+ def /(o)
+ File.join(self.to_s, o.to_s)
+ end
end
View
@@ -0,0 +1,8 @@
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
+
+describe Symbol, "#/" do
+ it "concanates operands with File::SEPARATOR" do
+ (:merb / "core").should == "merb#{File::SEPARATOR}core"
+ (:merb / :core).should == "merb#{File::SEPARATOR}core"
+ end
+end

0 comments on commit ebef531

Please sign in to comment.