0.0
Repository is archived
Railtie, install generator, and helpers wiring a Rails app into ask-local's stable .localhost URLs: host authorization, Action Cable origins, Procfile $PORT rewrite, and an agent skill for local development.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 3.1
~> 13.0

Runtime

>= 0.1.1
>= 7.1
 Project Readme

DEPRECATED — fully superseded, nothing needed from this gem.

  • ask-local core injects RAILS_DEVELOPMENT_HOSTS per process, so Rails apps boot behind ask-local with zero config — no hosts patch needed.
  • Action Cable works by default behind ask-local: Rails 7+ allow_same_origin_as_host (default true) accepts the connection when the browser's Origin matches the proxied Host — no origins patch needed.
  • ask-local init already generates config/local.yml — no generator needed.
  • Ask::Local::Rails.url was only a wrapper around ENV["ASK_LOCAL_URL"], which ask-local injects into every process.

Archived at deprecated/ask-local-rails for history. No further development. Remove this gem from any Gemfile.

ask-local-rails

Gem Version

Rails integration for ask-local. Railtie, install generator, and helpers wiring a Rails app into stable https://<app>.localhost URLs. Requires Rails 7.1+.

Installation

gem "ask-local-rails"
bundle install
rails generate ask_local:install

The generator:

  • creates config/initializers/ask_local.rb
  • allows .localhost hosts + Cable origins in development.rb
  • rewrites hardcoded -p 3000 to -p $PORT in Procfile.dev/Procfile (compound lines it cannot classify are left alone with a warning)
  • creates an empty ask-local.json if missing

Helpers

Ask::Local::Rails.url    # => "https://fix-ui.myapp.localhost" (or fallback)
Ask::Local::Rails.host   # => "fix-ui.myapp.localhost"
Ask::Local::Rails.proxied?  # => true when booted through ask-local

Use url for mailer hosts, OmniAuth callbacks, and webhook targets — never hardcode localhost:3000.

Agent skill

Ships local_dev under ask/skills/ (auto-discovered by ask-skills): boot via ask-local, wire via ask-local get, callbacks from ASK_LOCAL_URL, doctor/list/prune for troubleshooting.

Development

bundle install
bundle exec rake test

License

MIT