Class: DropGit::Settings
- Inherits:
-
Object
- Object
- DropGit::Settings
- Defined in:
- lib/dropgit/settings.rb
Overview
Manage DropGit settings
Constant Summary collapse
- @@directory =
File.join(Dir.home, ".dropgit")
- @@filename =
File.join(@@directory, "settings")
Instance Attribute Summary collapse
-
#daemon_dir ⇒ Object
Returns the value of attribute daemon_dir.
-
#git_base ⇒ Object
Returns the value of attribute git_base.
-
#repositories ⇒ Object
Returns the value of attribute repositories.
Instance Method Summary collapse
- #add_repo(repository) ⇒ Object
-
#initialize ⇒ Settings
constructor
Constructor.
Constructor Details
#initialize ⇒ Settings
Constructor
10 11 12 13 |
# File 'lib/dropgit/settings.rb', line 10 def initialize Dir.mkdir(@@directory) unless Dir.exists?(@@directory) load end |
Instance Attribute Details
#daemon_dir ⇒ Object
Returns the value of attribute daemon_dir.
6 7 8 |
# File 'lib/dropgit/settings.rb', line 6 def daemon_dir @daemon_dir end |
#git_base ⇒ Object
Returns the value of attribute git_base.
6 7 8 |
# File 'lib/dropgit/settings.rb', line 6 def git_base @git_base end |
#repositories ⇒ Object
Returns the value of attribute repositories.
6 7 8 |
# File 'lib/dropgit/settings.rb', line 6 def repositories @repositories end |
Instance Method Details
#add_repo(repository) ⇒ Object
15 16 17 18 |
# File 'lib/dropgit/settings.rb', line 15 def add_repo(repository) @repositories << repository.data save end |