Class: RubyNative::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- RubyNative::Generators::InstallGenerator
- Defined in:
- lib/generators/ruby_native/install_generator.rb
Instance Method Summary collapse
- #add_allowed_host ⇒ Object
- #copy_claude_instructions ⇒ Object
- #copy_config ⇒ Object
- #print_next_steps ⇒ Object
Instance Method Details
#add_allowed_host ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/generators/ruby_native/install_generator.rb', line 12 def add_allowed_host host_line = ' config.hosts << ".trycloudflare.com"' dev_config = "config/environments/development.rb" return unless File.exist?(File.join(destination_root, dev_config)) return if File.read(File.join(destination_root, dev_config)).include?("trycloudflare") environment(host_line, env: "development") say " Added .trycloudflare.com to allowed hosts in development.rb", :green end |
#copy_claude_instructions ⇒ Object
23 24 25 26 |
# File 'lib/generators/ruby_native/install_generator.rb', line 23 def copy_claude_instructions return unless File.directory?(File.join(destination_root, ".claude")) copy_file "CLAUDE.md", ".claude/ruby_native.md" end |
#copy_config ⇒ Object
8 9 10 |
# File 'lib/generators/ruby_native/install_generator.rb', line 8 def copy_config template "ruby_native.yml", "config/ruby_native.yml" end |
#print_next_steps ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/generators/ruby_native/install_generator.rb', line 28 def print_next_steps say "" say "Ruby Native installed! Next steps:", :green say "" say " 1. Edit config/ruby_native.yml with your app name, colors, and tabs" say " 2. Add to your layout <head>:" say " <%= stylesheet_link_tag :ruby_native %>" say " 3. Add to your layout <body>:" say " <%= native_tabs_tag %>" say " 4. Preview on your device:" say " ruby_native preview" say "" if File.directory?(File.join(destination_root, ".claude")) say " Tip: .claude/ruby_native.md was added with setup instructions." say " Open Claude Code and ask \"what do I need to do next?\" for guided help." say "" end end |