Class: Gem::Release::Context::Paths::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/gem/release/context/paths.rb

Direct Known Subclasses

ByGemspecs, ByNames

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namesObject

Returns the value of attribute names

Returns:

  • (Object)

    the current value of names



7
8
9
# File 'lib/gem/release/context/paths.rb', line 7

def names
  @names
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



7
8
9
# File 'lib/gem/release/context/paths.rb', line 7

def opts
  @opts
end

Instance Method Details

#currentObject



12
13
14
# File 'lib/gem/release/context/paths.rb', line 12

def current
  [[cwd, cwd.basename.to_s]]
end

#cwdObject



16
17
18
# File 'lib/gem/release/context/paths.rb', line 16

def cwd
  @cwd ||= Pathname.pwd
end

#in_dir(dir, &block) ⇒ Object



8
9
10
# File 'lib/gem/release/context/paths.rb', line 8

def in_dir(dir, &block)
  dir == cwd ? yield : Dir.chdir(dir, &block)
end