Class: Gjp::KitSpecAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/gjp/kit_spec_adapter.rb

Overview

encapsulates details of a kit needed by the spec file retrieving them from other objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ KitSpecAdapter

Returns a new instance of KitSpecAdapter.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gjp/kit_spec_adapter.rb', line 11

def initialize(project)
  @name = project.name
  @version = project.version

  @archives =
    project.from_directory do
      ["#{name}-kit.tar.xz"] +
      Dir.entries("output/#{name}-kit")
        .select { |f| f =~ /_[0-9]+.tar.xz$/ }
        .sort
    end
end

Instance Attribute Details

#archivesObject (readonly)

Returns the value of attribute archives.



9
10
11
# File 'lib/gjp/kit_spec_adapter.rb', line 9

def archives
  @archives
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/gjp/kit_spec_adapter.rb', line 7

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



8
9
10
# File 'lib/gjp/kit_spec_adapter.rb', line 8

def version
  @version
end

Instance Method Details

#public_bindingObject



24
25
26
# File 'lib/gjp/kit_spec_adapter.rb', line 24

def public_binding
  binding
end