Class: Havior::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Havior::Generators::InstallGenerator
- Defined in:
- lib/generators/havior/install_generator.rb
Instance Method Summary collapse
- #copy_haxe_libs ⇒ Object
- #create_haxe_hxml ⇒ Object
- #inject_havior_helper ⇒ Object
- #inject_routes ⇒ Object
Instance Method Details
#copy_haxe_libs ⇒ Object
11 12 13 14 |
# File 'lib/generators/havior/install_generator.rb', line 11 def copy_haxe_libs copy_file "haxe/lib/Havior.hx", "haxe/lib/Havior.hx" copy_file "haxe/lib/FileUploader.hx", "haxe/lib/FileUploader.hx" end |
#create_haxe_hxml ⇒ Object
7 8 9 |
# File 'lib/generators/havior/install_generator.rb', line 7 def create_haxe_hxml create_file "haxe/havior.hxml", "" end |
#inject_havior_helper ⇒ Object
16 17 18 19 20 21 |
# File 'lib/generators/havior/install_generator.rb', line 16 def inject_havior_helper inject_into_file "app/helpers/application_helper.rb", after: "module ApplicationHelper\n"do " include Havior::Helper\n" end end |
#inject_routes ⇒ Object
23 24 25 26 27 28 |
# File 'lib/generators/havior/install_generator.rb', line 23 def inject_routes inject_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do " Dir[\"#{Rails.root}/app/haviors/**/routes.rb\"].each{|r| load r }\n" end end |