gon 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gon might be problematic. Click here for more details.

data/README.md CHANGED
@@ -349,13 +349,13 @@ Thats it!
349
349
  Puts this line into `Gemfile` then run `$ bundle`:
350
350
 
351
351
  ``` ruby
352
- gem 'gon', '3.0.3'
352
+ gem 'gon', '3.0.4'
353
353
  ```
354
354
 
355
355
  Or if you are old-school Rails 2 developer put this into `config/environment.rb` and run `$ rake gems:install`:
356
356
 
357
357
  ``` ruby
358
- config.gem 'gon', :version => '3.0.3'
358
+ config.gem 'gon', :version => '3.0.4'
359
359
  ```
360
360
 
361
361
  Or manually install gon gem: `$ gem install gon`
@@ -3,10 +3,10 @@ module Gon
3
3
  class << self
4
4
 
5
5
  def render_data(options)
6
+ data = Gon.all_variables || {}
6
7
  if Gon.global.all_variables.present?
7
- Gon::Request.gon['global'] = Gon.global.all_variables
8
+ data[:global] = Gon.global.all_variables
8
9
  end
9
- data = Gon.all_variables
10
10
  namespace = options[:namespace] || 'gon'
11
11
  need_tag = options[:need_tag].nil? || options[:need_tag]
12
12
  start = "#{need_tag ? '<script>' : ''}window.#{namespace} = {};"
@@ -24,7 +24,7 @@ module Gon
24
24
  end
25
25
 
26
26
  def clear
27
- @request_env['gon'] = {}
27
+ env && (env[:gon] = {})
28
28
  end
29
29
 
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Gon
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
@@ -4,6 +4,7 @@ describe Gon::Global do
4
4
 
5
5
  before(:each) do
6
6
  Gon::Global.clear
7
+ Gon::Request.instance_variable_set(:@request_env, nil)
7
8
  end
8
9
 
9
10
  describe '#all_variables' do
@@ -52,6 +53,7 @@ describe Gon::Global do
52
53
  it 'outputs correct js with an integer and integer in Gon' do
53
54
  Gon::Request.
54
55
  instance_variable_set(:@request_id, request.object_id)
56
+ Gon::Request.env = {}
55
57
  Gon.int = 1
56
58
  Gon.global.int = 1
57
59
  @base.include_gon.should == "<script>window.gon = {};" +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-23 00:00:00.000000000 Z
12
+ date: 2012-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project: gon
167
- rubygems_version: 1.8.24
167
+ rubygems_version: 1.8.23
168
168
  signing_key:
169
169
  specification_version: 3
170
170
  summary: Get your Rails variables in your JS