Class: Cgem::BundleMirror

Inherits:
Object
  • Object
show all
Defined in:
lib/cgem/bundle_mirror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#mirrorObject

Returns the value of attribute mirror.



3
4
5
# File 'lib/cgem/bundle_mirror.rb', line 3

def mirror
  @mirror
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/cgem/bundle_mirror.rb', line 3

def target
  @target
end

Instance Method Details

#getObject



13
14
15
# File 'lib/cgem/bundle_mirror.rb', line 13

def get
  `bundle config #{key}`
end

#keyObject



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