Class: GithubBackup::Backup
- Inherits:
-
Object
- Object
- GithubBackup::Backup
- Defined in:
- lib/github-backup/backup.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#gists ⇒ Object
readonly
Returns the value of attribute gists.
-
#starred_gists ⇒ Object
readonly
Returns the value of attribute starred_gists.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#wikis ⇒ Object
readonly
Returns the value of attribute wikis.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(username, options = {}) ⇒ Backup
constructor
A new instance of Backup.
Constructor Details
#initialize(username, options = {}) ⇒ Backup
Returns a new instance of Backup.
5 6 7 8 9 10 11 12 13 |
# File 'lib/github-backup/backup.rb', line 5 def initialize(username, = {}) @username = username @debug = false @gists = .delete(:gists) @starred_gists = .delete(:starred_gists) @wikis = .delete(:wikis) @config = Config.new() @client = Octokit::Client.new(:access_token => config.token) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def config @config end |
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def debug @debug end |
#gists ⇒ Object (readonly)
Returns the value of attribute gists.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def gists @gists end |
#starred_gists ⇒ Object (readonly)
Returns the value of attribute starred_gists.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def starred_gists @starred_gists end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def username @username end |
#wikis ⇒ Object (readonly)
Returns the value of attribute wikis.
3 4 5 |
# File 'lib/github-backup/backup.rb', line 3 def wikis @wikis end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/github-backup/backup.rb', line 15 def execute backup_all rescue Octokit::Unauthorized puts "Github API authentication failed." puts "Please add a [github] section to your ~/.gitconfig" puts " See: http://github.com/guides/tell-git-your-user-name-and-email-address" puts "Or, use the arguments to authenticate with your username and API token." end |