rmtools 2.4.9 → 2.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e54c98862033d4ec75d2178223ac390eac3cca8
4
- data.tar.gz: a04c2e1e1fd7fa2d6bcd49d1660b0782faedd4ea
3
+ metadata.gz: 4d3b07b14c70d3dd59836d63413edd39658d8d58
4
+ data.tar.gz: c01da1e9feace4314ed357893e614791f25fa1a3
5
5
  SHA512:
6
- metadata.gz: 2e9d1f316fc909aa08a99827aa2de3a24433b53ad9d304e79c71dfedfa43ee15f7aaa36071a3522f0f4e57c731a786b5d84dd06aa5fea19c73e6853686739dd6
7
- data.tar.gz: da3cbc53ef93298a2c76f42b945fb5a00d1a1250a44c8c72be5af32b9e9b80f2db145cb1653d8ff0a94b88957a588885b1b55b5724e1169038ff5de150c5dd2e
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
- def to_json(*)
14
- Yajl::Encoder.encode self
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
- def from_json(options={}) # :symbolize_keys
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
- JSON.unparse self, options
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
@@ -11,6 +11,7 @@ begin
11
11
  else
12
12
  require 'openssl'
13
13
  end
14
+ rescue LoadError
14
15
  rescue Exception
15
16
  p $!
16
17
  nil
@@ -1,3 +1,3 @@
1
1
  module RMTools
2
- VERSION = '2.4.9'
2
+ VERSION = '2.4.10'
3
3
  end
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.9
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-08-15 00:00:00.000000000 Z
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.2.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