Skip to content
Browse files

Fixed bugs when run with ruby 1.8.

  • Loading branch information...
1 parent 74cbd45 commit ed9fb7830a0d3f0330afb43273a0a946f4db88c9 @ohspite committed
Showing with 19 additions and 4 deletions.
  1. +6 −1 CHANGELOG
  2. +11 −1 lib/sundae.rb
  3. +1 −1 test/test_sundae.rb
  4. +1 −1 version.txt
View
7 CHANGELOG
@@ -1,10 +1,15 @@
+=== 1.0.3 / 2012-04-13
+
+* bug fixes for 1.8.*:
+ * monkeypatched a Dir.home method
+ * fixed variable that was shadowed in 1.9, overwritten in 1.8
+
=== 1.0.2 / 2012-02-28
* minor enhancements:
* change default location for "dot-" mnt directories
* better documentation
-
=== 1.0.1 / 2012-02-27
* minor enhancements:
View
12 lib/sundae.rb
@@ -4,6 +4,14 @@
require 'find'
require 'pathname'
+unless Dir.respond_to?(:home)
+ class Dir
+ def self.home
+ File.expand_path('~')
+ end
+ end
+end
+
# A collection of methods to mix the contents of several directories
# together using symbolic links.
#
@@ -126,9 +134,11 @@ def self.mnts_in_path(path)
Pathname.new(path).expand_path
mnts = []
collections = path.children(false).delete_if {|c| c.to_s =~ /^\./}
+
collections.each do |c|
- collection_mnts = (path + c).children(false).delete_if {|c| c.to_s =~ /^\./}
+ collection_mnts = (path + c).children(false).delete_if {|kid| kid.to_s =~ /^\./}
collection_mnts.map! { |mnt| (c + mnt) }
+
mnts |= collection_mnts # |= is the union
end
View
2 test/test_sundae.rb
@@ -20,7 +20,7 @@ def setup
%w(c1 c2 c1/d1 c1/d2 c2/d1 c2/d3 c2/d3/d31).each do |x|
(@@mnts_dir + x).mkpath
end
-
+
%w(c1/d1/f11 c1/d1/f12 c1/d2/f21 c2/d1/f13 c2/d1/f14 c2/d3/f31).each do |x|
(@@mnts_dir + x).open('w')
end
View
2 version.txt
@@ -1 +1 @@
-1.0.2
+1.0.3

0 comments on commit ed9fb78

Please sign in to comment.
Something went wrong with that request. Please try again.