Class: Wad::File

Inherits:
Object
  • Object
show all
Defined in:
lib/wad/file.rb

Overview

A file that is part of a gem.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ghem, path, to) ⇒ File

Returns a new instance of File.



16
17
18
19
20
# File 'lib/wad/file.rb', line 16

def initialize ghem, path, to
  @ghem = ghem
  @path = path
  @to = to
end

Instance Attribute Details

#ghemObject (readonly)

Gem this belongs to



14
15
16
# File 'lib/wad/file.rb', line 14

def ghem
  @ghem
end

#pathObject (readonly)

Full file path



8
9
10
# File 'lib/wad/file.rb', line 8

def path
  @path
end

#toObject (readonly)

Relative path this file should have after the copy



11
12
13
# File 'lib/wad/file.rb', line 11

def to
  @to
end

Instance Method Details

#copy(target) ⇒ Object



22
23
24
# File 'lib/wad/file.rb', line 22

def copy target
  target.copy(self)
end

#directory?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/wad/file.rb', line 30

def directory?
  path.directory?
end

#gem_nameObject



26
27
28
# File 'lib/wad/file.rb', line 26

def gem_name
  ghem.name
end