Class: Plok::Search::ClassGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/plok/search/class_generator.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
# File 'lib/generators/plok/search/class_generator.rb', line 7

def create
  copy_file "namespace_class.rb", namespace_class_path
  copy_file "namespace_class_spec.rb", namespace_class_spec_path
  gsub_file(namespace_class_path, '[namespace]', namespace_class)
  gsub_file(namespace_class_spec_path, '[namespace]', namespace_class)
  gsub_file(namespace_class_spec_path, '[snakecased_namespace]', options.namespace)
end