Class: DCCSCR::Whitelist
- Inherits:
-
Object
- Object
- DCCSCR::Whitelist
- Defined in:
- lib/dccscr/whitelist.rb
Overview
Class to download the dccscr_whitelist repo and store greylist entries.
Defined Under Namespace
Classes: Entry, UpdateAllowlistWithDCCSCR
Constant Summary collapse
- UPSTREAM_REPO =
'https://repo1.dso.mil/dsop/dccscr-whitelists.git'
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #[](subpath) ⇒ Object
-
#initialize(path: nil, repo: nil, clone: true, clone_options: '--depth 1') ⇒ Whitelist
constructor
A new instance of Whitelist.
Constructor Details
#initialize(path: nil, repo: nil, clone: true, clone_options: '--depth 1') ⇒ Whitelist
Returns a new instance of Whitelist.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dccscr/whitelist.rb', line 16 def initialize(path: nil, repo: nil, clone: true, clone_options: '--depth 1') if path @path = path else @path = Dir.mktmpdir at_exit { FileUtils.remove_entry @path } end if repo @repo = repo else @repo = UPSTREAM_REPO end clone_repo() if clone @entries = {} end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
14 15 16 |
# File 'lib/dccscr/whitelist.rb', line 14 def entries @entries end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'lib/dccscr/whitelist.rb', line 14 def path @path end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
14 15 16 |
# File 'lib/dccscr/whitelist.rb', line 14 def repo @repo end |