Sha256: d4aa955b3ee7070bd1b5b8f1305db43c3e5fda6a7ce4be2d69a55626f66f00a1

Contents?: true

Size: 1.57 KB

Versions: 9

Compression:

Stored size: 1.57 KB

Contents

# Copyright (c) 2013-2015 SUSE LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact SUSE LLC.
#
# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com

class UnmanagedFilesRenderer < Renderer
  def do_render
    return unless @system_description["unmanaged_files"]

    list do
      file_status = @system_description["unmanaged_files"].extracted
      if !file_status.nil?
        puts "Files extracted: #{file_status ? "yes" : "no"}"
      end

      if @system_description["unmanaged_files"].files
        @system_description["unmanaged_files"].files.each do |p|
          if p.user && p.group
            item "#{p.name} (#{p.type})" do
              puts "User/Group: #{p.user}:#{p.group}"
              puts "Mode: #{p.mode}" if p.mode
              puts "Size: #{number_to_human_size(p.size)}" if p.size
              puts "Files: #{p.files}" if p.files
            end
          else
            item "#{p.name} (#{p.type})"
          end
        end
      end
    end
  end

  def display_name
    "Unmanaged files"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
machinery-tool-1.9.1 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.9.0 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.8.2 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.8.1 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.8.0 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.7.0 plugins/unmanaged_files/unmanaged_files_renderer.rb
machinery-tool-1.6.0 plugins/show/unmanaged_files_renderer.rb
machinery-tool-1.5.0 plugins/show/unmanaged_files_renderer.rb
machinery-tool-1.4.0 plugins/show/unmanaged_files_renderer.rb