Class: ReactRailsWebpack::NewForkGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/react_rails_webpack/new_fork_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_environment_json_fileObject



10
11
12
13
14
# File 'lib/react_rails_webpack/new_fork_generator.rb', line 10

def copy_environment_json_file
  inside 'client' do
    copy_file 'environment.json'
  end
end

#set_environment_hostnameObject



16
17
18
19
20
21
22
# File 'lib/react_rails_webpack/new_fork_generator.rb', line 16

def set_environment_hostname

  localhost_name = `scutil --get LocalHostName`.strip
  puts "Setting localhost name to #{localhost_name}..."

  gsub_file 'client/environment.json', /<<<LOCALHOST_NAME>>>/, localhost_name
end