lita-xmpp 1.0.1 → 1.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0559c058011821e33cfe9927092a926fe99c800
|
4
|
+
data.tar.gz: f03630839b498fa8d81a2aba76c7eddad40becdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4876a1a0e30e193896890ae2cd8e06ebfe83487c8a6d81b89e934c38c205e476a3b79229bb5fc4bf8cf17f7cbb10440d3ad280473faf311e897e59b69883c5
|
7
|
+
data.tar.gz: 187c3d4b68ddcaeba985a68300cdd326f8842cf1d12a05b3e804891ef74d23821fd2f0cbd9a1fd61d1ee04a5ed7d81a537cf4ab699ae16361205c5b583d5287c
|
data/lib/lita/adapters/xmpp.rb
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'xmpp4r'
|
2
|
+
|
3
|
+
module Lita
|
4
|
+
module Adapters
|
5
|
+
# Usage:
|
6
|
+
#
|
7
|
+
# h = HtmlMessage.new
|
8
|
+
# h.add_text = "Hi"
|
9
|
+
#
|
10
|
+
# Or:
|
11
|
+
#
|
12
|
+
# HtmlMessage.new { add_text "hi" }
|
13
|
+
class HtmlMessage
|
14
|
+
include ::Jabber
|
15
|
+
attr_reader :body, :doc
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@doc = REXML::Element::new("html")
|
19
|
+
@body = REXML::Element::new("body")
|
20
|
+
|
21
|
+
build
|
22
|
+
|
23
|
+
yield(self) if block_given?
|
24
|
+
end
|
25
|
+
|
26
|
+
def message
|
27
|
+
doc.add body
|
28
|
+
doc
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_text(str)
|
32
|
+
text = REXML::Text.new("#{str}", false, nil, true, nil, %r/.^/)
|
33
|
+
body.add text
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_link(text, url)
|
37
|
+
link = REXML::Element.new('a')
|
38
|
+
link.add_attribute('href', url)
|
39
|
+
link.text = text
|
40
|
+
|
41
|
+
body.add link
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def build
|
47
|
+
doc.add_namespace('http://jabber.org/protocol/xhtml-im')
|
48
|
+
body.add_namespace('http://www.w3.org/1999/xhtml')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-xmpp"
|
3
|
-
spec.version = "1.0.
|
3
|
+
spec.version = "1.0.2"
|
4
4
|
spec.authors = ["Justin Mazzi"]
|
5
5
|
spec.email = ["jmazzi@gmail.com"]
|
6
6
|
spec.description = %q{A XMPP adapter for Lita.}
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.require_paths = ["lib"]
|
15
15
|
|
16
16
|
spec.add_runtime_dependency "lita", "~> 2.0"
|
17
|
-
spec.add_runtime_dependency "gmcmillan-xmpp4r", "~> 0.
|
17
|
+
spec.add_runtime_dependency "gmcmillan-xmpp4r", "~> 0.6.2"
|
18
18
|
|
19
19
|
spec.add_development_dependency "bundler", "~> 1.3"
|
20
20
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-xmpp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Mazzi
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.6.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.6.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,8 +125,9 @@ files:
|
|
125
125
|
- lib/lita/adapters/xmpp.rb
|
126
126
|
- lib/lita/adapters/xmpp/callback.rb
|
127
127
|
- lib/lita/adapters/xmpp/connector.rb
|
128
|
+
- lib/lita/adapters/xmpp/html_message.rb
|
128
129
|
- lib/lita/encoding_patches.rb
|
129
|
-
- lita-
|
130
|
+
- lita-xmpp.gemspec
|
130
131
|
- spec/lita/adapters/hipchat/callback_spec.rb
|
131
132
|
- spec/lita/adapters/hipchat/connector_spec.rb
|
132
133
|
- spec/lita/adapters/hipchat_spec.rb
|