rmtools 2.4.9 → 2.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rmtools/conversions/json.rb +10 -4
- data/lib/rmtools/db.rb +1 -0
- data/lib/rmtools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d3b07b14c70d3dd59836d63413edd39658d8d58
|
4
|
+
data.tar.gz: c01da1e9feace4314ed357893e614791f25fa1a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6925f901894967db43a03ca37d23ceeae57430a447601b17f38ea02ebda6a8820c4e2b42f5feb59595705795c4b9225a43f9240479f99f0f4f7b08753ff3f54
|
7
|
+
data.tar.gz: 16e6bbc0c1108d0265a456d8942dc943b9c57a7ee7a598b1ca1ff45d71e013c699277e75165815036693712010c3bd165cbb82f926db89f62fe9b54b5b5a09ee
|
@@ -10,15 +10,17 @@ begin
|
|
10
10
|
|
11
11
|
[Array, Hash, String].each do |klass|
|
12
12
|
klass.class_eval do
|
13
|
-
|
14
|
-
|
13
|
+
# @ options : {:pretty, :indent => string}
|
14
|
+
def to_json(options={})
|
15
|
+
Yajl::Encoder.encode self, options
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
20
|
class String
|
20
21
|
# the opposite of #to_json
|
21
|
-
|
22
|
+
# @ options : {:symbolize_keys, :allow_comments, :check_utf8}
|
23
|
+
def from_json(options={})
|
22
24
|
Yajl::Parser.parse self, options
|
23
25
|
end
|
24
26
|
end
|
@@ -40,7 +42,11 @@ rescue LoadError
|
|
40
42
|
[Array, Hash].each do |klass|
|
41
43
|
klass.class_eval do
|
42
44
|
def to_json(options=nil)
|
43
|
-
|
45
|
+
if options.is_a? Hash and options[:pretty]
|
46
|
+
JSON.pretty_generate self, options
|
47
|
+
else
|
48
|
+
JSON.unparse self, options
|
49
|
+
end
|
44
50
|
end
|
45
51
|
end
|
46
52
|
end
|
data/lib/rmtools/db.rb
CHANGED
data/lib/rmtools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Baev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: RMTools is a collection of helpers for debug, text/array/file processing
|
14
14
|
and simply easing a coding process
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.4.8
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Collection of helpers for debug, text/array/file processing and simply easing
|