Sha256: f1e070507538653d200c3aa2acc6fdda62526b17f5649661a33f354559e895c4
Contents?: true
Size: 845 Bytes
Versions: 5
Compression:
Stored size: 845 Bytes
Contents
require 'generators/transponder' module Transponder module Generators class PresenterGenerator < Base class_option :module_name, type: :string, aliases: '-m', default: 'application' def add_presenter presenter_path = File.join(javascripts_path, options[:module_name], "presenters/#{file_name.downcase}_presenter.coffee") template "_presenter.coffee", presenter_path end def presenter_class_name "#{options[:module_name].camelize}.Presenters.#{file_name.classify}Presenter" end def add_presenter_to_boot boot_file = File.join(javascripts_path, options[:module_name], 'initializers/boot.coffee') insert_into_file boot_file, "new #{presenter_class_name}()\n", after: "# presenters\n" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems