rails_javascript_helpers 1.3 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
- require 'action_view/helpers/javascript_helper'
2
1
 
3
2
  module RailsJavaScriptHelpers
4
3
 
@@ -22,6 +21,8 @@ module RailsJavaScriptHelpers
22
21
  arg.to_s
23
22
  when NilClass
24
23
  'null'
24
+ when RawJS
25
+ arg.to_s
25
26
  else
26
27
  arg.to_s.gsub(/\s+/, ' ') =~ %r{^\s*function\s*\(} ? arg.to_s : "'#{escape_javascript(arg.to_s)}'"
27
28
  end
@@ -37,3 +38,12 @@ module RailsJavaScriptHelpers
37
38
  end
38
39
 
39
40
  end
41
+
42
+ class RawJS
43
+ def initialize(s)
44
+ @s = s
45
+ end
46
+ def to_s
47
+ @s
48
+ end
49
+ end
@@ -1,3 +1,17 @@
1
1
  module RailsJavaScriptHelpers
2
- VERSION = '1.3'
2
+ class Version
3
+
4
+ attr_reader :major, :minor, :tiny
5
+
6
+ def initialize(version)
7
+ version = version.split('.')
8
+ @major, @minor, @tiny = [version[0].to_i, version[1].to_i, version[2].to_i]
9
+ end
10
+
11
+ def to_s
12
+ "#{@major}.#{@minor}.#{@tiny}"
13
+ end
14
+ end
15
+
16
+ VERSION = Version.new('1.4.0')
3
17
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_javascript_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- version: "1.3"
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Chris Roberts
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-06-22 00:00:00 -07:00
18
+ date: 2011-07-20 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency