Class: Repository
- Inherits:
-
Object
- Object
- Repository
- Defined in:
- lib/git/dropbox/repository.rb
Constant Summary collapse
- DROPBOX_GIT_CMD =
File.join(File.dirname(__FILE__), "git-dropbox-org.sh")
Instance Method Summary collapse
-
#initialize(config) ⇒ Repository
constructor
A new instance of Repository.
- #sync(repo, add_repo_to_list = true) ⇒ Object
Constructor Details
#initialize(config) ⇒ Repository
Returns a new instance of Repository.
5 6 7 |
# File 'lib/git/dropbox/repository.rb', line 5 def initialize(config) @config = config end |
Instance Method Details
#sync(repo, add_repo_to_list = true) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/git/dropbox/repository.rb', line 9 def sync(repo, add_repo_to_list=true) system "cd #{repo}; #{DROPBOX_GIT_CMD}" if add_repo_to_list @config['repositories'] ||= [] @config['repositories'] << repo @config['repositories'].uniq! @config.save end end |