Sha256: 48e0b1b0581bda50bfb2d3ba1460b521b18ffc836869c6dc7942a29fd8023785
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
require 'rails/generators/base' module FluxFlex module Generators class InstallGenerator < Rails::Generators::Base desc <<DESC Description: Add files to deploy for fluxflex DESC def self.source_root @_flx_tools_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates')) end def copy_dot_flx template '.flx' end def copy_sh_files template 'fluxflex_deploy.sh' template 'fluxflex_rake.sh' template 'fluxflex_setup.sh' end def copy_dispatch_fcgi template 'flx_dispatch.fcgi', File.join('public', 'flx_dispatch.fcgi') end def copy_dot_htaccess template '.htaccess', File.join('public', '.htaccess') end def insert_gems gemfile = 'Gemfile' if File.exists?(gemfile) body = File.read(gemfile) File.open(gemfile, 'a') do |f| f.puts "gem 'mysql2'" unless body.match(/mysql/) f.puts "gem 'fcgi'" unless body.match(/fcgi/) end else raise Rails::Generators::Error, "Gemfile not found." end end def application_name Rails.application.class.name end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
flx-tools-0.2.0 | lib/generators/flux_flex/install_generator.rb |