Module: FPM::Cookery::PathHelper

Included in:
BaseRecipe
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

#omnibus_installingObject

Returns the value of attribute omnibus_installing.



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

def omnibus_installing
  @omnibus_installing
end

Instance Method Details

#bin(path = nil) ⇒ Object



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

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

#doc(path = nil) ⇒ Object



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

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

#etc(path = nil) ⇒ Object



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

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

#include(path = nil) ⇒ Object



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

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

#info(path = nil) ⇒ Object



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

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



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

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

#libexec(path = nil) ⇒ Object



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

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

#man(path = nil) ⇒ Object



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

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

#man1(path = nil) ⇒ Object



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

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

#man2(path = nil) ⇒ Object



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

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

#man3(path = nil) ⇒ Object



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

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

#man4(path = nil) ⇒ Object



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

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

#man5(path = nil) ⇒ Object



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

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

#man6(path = nil) ⇒ Object



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

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

#man7(path = nil) ⇒ Object



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

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

#man8(path = nil) ⇒ Object



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

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

#omnibus_installing?Boolean

Returns:

  • (Boolean)


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

def omnibus_installing?
  omnibus_installing
end

#opt(path = nil) ⇒ Object



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

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.



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

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

#root(path = nil) ⇒ Object Also known as: root_prefix



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

def root(path = nil)
  current_pathname_for(nil)/path
end

#sbin(path = nil) ⇒ Object



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

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

#share(path = nil) ⇒ Object



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

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

#var(path = nil) ⇒ Object



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

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



63
64
65
66
67
68
69
# File 'lib/fpm/cookery/path_helper.rb', line 63

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