Class: Yaggy::MockSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/yaggy/mock_spec.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ MockSpec

Returns a new instance of MockSpec.

Yields:

  • (_self)

Yield Parameters:



9
10
11
12
# File 'lib/yaggy/mock_spec.rb', line 9

def initialize
  yield self
  @@gems[@@current_file] = self
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



6
7
# File 'lib/yaggy/mock_spec.rb', line 6

def method_missing(*args, &block)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



29
30
31
# File 'lib/yaggy/mock_spec.rb', line 29

def name
  @name
end

#versionObject

Returns the value of attribute version.



14
15
16
# File 'lib/yaggy/mock_spec.rb', line 14

def version
  @version
end

#version_lineObject (readonly)

Returns the value of attribute version_line.



14
15
16
# File 'lib/yaggy/mock_spec.rb', line 14

def version_line
  @version_line
end

Class Method Details

.capture_gemspec_info(gemspec) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/yaggy/mock_spec.rb', line 31

def self.capture_gemspec_info(gemspec)
  @@gems ||= {}
  @@current_file = gemspec
  old_verbose, $VERBOSE = $VERBOSE, nil
  old_spec = ::Gem::Specification
  ::Gem.const_set("Specification", ::Yaggy::MockSpec)
  load gemspec
  @@gems[@@current_file]
ensure
  Gem.const_set("Specification", ::Yaggy::MockSpec)
  $VERBOSE = old_verbose
end

Instance Method Details

#executablesObject



21
22
23
# File 'lib/yaggy/mock_spec.rb', line 21

def executables
  []
end

#filesObject



25
26
27
# File 'lib/yaggy/mock_spec.rb', line 25

def files
  []
end