Method: Inmake::Config#initialize

Defined in:
lib/inmake/config.rb

#initialize(opts) ⇒ Config

Returns a new instance of Config.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/inmake/config.rb', line 12

def initialize opts
  # How we treat directories that have been passed to the file list.
  # Possible values are :acceptDirs, :ignoreDirs
  # :acceptDirs => directories are accepted and recursed into
  # :ignoreDirs => directories are ignored
  @dirMode = opts[:dirMode]
  # A list of all the files that inmake will act on.
  # This may include directories or relative paths.
  @files = opts[:files]
  # How inmake looks for the build command inside the file. Possible values
  # are :prefix, :suffix, :regex, :secondLine
  # :prefix => search each line start for a prefix 
  # :suffix => search each line ending for a suffix
  # :regex  => search each line via an actual regex
  # :secondLine => use the second line (or third if the second looks like an
  #                encoding line like Python)
  @searchMode = opts[:searchMode]
  # An additional argument to specify the thing that the search mode uses
  # to look for the build command. AKA, the actual prefix string or suffix
  # string or the regex object.
  @searchArgument = opts[:searchArgument]
  # Do we strip all found parts of the regex from the build command?
  @stripMatched = opts[:stripMatched]
  # Hash of variables that can be replaced in the build command
  @variables = opts[:variables]
  # Are variables disabled overall? Even the builtins that is...
  @variablesDisabled = opts[:variablesDisabled]
  # Do we stop when a file didn't have a command inside?
  @ignoreNonmatches = opts[:ignoreNonmatches]
end