Class: Gem::Release::Files::Templates::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/gem/release/files/templates/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(groups, data, sources, files) ⇒ Group

Returns a new instance of Group.


8
9
10
11
12
13
# File 'lib/gem/release/files/templates/group.rb', line 8

def initialize(groups, data, sources, files)
  @groups  = [:default] + Array(groups)
  @data    = data
  @sources = sources
  @files   = Array(files)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data


6
7
8
# File 'lib/gem/release/files/templates/group.rb', line 6

def data
  @data
end

#filesObject (readonly)

Returns the value of attribute files


6
7
8
# File 'lib/gem/release/files/templates/group.rb', line 6

def files
  @files
end

#groupsObject (readonly)

Returns the value of attribute groups


6
7
8
# File 'lib/gem/release/files/templates/group.rb', line 6

def groups
  @groups
end

#sourcesObject (readonly)

Returns the value of attribute sources


6
7
8
# File 'lib/gem/release/files/templates/group.rb', line 6

def sources
  @sources
end

Instance Method Details

#allObject


15
16
17
18
19
20
# File 'lib/gem/release/files/templates/group.rb', line 15

def all
  return [] unless paths.any?
  all = Dir.glob(pattern, File::FNM_DOTMATCH)
  all = all.select { |file| File.file?(file) }
  all.map { |file| [file, relative(file)] }
end