Skip to content

Commit

Permalink
Create a rails executable for a development server
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Dec 20, 2018
1 parent 299c444 commit 8905193
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ Or install it yourself as:
## Development
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
After checking out the repo, run `bin/setup` to install dependencies.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
Run `bin/rails s` to start a webserver with a test app that has the engine mounted, then visit `http://localhost:3000/cfa/styleguide`. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
### Running tests
Expand Down
13 changes: 13 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/cfa', __dir__)
APP_PATH = File.expand_path('../spec/test_app/config/application', __dir__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/engine/commands'
3 changes: 3 additions & 0 deletions spec/test_app/config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rails.application.configure do
config.consider_all_requests_local = true
end

0 comments on commit 8905193

Please sign in to comment.