squash_ruby 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/squash/ruby.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA512:
|
3
|
-
data.tar.gz:
|
4
|
-
metadata.gz:
|
3
|
+
data.tar.gz: 06d661c730c96f871d44e362e903682849cf480a7569edf14084672763ec972fe739e6464c423dd2adba967135377a759545476f2d75b96ed7fa5f7c87eb8693
|
4
|
+
metadata.gz: df5b5ff6449a36922cdd9c11ce78179a4935885aa21623bda5c2344e9113d8cb0676feaa55b2711177c2099dcfd25d0c2843ddad2c93e92c783ec1c274d06de3
|
5
5
|
SHA1:
|
6
|
-
data.tar.gz:
|
7
|
-
metadata.gz:
|
6
|
+
data.tar.gz: 3ca34bafbdf295810de3cd6f14716dad73be0cf3
|
7
|
+
metadata.gz: 47135b4e60669ad4039916d72d4139d7de3f8f76
|
data/README.md
CHANGED
@@ -177,6 +177,9 @@ options override `repository_root`.
|
|
177
177
|
it's set to `/api/1.0/notify`.
|
178
178
|
* `transmit_timeout`: The amount of time to wait before giving up on trasmitting
|
179
179
|
an error. By default this is treated as both an open and a read timeout.
|
180
|
+
* `max_variable_size`: The maximum size (in bytes) of a serialized
|
181
|
+
representation of a value that will be transmitted over the network. Values
|
182
|
+
that serialize to larger than this size will be replaced with a placeholder.
|
180
183
|
|
181
184
|
### Ignored Exceptions
|
182
185
|
|
data/lib/squash/ruby.rb
CHANGED
@@ -588,7 +588,7 @@ module Squash
|
|
588
588
|
inspect_result = begin filtered.inspect; rescue Exception => e; "[#{e.class}: #{e} raised when calling #inspect]" end
|
589
589
|
to_s_result = begin filtered.to_s; rescue Exception => e; "[#{e.class}: #{e} raised when calling #to_s]" end
|
590
590
|
|
591
|
-
{
|
591
|
+
serialized = {
|
592
592
|
'language' => 'ruby',
|
593
593
|
'class_name' => filtered.class.to_s,
|
594
594
|
'inspect' => inspect_result,
|
@@ -596,6 +596,20 @@ module Squash
|
|
596
596
|
'json' => json,
|
597
597
|
'to_s' => to_s_result
|
598
598
|
}
|
599
|
+
|
600
|
+
elements_only ? serialized : check_size(serialized)
|
601
|
+
end
|
602
|
+
end
|
603
|
+
|
604
|
+
def self.check_size(value)
|
605
|
+
if configuration(:max_variable_size)
|
606
|
+
value.each do |format, representation|
|
607
|
+
if representation.bytesize > configuration(:max_variable_size)
|
608
|
+
value[format] = '[exceeded maximum variable size]'
|
609
|
+
end
|
610
|
+
end
|
611
|
+
else
|
612
|
+
value
|
599
613
|
end
|
600
614
|
end
|
601
615
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squash_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Morgan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-21 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|