Sha256: 27fb0372a4c6f46f2b282f0cb6f22444835982e4a7049028470d97134f16b745

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

module Pione
  module Util
    module PackageParametersList
      class << self
        # Print parameters list of the package.
        #
        # @param package [Component::Package]
        #   package
        def print(package)
          unless package.params.empty?
            print_params_by_block("Basic Parameters", package.params.basic)
            print_params_by_block("Advanced Parameters", package.params.advanced)
          else
            puts "there are no user parameters in %s" % package.name
          end
        end

        private

        # Print parameters by block.
        def print_params_by_block(header, target_params)
          unless target_params.empty?
            puts "%s:" % header
            target_params.data.each do |var, val|
              puts "  %s := %s" % [var.name, val.textize]
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pione-0.2.2 lib/pione/util/package-parameters-list.rb
pione-0.2.1 lib/pione/util/package-parameters-list.rb