Module: Riptables

Defined in:
lib/riptables.rb,
lib/riptables/rule.rb,
lib/riptables/chain.rb,
lib/riptables/error.rb,
lib/riptables/table.rb,
lib/riptables/version.rb,
lib/riptables/dsl/root.rb,
lib/riptables/dsl/rule.rb,
lib/riptables/condition.rb,
lib/riptables/dsl/table.rb,
lib/riptables/dsl/global.rb,
lib/riptables/table_export.rb,
lib/riptables/role_condition.rb,
lib/riptables/zone_condition.rb,
lib/riptables/rule_permutation.rb

Defined Under Namespace

Modules: DSL Classes: Chain, Condition, Error, RoleCondition, Rule, RulePermutation, Table, TableExport, ZoneCondition

Constant Summary collapse

VERSION =
'1.0.0'

Class Method Summary collapse

Class Method Details

.load_from_file(file) ⇒ Object

 Parse a given file



16
17
18
19
20
21
22
23
24
# File 'lib/riptables.rb', line 16

def self.load_from_file(file)
  if File.file?(file)
    dsl = DSL::Root.new
    dsl.instance_eval(File.read(file), file)
    true
  else
    raise Error, "File not found at `#{file}`"
  end
end

.tablesObject

 Store all tables configured



9
10
11
# File 'lib/riptables.rb', line 9

def self.tables
  @tables ||= []
end