Sha256: 5db925d99d97e53b5869394a5011f0835ec930b6b7eb91fba588ffd121f2f91f

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

module L5MTools
    class SVN
        class << self
            def method_missing(method_id, *arguments, &block)
                self.class_eval %{
                    def self.#{method_id}(*args, &b)
                        cmd = "svn #{method_id} "
                        cmd << args.join(" ") if args
                        `\#{cmd}`
                    end
                }, __FILE__, __LINE__
                send(method_id, *arguments, &block)
            end        
        end
        
        def run(*args, &block)
            cmd = args.shift
            args = args[0..(args.index '--')] if args.index '--'
            options = {}
            options[:username] = args.option! '--user'
            options[:reverse] = args.delete('-r')
            options[:date] = args.option!('--date')
            options[:mail] = args.delete('-e') || args.delete('--email');
            options[:username] ||= SVN_USER
            packages =  args.empty? ? PACKAGES : args
            result = case cmd
                when 'status', 'st' then svn_status(packages)
                when 'update' then svn_update(packages)
                when 'log' then svn_log(packages, options[:date] , options[:username] , options[:reverse])
                else usage   
            end  
            #send_mail(SEND_TO, "svn #{cmd} @#{Time.now.strftime("%F %T")}" , result) if options[:mail] || (puts result) unless result.nil? || result.empty?       
        end       
    end
    class Application    
        

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
l5m-tools-0.0.2.pre lib/l5m-tools/svn.rb