Sha256: 501f8f2b555cfc6474790bdaf33ebd0612e6e32a46a68d7d4cfe06ba6fef5d29

Contents?: true

Size: 613 Bytes

Versions: 6

Compression:

Stored size: 613 Bytes

Contents

require 'chef/knife/profitbricks_base'

class Chef
  class Knife
    class ProfitbricksLocationList < Knife
      include Knife::ProfitbricksBase

      banner 'knife profitbricks location list'

      def run
        $stdout.sync = true
        location_list = [
          ui.color('ID', :bold),
          ui.color('Name', :bold)
        ]
        connection
        ProfitBricks::Location.list.each do |location|
          location_list << location.id
          location_list << location.properties['name']
        end

        puts ui.list(location_list, :uneven_columns_across, 2)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
knife-profitbricks-2.0.1 lib/chef/knife/profitbricks_location_list.rb
knife-profitbricks-1.2.1 lib/chef/knife/profitbricks_location_list.rb
knife-profitbricks-1.2.0 lib/chef/knife/profitbricks_location_list.rb
knife-profitbricks-1.1.2 lib/chef/knife/profitbricks_location_list.rb
knife-profitbricks-1.1.1 lib/chef/knife/profitbricks_location_list.rb
knife-profitbricks-1.0.0 lib/chef/knife/profitbricks_location_list.rb