Class: EySecrets::Repository
- Inherits:
-
Struct
- Object
- Struct
- EySecrets::Repository
- Defined in:
- lib/ey_secrets/models/repository.rb
Defined Under Namespace
Classes: NotReadyForUpdate
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#ready_for_update ⇒ Object
Returns the value of attribute ready_for_update.
-
#remotes ⇒ Object
Returns the value of attribute remotes.
Instance Method Summary collapse
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files
2 3 4 |
# File 'lib/ey_secrets/models/repository.rb', line 2 def files @files end |
#ready_for_update ⇒ Object
Returns the value of attribute ready_for_update
2 3 4 |
# File 'lib/ey_secrets/models/repository.rb', line 2 def ready_for_update @ready_for_update end |
#remotes ⇒ Object
Returns the value of attribute remotes
2 3 4 |
# File 'lib/ey_secrets/models/repository.rb', line 2 def remotes @remotes end |
Instance Method Details
#assert_ready_for_update ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ey_secrets/models/repository.rb', line 14 def assert_ready_for_update unless ready_for_update? raise(NotReadyForUpdate, 'Commit on master and push your changes before updating config.' \ "\n\n" \ 'Config can only be updated from the master branch. ' \ 'This helps ensure that the credentials found on a production ' \ 'system always reflect the current state of the master branch.') end end |
#glob(pattern) ⇒ Object
10 11 12 |
# File 'lib/ey_secrets/models/repository.rb', line 10 def glob(pattern) files.select { |file| File.fnmatch(pattern, file) } end |
#ready_for_update? ⇒ Boolean
6 7 8 |
# File 'lib/ey_secrets/models/repository.rb', line 6 def ready_for_update? ready_for_update end |