Module: QuickShoulda

Extended by:
Errors, FileWriter, Generator, Main, PathResolver, StringHelpers
Defined in:
lib/quick_shoulda.rb,
lib/quick_shoulda/main.rb,
lib/quick_shoulda/errors.rb,
lib/quick_shoulda/version.rb,
lib/quick_shoulda/generator.rb,
lib/quick_shoulda/file_writer.rb,
lib/quick_shoulda/path_resolver.rb,
lib/quick_shoulda/config_file_reader.rb,
lib/quick_shoulda/generator/validation.rb,
lib/quick_shoulda/generator/association.rb,
lib/quick_shoulda/generator/spec_content.rb,
lib/quick_shoulda/helpers/string_helpers.rb,
lib/generators/quick_shoulda/g/g_generator.rb,
lib/generators/quick_shoulda/install/install_generator.rb

Defined Under Namespace

Modules: ConfigFileReader, Errors, FileWriter, Generator, Main, PathResolver, StringHelpers Classes: GGenerator, InstallGenerator

Constant Summary collapse

VERSION =
"0.2.1"

Constants included from Generator::Association

Generator::Association::MappedMacros, Generator::Association::OptionMethods, Generator::Association::SingleQuoteMethods

Constants included from Generator::Validation

Generator::Validation::AllowsValidators, Generator::Validation::AttrsFilters, Generator::Validation::Filters, Generator::Validation::InclusionOptions, Generator::Validation::OptionMethods

Constants included from FileWriter

FileWriter::DescribeRegex

Class Method Summary collapse

Methods included from Main

configure_and_generate, included

Methods included from Generator::SpecContent

#block_describe_header, #shoulda_content, #spec_init_content

Methods included from Generator::Association

#generate_associations

Methods included from Generator::Validation

#generate_validations, included

Methods included from FileWriter

clear_all_blocks, clear_block, create_file_and_write_init_content, write_block

Methods included from StringHelpers

camelize, value_transform

Class Method Details

._process(path) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/quick_shoulda.rb', line 23

def _process(path)			
unless is_a_constant?(path)
	raise NotAModelPathError unless path =~ /models\//
	raise FileDoesNotExistError unless File.file?(path)
	raise NotRubyFileError unless File.extname(path) == '.rb'
end

configure_and_generate(path)
end

.process(paths) ⇒ Object

Raises:



18
19
20
21
# File 'lib/quick_shoulda.rb', line 18

def process(paths)
	raise PathNotGivenError if paths.empty?
	paths.each { |path| _process(path) }
end