js_regex 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/js_regex.rb +6 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9285eb890f35a4088e8687054f54fc6355c187cc
4
- data.tar.gz: 6d8507eb2f1f214e78f5ff1e737a21b13717f093
3
+ metadata.gz: 6cb3d7055fec1f15ccd2de436ec8f2e54be92f44
4
+ data.tar.gz: 43eb2c6310a49e014f88c09ddf038c4f1e8e0203
5
5
  SHA512:
6
- metadata.gz: 9d3abdb39f18b9de007eddf174722f4e8cc7fa34b3bd93062c61fde7995d526562f7c783b06b9ce99f7fdfab0d097d6cfc558171b4c9ce9bf2a8887459b49926
7
- data.tar.gz: 626f7deb5c26f0100fd29904bcae4d25a57c12258f92c33b1bceab1db00f5d5904f635158a351d45efd13ab3a847a59cfff8e0afe02c26f74b18db25988e61ac
6
+ metadata.gz: 2e33845123254edea36788006898ade901b7d61b0f344658fb2f3fdb849a4e7865561b3e942b9773a393ede8a4a3ce047e13c1924662cb643f56cd6f9cc4a83c
7
+ data.tar.gz: 537f23e4ee912e8efb4fb0868409c2c0328be89cd7f4d05d003e583d47b8e9c908e7fb07a81be3cd21a0c8ad3c79ca2e56c17960359e0e04e71fe4deda9dfe26
data/lib/js_regex.rb CHANGED
@@ -9,6 +9,7 @@
9
9
  #
10
10
  class JsRegex
11
11
  require_relative File.join('js_regex', 'conversion')
12
+ require 'json'
12
13
 
13
14
  attr_reader :source, :options, :warnings
14
15
 
@@ -17,7 +18,11 @@ class JsRegex
17
18
  end
18
19
 
19
20
  def to_h
20
- { source: source.gsub('\\', '\\\\\\\\'), options: options }
21
+ { source: source, options: options }
22
+ end
23
+
24
+ def to_json(options = {})
25
+ to_h.to_json(options)
21
26
  end
22
27
 
23
28
  def to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_regex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janosch Müller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-16 00:00:00.000000000 Z
11
+ date: 2015-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regexp_parser