Class: Bagotrix
- Inherits:
-
Object
- Object
- Bagotrix
- Defined in:
- lib/bagotrix.rb
Constant Summary collapse
- NoUserMsg =
'you must set a github user with Bagotrix.use(username), or run "git config --global github.user"'
Class Attribute Summary collapse
-
.repo ⇒ Object
Returns the value of attribute repo.
-
.user ⇒ Object
Returns the value of attribute user.
-
.verbose ⇒ Object
Returns the value of attribute verbose.
Class Method Summary collapse
Class Attribute Details
.repo ⇒ Object
Returns the value of attribute repo.
6 7 8 |
# File 'lib/bagotrix.rb', line 6 def repo @repo end |
.user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/bagotrix.rb', line 6 def user @user end |
.verbose ⇒ Object
Returns the value of attribute verbose.
6 7 8 |
# File 'lib/bagotrix.rb', line 6 def verbose @verbose end |
Class Method Details
.config(options = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/bagotrix.rb', line 10 def config( = {}) self.user ||= [:user] self.repo = [:repo] if [:repo] self.verbose = [:verbose] end |
.load(path) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/bagotrix.rb', line 16 def load(path) raise NoUserMsg if user == '' uri = "https://github.com/#{user}/#{repo}/raw/master/#{path}.rb" puts "loading #{uri}" if verbose Object.class_eval(open(uri).read) end |