Module: Safeguard

Defined in:
lib/safeguard.rb,
lib/safeguard/digest.rb,
lib/safeguard/hasher.rb,
lib/safeguard/output.rb,
lib/safeguard/worker.rb,
lib/safeguard/command.rb,
lib/safeguard/version.rb,
lib/safeguard/verifier.rb,
lib/safeguard/repository.rb,
lib/safeguard/command/add.rb,
lib/safeguard/command/hash.rb,
lib/safeguard/command/init.rb,
lib/safeguard/digest/crc32.rb,
lib/safeguard/core_ext/file.rb,
lib/safeguard/command/verify.rb,
lib/safeguard/core_ext/module.rb,
lib/safeguard/output/terminal.rb,
lib/safeguard/command/add/hash.rb,
lib/safeguard/repository/hash_table.rb

Overview

Safeguard module.

Defined Under Namespace

Modules: CoreExt, Digest, Output, Version Classes: Command, Hasher, Repository, Verifier, Worker

Class Method Summary collapse

Class Method Details

.i18nObject

Directory where translations are kept.



25
26
27
# File 'lib/safeguard.rb', line 25

def i18n
  File.join root, 'i18n'
end

.initialize_i18nObject



34
35
36
# File 'lib/safeguard.rb', line 34

def initialize_i18n
  I18n.load_path = translation_files
end

.rootObject

Where the Safeguard installation is located.



20
21
22
# File 'lib/safeguard.rb', line 20

def root
  File.expand_path '../..', __FILE__
end

.run(*args) ⇒ Object

Run a command by name with the given arguments.



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

def run(*args)
  initialize_i18n
  Command.run *args
end

.translation_filesObject

Array of translation files.



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

def translation_files
  Dir[File.join(i18n, '*')]
end

.versionObject

Returns the version of Safeguard.



15
16
17
# File 'lib/safeguard.rb', line 15

def version
  Version::STRING
end