lib/esse/cli/generate.rb in esse-0.0.5 vs lib/esse/cli/generate.rb in esse-0.1.1

- old
+ new

@@ -5,11 +5,11 @@ require_relative 'base' module Esse module CLI class Generate < Base - NAMESPACE_PATTERN_RE = %r{\:|/|\\}i.freeze + NAMESPACE_PATTERN_RE = %r{:|/|\\}i.freeze def self.source_root File.dirname(__FILE__) end @@ -28,15 +28,19 @@ base_dir.join("#{index_name}.rb"), ) @types.each do |type| @type = Hstring.new(type).underscore copy_file( - 'templates/mappings.json', + 'templates/type_mappings.json', base_dir.join(index_name, 'templates', "#{@type}_mapping.json"), ) template( - 'templates/serializer.rb.erb', + 'templates/type_serializer.rb.erb', base_dir.join(index_name, 'serializers', "#{@type}_serializer.rb"), + ) + template( + 'templates/type_collection.rb.erb', + base_dir.join(index_name, 'collections', "#{@type}_collection.rb"), ) end end protected