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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/lib/squash/ruby.rb +15 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA512:
3
- data.tar.gz: 1af4ce93466616f0fecfd2d26f22f548db6701a9ccdcf57aa3f766f84933880268d7212ade6ffab8a19e239c9f60a8c6786237be100677eb9ec814fa586b24ce
4
- metadata.gz: 755f59365618372f00d0bb29e8f620a6b2062fd99023de5bf814831ab417a388d5b64ef6b6e01d6d29b63e55aaeb1d2f2fda8cbaf09405725965cfbace10fe9f
3
+ data.tar.gz: 06d661c730c96f871d44e362e903682849cf480a7569edf14084672763ec972fe739e6464c423dd2adba967135377a759545476f2d75b96ed7fa5f7c87eb8693
4
+ metadata.gz: df5b5ff6449a36922cdd9c11ce78179a4935885aa21623bda5c2344e9113d8cb0676feaa55b2711177c2099dcfd25d0c2843ddad2c93e92c783ec1c274d06de3
5
5
  SHA1:
6
- data.tar.gz: 380fc510872a2150e01f272ea754d3cf591e15a5
7
- metadata.gz: 72eefccd008d88bc99ff8abffb1bd462a8b8ad28
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.2.3
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-11-26 00:00:00 Z
12
+ date: 2013-12-21 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime