sendify 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/sendify.rb +30 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDViZTVlMWU1ZDQyZmU4YTIxOTJjN2QyMzJiMDQwNDI2MTk2ZTEwMQ==
5
+ data.tar.gz: !binary |-
6
+ YjY4YTU2MjIxOGMxZDAyYTNiODU2YWIyYTU4ZWRiNTljMmQyN2RkOA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZGZhYTA4ZDM2YzFkZDcwYTkwOGMzNzQwZTg4MjExNjA4MGZlZjI4OTlmMTlj
10
+ MjJhYWRiNGMwZjI2MzJhYzhmMTliYWUyOTMyZWQ5NzU0OGIyM2FiOGU0NDAw
11
+ OTgxMWM0OTBmYmZmNGM3MDI0ZDEzMmM5NTcwNDIyNmQzZDBlNTA=
12
+ data.tar.gz: !binary |-
13
+ ZjBhYjdiN2RhY2RmNTc5ZjkyNjIwNDA5YzA1YzMzYTE1ZDdiNmMzNmQ5ZTMz
14
+ MTBjMGFiMTUyYjkzMDI5MWU2OGNkN2VjMWQ0MDI2NzY1ZGYyMDJlODVjZDE2
15
+ ODYxMWE0MDA5ZjBkYzhiZTA1YjBmN2ZmYWQwMDE3YjAyNWMxZmM=
data/lib/sendify.rb ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/ruby
2
+ require "rubygems"
3
+ require "xmpp4r"
4
+ require "xmpp4r/pubsub"
5
+ require "xmpp4r/pubsub/helper/servicehelper.rb"
6
+ require "xmpp4r/pubsub/helper/nodebrowser.rb"
7
+ require "xmpp4r/pubsub/helper/nodehelper.rb"
8
+ include Jabber
9
+ class Sendify
10
+ def connect(jid,password,service,ip)
11
+ client = Client.new(JID.new(jid))
12
+ client.connect(ip)
13
+ client.auth(password)
14
+ client
15
+ end
16
+
17
+ def createNode(client,service,node)
18
+ pubsub = PubSub::ServiceHelper.new(client, service)
19
+ pubsub.create_node(node)
20
+ end
21
+
22
+ def publish(client,service,node,element,msg)
23
+ pubsub = PubSub::ServiceHelper.new(client, service)
24
+ item = Jabber::PubSub::Item.new
25
+ xml = REXML::Element.new(element)
26
+ xml.text = msg
27
+ item.add(xml)
28
+ pubsub.publish_item_to(node, item)
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sendify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nikit Saraf
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: The library allows the ruby program to communicate with the Sendify server
14
+ email:
15
+ - nikit.saraf@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/sendify.rb
21
+ homepage:
22
+ licenses: []
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Sendify Server Library
44
+ test_files: []
45
+ has_rdoc: