Class: ReactOnRails::Generators::ReactNoReduxGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GeneratorHelper
Defined in:
lib/generators/react_on_rails/react_no_redux_generator.rb

Instance Method Summary collapse

Methods included from GeneratorHelper

#copy_file_and_missing_parent_directories, #dest_dir_exists?, #dest_file_exists?, #empty_directory_with_keep_file, #keep_file, #setup_file_error, #symlink_dest_file_to_dest_file

Instance Method Details

#copy_base_filesObject



18
19
20
21
22
# File 'lib/generators/react_on_rails/react_no_redux_generator.rb', line 18

def copy_base_files
  base_path = "no_redux/base/"
  file = "client/app/bundles/HelloWorld/containers/HelloWorld.jsx"
  copy_file(base_path + file, file)
end

#copy_server_rendering_files_if_appropriateObject



24
25
26
27
28
29
# File 'lib/generators/react_on_rails/react_no_redux_generator.rb', line 24

def copy_server_rendering_files_if_appropriate
  return unless options.server_rendering?
  base_path = "no_redux/server_rendering/"
  file = "client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx"
  copy_file(base_path + file, file)
end

#template_appropriate_version_of_hello_world_app_clientObject



31
32
33
34
35
# File 'lib/generators/react_on_rails/react_no_redux_generator.rb', line 31

def template_appropriate_version_of_hello_world_app_client
  filename = "HelloWorldAppClient.jsx"
  location = "client/app/bundles/HelloWorld/startup"
  template("no_redux/base/#{location}/HelloWorldAppClient.jsx.tt", "#{location}/#{filename}")
end