README.md in localtower-0.4.2 vs README.md in localtower-0.5.0

- old
+ new

@@ -20,31 +20,22 @@ ![Relations](https://raw.githubusercontent.com/damln/localtower/master/public/screenshots/v0.1.6/3_relations.png) ### Create a migration ![Migrations](https://raw.githubusercontent.com/damln/localtower/master/public/screenshots/v0.1.6/4_migrations.png) -### Using the Capture plugin -![Capture](https://raw.githubusercontent.com/damln/localtower/master/public/screenshots/v0.1.6/5_capture.png) - ## INSTALL -Only tested with Rails 4.2 and Rails 5.1 (should work with any Rails 4.2+ application). Only tested with PostgreSQL. +Should work with any Rails 4.2+ application. +Only tested with PostgreSQL. Add to your `Gemfile` file: ```ruby group :development do - gem "localtower", ">= 0.4.1" + gem "localtower" end ``` -If you want the latest master branch, add to your `Gemfile` file following: -```ruby -group :development do - gem "localtower", github: "damln/localtower" -end -``` - Run command in your terminal: ```bash bundle install ``` @@ -58,38 +49,31 @@ # Your other routes here: # ... end ``` -## Usage +/!\ IMPORTANT /!\ +Change your config/environments/development.rb: -Open your browser at [http://localhost:3000/localtower](http://localhost:3000/localtower). - -## Logger Usage (Capture plugin) - -You can put this line anywhere in your code: - ```ruby -Localtower::Plugins::Capture.new(self, binding).save -``` +Rails.application.configure do + # ... -For example: + # This is the default: + # config.active_record.migration_error = :page_load -```ruby -def my_method - user = User.find(1) - some_data = {foo: "bar"} + # Change it to: + config.active_record.migration_error = false if defined?(Localtower) - Localtower::Plugins::Capture.new(self, binding).save + # ... end ``` -Then go to the Localtower intercave here: [http://localhost:3000/localtower/logs](http://localhost:3000/localtower/logs) and you will see the variables `user` and `some_data` in the UI. +## Usage -### Notes for the Capture plugin: +Open your browser at [http://localhost:3000/localtower](http://localhost:3000/localtower). -The value for each variable will try to call `.to_json`. If you have a huge collection of models likes `@users` you will see all the collection as an Array. ## Run test If you want to contribute to the gem: @@ -108,11 +92,11 @@ ## Contribute Thanks for reporting issues, I'll do my best 💪 -[![Analytics](https://ga-beacon.appspot.com/UA-93841935-1/github-readme?pixel)](https://github.com/damln/localtower) +![ga](https://www.google-analytics.com/collect?v=1&tid=G-1XG3EBE2DZ&cid=555&aip=1&t=event&ec=github&ea=visit&dp=readme&dt=gem) ## Deploy Only for official contributors. @@ -122,6 +106,5 @@ Do not hesitate to open issues if you have troubles using the gem. - By Damian Le Nouaille Diez: https://damln.com - Link on RubyGems: https://rubygems.org/gems/localtower -