Skip to content
This repository
Browse code

Added changelog and bumped version to 3.0.0

  • Loading branch information...
commit 0a349f0f22fa0e4d6555a37f36d9c36e47c36587 1 parent 7025aca
Alexey Gaziev authored

Showing 3 changed files with 40 additions and 5 deletions. Show diff stats Hide diff stats

  1. +11 0 CHANGELOG.md
  2. +28 4 README.md
  3. +1 1  lib/gon/version.rb
11 CHANGELOG.md
Source Rendered
... ... @@ -0,0 +1,11 @@
  1 +# CHANGELOG
  2 +
  3 +## 3.0.0
  4 +
  5 + * Almost all code refactored
  6 + * Added Gon.global for using gon everywhere
  7 + * Included ActionView::Helpers into Rabl::Engine
  8 +
  9 +## 2.3.0
  10 +
  11 + * Don't really remember what was before this version
32 README.md
Source Rendered
@@ -7,7 +7,7 @@
7 7
8 8 If you need to send some data to your js files and you don't want to do this with long way through views and parsing - use this force!
9 9
10   -Now with [Jbuilder](https://github.com/rails/jbuilder) and [Rabl](https://github.com/nesquena/rabl) support!
  10 +With [Jbuilder](https://github.com/rails/jbuilder) and [Rabl](https://github.com/nesquena/rabl) support!
11 11
12 12 For Sinatra available [gon-sinatra](https://github.com/gazay/gon-sinatra).
13 13
@@ -129,7 +129,7 @@ alert(customNamespace.yourHash)
129 129
130 130 ## Usage with Rabl
131 131
132   -Now you can write your variables assign logic to templates with [Rabl](https://github.com/nesquena/rabl).
  132 +You can write your variables assign logic to templates with [Rabl](https://github.com/nesquena/rabl).
133 133 The way of writing Rabl templates is very clearly described in their repo.
134 134
135 135 Add Rabl to your Gemfile before requiring gon - because gon checks Rabl constant
@@ -297,18 +297,42 @@ alert(gon.comments[0])
297 297 P.s. If you didn't put include_gon tag in your html head area - it
298 298 wouldn't work. You can read about this in common usage above.
299 299
  300 +## gon.global
  301 +
  302 +Now you can use gon for sending your data to js from anywhere!
  303 +
  304 +It works just as simple `gon` but you need to write `Gon.global` instead of `gon` in your ruby code,
  305 +`gon.global` in javascript and it will not clear self after each request. All other things the same.
  306 +
  307 +For example I want to tell anybody my application session secret token :) Now with Gon.global it's easy!
  308 +
  309 +`config/initializers/secret_token.rb`
  310 +
  311 +```ruby
  312 +GonTest::Application.config.secret_token = 'You can't see my token'
  313 +Gon.global.session = 'You can't see it I said'
  314 +```
  315 +
  316 +`in some js which can reach window.gon variable`
  317 +
  318 +```javascript
  319 +alert(gon.global.session)
  320 +```
  321 +
  322 +Thats it!
  323 +
300 324 ## Installation
301 325
302 326 Puts this line into `Gemfile` then run `$ bundle`:
303 327
304 328 ``` ruby
305   -gem 'gon', '2.3.0'
  329 +gem 'gon', '3.0.0'
306 330 ```
307 331
308 332 Or if you are old-school Rails 2 developer put this into `config/environment.rb` and run `$ rake gems:install`:
309 333
310 334 ``` ruby
311   -config.gem 'gon', :version => '2.3.0'
  335 +config.gem 'gon', :version => '3.0.0'
312 336 ```
313 337
314 338 Or manually install gon gem: `$ gem install gon`
2  lib/gon/version.rb
... ... @@ -1,3 +1,3 @@
1 1 module Gon
2   - VERSION = '2.3.0'
  2 + VERSION = '3.0.0'
3 3 end

0 comments on commit 0a349f0

Please sign in to comment.
Something went wrong with that request. Please try again.