xrc 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f2c63cc74bafc1ffc668b140d15530675880580
4
- data.tar.gz: d01f056f6639aa6b59323382386bc2a0e9ebfb92
3
+ metadata.gz: d1c9b3c231ceb3468d44f981be594134f0a509c8
4
+ data.tar.gz: 2ae97cce486e72023042776436db68ca75bcf967
5
5
  SHA512:
6
- metadata.gz: 24f786047c33186937c1c2082d4e37a56311e72132a7ef2c2e327265aef61b32d38c41a61fbea80eed0e0b549b99e7da66e57839401568173d2a02d7c7e660d1
7
- data.tar.gz: 7132b012ec6ae47f5bcc7d5ac54fed8b674a9e743bcd14e35c3649dc89b1ab04265940de2ba21b5560e083a556e66fb376dcacd4b13aad97470721f76b5ad780
6
+ metadata.gz: 21aad4771710dd78c09f4473a00dbb4ce781c2a601855c40f87ed00a05a0a524f7a5043536ea0285a5189e8a7db4884b8bbffe53f843103c23c21e55125229c3
7
+ data.tar.gz: 8ea39b028a96bc0e149023844aefe9e4e27559929e1d61fb2c735c3fb52c240d9fea108eb7f64632aca170efb4060cf30315e5112055ad94694653e69440a58d
@@ -1,3 +1,6 @@
1
+ ## 0.1.5
2
+ * Supress control characters in given message (Thx @masutaka)
3
+
1
4
  ## 0.1.4
2
5
  * Add `on_connection_established` callback
3
6
 
@@ -37,11 +37,22 @@ module Xrc
37
37
 
38
38
  def characters(text)
39
39
  if current
40
- text = REXML::Text.new(text, current.whitespace, nil, true)
40
+ text = REXML::Text.new(to_safe(text), current.whitespace, nil, true)
41
41
  current.add(text)
42
42
  end
43
43
  end
44
44
 
45
+ def to_safe(text)
46
+ text.chars.map do |c|
47
+ case c.ord
48
+ when *REXML::Text::VALID_CHAR
49
+ c
50
+ else
51
+ ""
52
+ end
53
+ end.join
54
+ end
55
+
45
56
  def end_document
46
57
  end
47
58
 
@@ -1,3 +1,3 @@
1
1
  module Xrc
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.2.2
151
+ rubygems_version: 2.4.5
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: XMPP Ruby Client.