Sha256: 556a32bc3845126519ce2bc334f9fb52572a21ba57ad72d0c282058b81b4cd47

Contents?: true

Size: 894 Bytes

Versions: 16

Compression:

Stored size: 894 Bytes

Contents

require 'chef/chef_fs/knife'
require 'chef/chef_fs/file_system'

class Chef
  class Knife
    class Show < Chef::ChefFS::Knife
      banner "knife show [PATTERN1 ... PATTERNn]"

      common_options

      def run
        # Get the matches (recursively)
        pattern_args.each do |pattern|
          Chef::ChefFS::FileSystem.list(chef_fs, pattern) do |result|
            if result.dir?
              STDERR.puts "#{result.path_for_printing}: is a directory" if pattern.exact_path
            else
              begin
                value = result.read
                puts "#{result.path_for_printing}:"
                output(format_for_display(value))
              rescue Chef::ChefFS::FileSystem::NotFoundError
                STDERR.puts "#{result.path_for_printing}: No such file or directory"
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
chef-11.4.4 lib/chef/knife/show.rb
chef-11.4.2 lib/chef/knife/show.rb
microwave-11.400.8 lib/chef/knife/show.rb
microwave-11.400.7 lib/chef/knife/show.rb
microwave-11.400.6 lib/chef/knife/show.rb
microwave-11.400.5 lib/chef/knife/show.rb
microwave-11.400.4 lib/chef/knife/show.rb
chef-11.4.0 lib/chef/knife/show.rb
chef-11.4.0.rc.0 lib/chef/knife/show.rb
chef-11.0.0.beta.2 lib/chef/knife/show.rb
chef-11.2.0 lib/chef/knife/show.rb
chef-11.2.0.rc.1 lib/chef/knife/show.rb
chef-11.0.0 lib/chef/knife/show.rb
chef-11.0.0.rc.0 lib/chef/knife/show.rb
chef-11.0.0.beta.1 lib/chef/knife/show.rb
chef-11.0.0.beta.0 lib/chef/knife/show.rb