Sha256: b43cd3514d6266b57857ad76a63ed731d66f4c949637a6db713b0ac80a8d5947

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

class Fancy Package {
  class List {
    def initialize: @package_list_file

    def println {
      packages each: |p| {
        name, version, url = p
        "#{name} (#{version}) - #{url}" println
      }
    }

    def packages {
      packages = []
      # ignore file not found, as no packages might have been installed yet.
      ignoring: IOError do: {
        File open: @package_list_file modes: ['read] with: |f| {
          f readlines each: |l| {
            match l {
              case /name=(.*) version=(.*) url=(.*)/ -> |_, name, version, url|
                packages << (name, version, url)
            }
          }
        }
      }
      packages
    }

    def has_package?: package {
      packages any?: |p| { (p first, p second) == (package first, package second) } # ignore url for now
    }
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fancy-0.10.0 lib/package/list.fy
fancy-0.9.0 lib/package/list.fy