lib/autumn/tool/bin.rb
# This class contains the command methods {{{
This class contains the command methods {{{
This class contains the command methods {{{
def al_root
          require "pathname"
          dir = nil
          if ARGV.size == 1
            dir = Pathname.new(ARGV.shift)
          elsif ARGV.size > 1
            $stderr.puts "Unknown options given #{ARGV.join(" ")}"
            puts usage
            exit 1
          end
          if dir.nil? or not dir.directory?
            dir = Pathname.new(ENV["PWD"]).expand_path
            $stderr.puts "Path to autumn tree not given or invalid, using #{dir}"
          end
          Object.const_set("AL_ROOT", dir.expand_path.to_s)
          Dir.chdir(AL_ROOT)
        end
def al_root require "pathname" dir = nil if ARGV . size == 1 dir = Pathname . new ( ARGV . shift ) elsif ARGV . size > 1 $stderr . puts "Unknown options given #{ARGV.join(" ")}" puts usage exit 1 end if dir . nil? or not dir . directory? dir = Pathname . new ( ENV [ "PWD" ] ) . expand_path $stderr . puts "Path to autumn tree not given or invalid, using #{dir}" end Object . const_set ( "AL_ROOT" , dir . expand_path . to_s ) Dir . chdir ( AL_ROOT ) end
This class contains the command methods {{{
This class contains the command methods {{{