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.
7 8 9 |
# File 'lib/cgem/bundle_mirror.rb', line 7 def initialize(target = nil) @target = target || "https://rubygems.org" end |
Instance Attribute Details
#mirror ⇒ Object
Returns the value of attribute mirror.
5 6 7 |
# File 'lib/cgem/bundle_mirror.rb', line 5 def mirror @mirror end |
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/cgem/bundle_mirror.rb', line 5 def target @target end |
Instance Method Details
#get ⇒ Object
15 16 17 |
# File 'lib/cgem/bundle_mirror.rb', line 15 def get `bundle config #{key}` end |
#key ⇒ Object
11 12 13 |
# File 'lib/cgem/bundle_mirror.rb', line 11 def key "mirror.#{target}" end |
#set(mirror) ⇒ Object
19 20 21 |
# File 'lib/cgem/bundle_mirror.rb', line 19 def set(mirror) `bundle config #{key} #{mirror}` end |