lib/pa.rb in pa-1.1.3 vs lib/pa.rb in pa-1.1.4

- old
+ new

@@ -73,11 +73,11 @@ class << self def method_missing(name, *args, &blk) # dir -> dir2 name2 = "#{name}2".to_sym if public_methods.include?(name2) - ret = __send__(name2, *args) + ret = __send__(name2, *args, &blk) return case ret when Array ret.map{|v| Pa(v)} when String Pa(ret) @@ -128,21 +128,11 @@ @path end # missing method goes to Pa.class-method def method_missing(name, *args, &blk) - ret = self.class.__send__(name, path, *args, &blk) - - case ret - # e.g. readlink .. - when String - Pa(ret) - # e.g. directory? - else - ret - end - + self.class.__send__(name, path, *args, &blk) end def <=> other other_path = if other.respond_to?(:path) other.path @@ -156,18 +146,17 @@ end end require "pa/path" require "pa/cmd" -require "pa/dir" +require "pa/directory" require "pa/state" class Pa include Path - include Dir + include Directory include State include Cmd end - module Kernel private # a very convient function. #