Sha256: 99311f05898a95dabada38052afa7d6aa8eeb9b0627d669a3c5989fd7aa2fd79

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

#
# This file was ported to ruby from Composer php source code.
#
# Original Source: Composer\Package\Loader\ArrayLoader.php
# Ref SHA: a1427d7fd626d4308c190a267dd7a993f87c6a2a
#
# (c) Nils Adermann <naderman@naderman.de>
#     Jordi Boggiano <j.boggiano@seld.be>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#

module Composer
  module Package
    module Dumper
      class HashDumper

        attr_dumper :scripts
        attr_dumper :license
        attr_dumper :authors
        attr_dumper :description
        attr_dumper :homepage
        attr_dumper :repositories
        attr_dumper :support

        attr_dumper :keywords do |package, data|
          keywords = package.keywords
          unless keywords.nil? || keywords.empty?
            data['keywords'] = keywords.is_a?(Array) ? keywords.sort! : keywords
          end
        end

        attr_dumper :abandoned? do |package, data|
          if package.abandoned?
            replacement = true
            if package.respond_to?(:replacement_package)
              replacement = package.replacement_package
            end
            data['abandoned'] = replacement ? replacement : true
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
php-composer-1.0.0.pre.alpha11 lib/composer/package/dumper/hash_dumper/complete_package_attribute_dumpers.rb