Sha256: 3a4a2f64eac7fe9a9716de4f8e2f1c05820e2735e5b12832e7af5c60386b9ad8

Contents?: true

Size: 1.1 KB

Versions: 57

Compression:

Stored size: 1.1 KB

Contents

module Redcar
  module Scm
    class ScmChangesMirror
      include Redcar::Tree::Mirror
      
      def initialize(repo)
        @repo = repo
      end
      
      def title
        @repo.translations[:uncommited_changes]
      end
      
      def data_type
        :text
      end
      
      # Root items will never change
      def changed?
        false
      end
      
      def drag_and_drop?
        #@repo.supported_commands.include? :index
        false
      end
      
      def from_data(data)
        data.split('::::').map {|n| @repo.from_data(n)}.find_all {|n| not n.nil?}
      end
      
      def to_data(nodes)
        nodes.find_all {|n| n.respond_to?(:to_data)}.map {|n| n.to_data}.join('::::')
      end
      
      def top
        @top ||= begin
          if @repo.supported_commands.include? :index
            [
              ScmChangesMirror::ChangesNode.new(@repo, :indexed),
              ScmChangesMirror::ChangesNode.new(@repo, :unindexed)
            ]
          else
            [ScmChangesMirror::ChangesNode.new(@repo, :all)]
          end
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
redcar-0.13 plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.5dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.4dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.3dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.2dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.1dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-0.12.1 plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.13.0dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-0.12 plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.27dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.26dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.25dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.24dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.23dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.22dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.21dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.20dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.19dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.18dev plugins/scm/lib/scm/scm_changes_mirror.rb
redcar-dev-0.12.17dev plugins/scm/lib/scm/scm_changes_mirror.rb