Class: Renegade::ProtectedFiles
- Inherits:
-
Object
- Object
- Renegade::ProtectedFiles
- Defined in:
- lib/renegade/protected_files.rb
Overview
Check protected files
Instance Attribute Summary collapse
-
#protected_files ⇒ Object
readonly
Returns the value of attribute protected_files.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize ⇒ ProtectedFiles
constructor
A new instance of ProtectedFiles.
- #run(files) ⇒ Object
Constructor Details
#initialize ⇒ ProtectedFiles
Returns a new instance of ProtectedFiles.
8 9 10 11 12 |
# File 'lib/renegade/protected_files.rb', line 8 def initialize # Instance variables @warnings = [] @protected_files = ['app.config', 'web.config'] end |
Instance Attribute Details
#protected_files ⇒ Object (readonly)
Returns the value of attribute protected_files.
6 7 8 |
# File 'lib/renegade/protected_files.rb', line 6 def protected_files @protected_files end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
6 7 8 |
# File 'lib/renegade/protected_files.rb', line 6 def warnings @warnings end |
Instance Method Details
#run(files) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/renegade/protected_files.rb', line 14 def run(files) files.each do |file| if @protected_files.include?(File.basename(file).downcase) @warnings.push 'Warning! You are making changes to: ' + file.highlight end end end |