Module: FPM::Cookery::PathHelper

Included in:
Recipe
Defined in:
lib/fpm/cookery/path_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#installingObject

Returns the value of attribute installing.



6
7
8
# File 'lib/fpm/cookery/path_helper.rb', line 6

def installing
  @installing
end

Instance Method Details

#bin(path = nil) ⇒ Object



29
# File 'lib/fpm/cookery/path_helper.rb', line 29

def bin(path = nil)     prefix/'bin'/path            end

#doc(path = nil) ⇒ Object



30
# File 'lib/fpm/cookery/path_helper.rb', line 30

def doc(path = nil)     prefix/'share/doc'/path      end

#etc(path = nil) ⇒ Object



17
18
19
# File 'lib/fpm/cookery/path_helper.rb', line 17

def etc(path = nil)
  current_pathname_for('etc')/path
end

#include(path = nil) ⇒ Object



31
# File 'lib/fpm/cookery/path_helper.rb', line 31

def include(path = nil) prefix/'include'/path        end

#info(path = nil) ⇒ Object



32
# File 'lib/fpm/cookery/path_helper.rb', line 32

def info(path = nil)    prefix/'share/info'/path     end

#installing?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/fpm/cookery/path_helper.rb', line 8

def installing?
  installing
end

#lib(path = nil) ⇒ Object



33
# File 'lib/fpm/cookery/path_helper.rb', line 33

def lib(path = nil)     prefix/'lib'/path            end

#libexec(path = nil) ⇒ Object



34
# File 'lib/fpm/cookery/path_helper.rb', line 34

def libexec(path = nil) prefix/'libexec'/path        end

#man(path = nil) ⇒ Object



35
# File 'lib/fpm/cookery/path_helper.rb', line 35

def man(path = nil)     prefix/'share/man'/path      end

#man1(path = nil) ⇒ Object



36
# File 'lib/fpm/cookery/path_helper.rb', line 36

def man1(path = nil)    man/'man1'/path              end

#man2(path = nil) ⇒ Object



37
# File 'lib/fpm/cookery/path_helper.rb', line 37

def man2(path = nil)    man/'man2'/path              end

#man3(path = nil) ⇒ Object



38
# File 'lib/fpm/cookery/path_helper.rb', line 38

def man3(path = nil)    man/'man3'/path              end

#man4(path = nil) ⇒ Object



39
# File 'lib/fpm/cookery/path_helper.rb', line 39

def man4(path = nil)    man/'man4'/path              end

#man5(path = nil) ⇒ Object



40
# File 'lib/fpm/cookery/path_helper.rb', line 40

def man5(path = nil)    man/'man5'/path              end

#man6(path = nil) ⇒ Object



41
# File 'lib/fpm/cookery/path_helper.rb', line 41

def man6(path = nil)    man/'man6'/path              end

#man7(path = nil) ⇒ Object



42
# File 'lib/fpm/cookery/path_helper.rb', line 42

def man7(path = nil)    man/'man7'/path              end

#man8(path = nil) ⇒ Object



43
# File 'lib/fpm/cookery/path_helper.rb', line 43

def man8(path = nil)    man/'man8'/path              end

#opt(path = nil) ⇒ Object



21
22
23
# File 'lib/fpm/cookery/path_helper.rb', line 21

def opt(path = nil)
  current_pathname_for('opt')/path
end

#prefix(path = nil) ⇒ Object

Most of the path helper stuff comes from brew2deb and homebrew.



13
14
15
# File 'lib/fpm/cookery/path_helper.rb', line 13

def prefix(path = nil)
  current_pathname_for('usr')/path
end

#sbin(path = nil) ⇒ Object



44
# File 'lib/fpm/cookery/path_helper.rb', line 44

def sbin(path = nil)    prefix/'sbin'/path           end

#share(path = nil) ⇒ Object



45
# File 'lib/fpm/cookery/path_helper.rb', line 45

def share(path = nil)   prefix/'share'/path          end

#var(path = nil) ⇒ Object



25
26
27
# File 'lib/fpm/cookery/path_helper.rb', line 25

def var(path = nil)
  current_pathname_for('var')/path
end

#with_trueprefixObject

Return real paths for the scope of the given block.

prefix(‘usr’) # => /../software/tmp-dest/usr

with_trueprefix do

prefix('usr') # => /usr

end



54
55
56
57
58
59
60
# File 'lib/fpm/cookery/path_helper.rb', line 54

def with_trueprefix
  old_value = installing
  self.installing = false
  yield
ensure
  self.installing = old_value
end