Class: Lapis::Minecraft::Versioning::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/lapis/minecraft/versioning/library.rb

Overview

Dependency needed to run Minecraft.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, resources, rules = [], exclude_paths = []) ⇒ Library

Creates information about a dependency.



29
30
31
32
33
34
# File 'lib/lapis/minecraft/versioning/library.rb', line 29

def initialize(name, resources, rules = [], exclude_paths = [])
  @name          = name.dup.freeze
  @resources     = resources
  @rules         = rules.dup.freeze
  @exclude_paths = exclude_paths.map(&:freeze).freeze
end

Instance Attribute Details

#exclude_pathsArray<String> (readonly)

Paths to ignore when extracting resources.



22
23
24
# File 'lib/lapis/minecraft/versioning/library.rb', line 22

def exclude_paths
  @exclude_paths
end

#nameString (readonly)

Name of the dependency.



10
11
12
# File 'lib/lapis/minecraft/versioning/library.rb', line 10

def name
  @name
end

#resourcesResourceSet (readonly)

Set of resources included in the library.



14
15
16
# File 'lib/lapis/minecraft/versioning/library.rb', line 14

def resources
  @resources
end

#rulesArray<Rule> (readonly)

Filter for which files should be installed.



18
19
20
# File 'lib/lapis/minecraft/versioning/library.rb', line 18

def rules
  @rules
end

Instance Method Details

#==(other) ⇒ true, false

Compares one library to another.



40
41
42
43
44
45
# File 'lib/lapis/minecraft/versioning/library.rb', line 40

def ==(other)
  other.name == @name &&
      other.resources == @resources &&
      other.rules == @rules &&
      other.exclude_paths == @exclude_paths
end