Class: Cgem::BundleMirror
- Inherits:
-
Object
- Object
- Cgem::BundleMirror
- Defined in:
- lib/cgem/bundle_mirror.rb
Instance Attribute Summary collapse
-
#mirror ⇒ Object
Returns the value of attribute mirror.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(target = nil) ⇒ BundleMirror
constructor
A new instance of BundleMirror.
- #key ⇒ Object
- #set(mirror) ⇒ Object
Constructor Details
#initialize(target = nil) ⇒ BundleMirror
Returns a new instance of BundleMirror.
5 6 7 |
# File 'lib/cgem/bundle_mirror.rb', line 5 def initialize(target = nil) @target = target || "https://rubygems.org" end |
Instance Attribute Details
#mirror ⇒ Object
Returns the value of attribute mirror.
3 4 5 |
# File 'lib/cgem/bundle_mirror.rb', line 3 def mirror @mirror end |
#target ⇒ Object
Returns the value of attribute target.
3 4 5 |
# File 'lib/cgem/bundle_mirror.rb', line 3 def target @target end |
Instance Method Details
#get ⇒ Object
13 14 15 |
# File 'lib/cgem/bundle_mirror.rb', line 13 def get `bundle config #{key}` end |
#key ⇒ Object
9 10 11 |
# File 'lib/cgem/bundle_mirror.rb', line 9 def key "mirror.#{target}" end |
#set(mirror) ⇒ Object
17 18 19 |
# File 'lib/cgem/bundle_mirror.rb', line 17 def set(mirror) `bundle config #{key} #{mirror}` end |