Method: MkSpec#run

Defined in:
lib/mspec/commands/mkspec.rb

#runObject



107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/mspec/commands/mkspec.rb', line 107

def run
  config[:requires].each { |lib| require lib }
  constants = config[:constants]
  constants = @map.filter(Object.constants) if constants.empty?

  @map.map({}, constants).each do |mod, methods|
    name = mod.chop
    next unless dir = create_directory(name)

    methods.each { |method| create_file dir, name, method, mod + method }
  end
end