Permalink
Browse files

'Path' dir edgecase

  • Loading branch information...
1 parent f189e40 commit c8a44d869725e084bdde6a12532ea77a20603975 @epitron committed Apr 9, 2012
Showing with 9 additions and 6 deletions.
  1. +1 −1 VERSION
  2. +2 −2 epitools.gemspec
  3. +6 −3 lib/epitools/path.rb
View
@@ -1 +1 @@
-0.5.2
+0.5.3
View
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = "epitools"
- s.version = "0.5.2"
+ s.version = "0.5.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["epitron"]
- s.date = "2012-04-05"
+ s.date = "2012-04-09"
s.description = "Miscellaneous utility libraries to make my life easier."
s.email = "chris@ill-logic.com"
s.extra_rdoc_files = [
View
@@ -74,12 +74,12 @@ def self.[](path)
if path =~ %r{^[a-z\-]+://}i # URL?
Path::URL.new(path)
+
elsif path =~ /^javascript:/
Path::JS.new(path)
+
else
-
# todo: highlight backgrounds of codeblocks to show indent level & put boxes (or rules?) around (between?) double-spaced regions
-
path = Path.expand_path(path)
if path =~ /(^|[^\\])[\?\*\{\}]/ # contains unescaped glob chars?
glob(path)
@@ -137,7 +137,10 @@ def filename=(newfilename)
end
def dir=(newdir)
- @dirs = File.expand_path(newdir).split(File::SEPARATOR)[1..-1]
+ dirs = File.expand_path(newdir).split(File::SEPARATOR)
+ dirs = dirs[1..-1] if dirs.size > 0
+
+ @dirs = dirs
end
# TODO: Figure out how to fix the 'path.with(:ext=>ext+".other")' problem (when 'ext == nil')...

0 comments on commit c8a44d8

Please sign in to comment.