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.



7
8
9
# File 'lib/cgem/bundle_mirror.rb', line 7

def initialize(target = nil)
  @target = target || "https://rubygems.org" 
end

Instance Attribute Details

#mirrorObject

Returns the value of attribute mirror.



5
6
7
# File 'lib/cgem/bundle_mirror.rb', line 5

def mirror
  @mirror
end

#targetObject

Returns the value of attribute target.



5
6
7
# File 'lib/cgem/bundle_mirror.rb', line 5

def target
  @target
end

Instance Method Details

#getObject



15
16
17
# File 'lib/cgem/bundle_mirror.rb', line 15

def get
  `bundle config #{key}`
end

#keyObject



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