Sha256: 3deafd3c081efb4c740af85613592bd491453b111878b5a264da915d8548471a

Contents?: true

Size: 729 Bytes

Versions: 16

Compression:

Stored size: 729 Bytes

Contents

module Mercurial
  
  class ChangedFile
    
    attr_reader :name, :initial_name
    attr_accessor :mode_letter
    
    def initialize(opts={})
      @initial_name = opts[:initial_name]
      @name         = opts[:name]
      @mode_letter  = opts[:mode]
    end
    
    def moved?
      mode == :move
    end
    
    def copied?
      mode == :copy
    end
    
    def deleted?
      mode == :delete
    end
    
    def added?
      mode == :add
    end
    
    def modified?
      mode == :edit
    end
    
    def mode
      case mode_letter
      when 'A'
        :add
      when 'D'
        :delete
      when 'C'
        :copy
      when 'R'
        :move
      else
        :edit
      end
    end
    
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mercurial-ruby-0.7.10 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.9 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.8 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.7 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.6 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.5 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.4 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.3 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.2 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.1 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.7.0 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.6.1 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.6.0 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.5.0 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.4.0 lib/mercurial-ruby/changed_file.rb
mercurial-ruby-0.3.0 lib/mercurial-ruby/changed_file.rb