summaryrefslogtreecommitdiff
path: root/lib/package.rb
blob: b5c44bbc7957331de1a3002d458c582d6888e62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

# frozen_string_literal: true

class Package
  attr_reader :path, :version, :homepage, :requires

  def initialize(path, version:, homepage:, requires: [])
    @path = path
    @version = version
    @homepage = homepage
    @requires = requires
  end

  def name
    File.basename @path
  end

  def name_version
    "#{name}-#{@version}"
  end
end