Class: GitHelper::ChangeRemote
- Inherits:
-
Object
- Object
- GitHelper::ChangeRemote
- Defined in:
- lib/git_helper/change_remote.rb
Instance Attribute Summary collapse
-
#new_owner ⇒ Object
Returns the value of attribute new_owner.
-
#old_owner ⇒ Object
Returns the value of attribute old_owner.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(old_owner, new_owner) ⇒ ChangeRemote
constructor
A new instance of ChangeRemote.
Constructor Details
#initialize(old_owner, new_owner) ⇒ ChangeRemote
Returns a new instance of ChangeRemote.
5 6 7 8 |
# File 'lib/git_helper/change_remote.rb', line 5 def initialize(old_owner, new_owner) @old_owner = old_owner @new_owner = new_owner end |
Instance Attribute Details
#new_owner ⇒ Object
Returns the value of attribute new_owner.
3 4 5 |
# File 'lib/git_helper/change_remote.rb', line 3 def new_owner @new_owner end |
#old_owner ⇒ Object
Returns the value of attribute old_owner.
3 4 5 |
# File 'lib/git_helper/change_remote.rb', line 3 def old_owner @old_owner end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/git_helper/change_remote.rb', line 10 def execute original_dir = Dir.pwd nested_dirs = Dir.entries(original_dir).select do |entry| entry_dir = File.join(original_dir, entry) File.directory?(entry_dir) && !(entry == '.' || entry == '..') end nested_dirs.each do |nested_dir| process_dir(nested_dir, original_dir) end end |