strophe_ruby 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.
- data/.autotest +9 -0
- data/History.txt +4 -0
- data/Manifest.txt +24 -0
- data/PostInstall.txt +7 -0
- data/README.rdoc +152 -0
- data/Rakefile +23 -0
- data/ext/strophe_ruby/extconf.rb +7 -0
- data/ext/strophe_ruby/libexpat.a +0 -0
- data/ext/strophe_ruby/libstrophe.a +0 -0
- data/ext/strophe_ruby/strophe.h +363 -0
- data/ext/strophe_ruby/strophe/common.h +293 -0
- data/ext/strophe_ruby/strophe/hash.h +64 -0
- data/ext/strophe_ruby/strophe/sock.h +51 -0
- data/ext/strophe_ruby/strophe/tls.h +46 -0
- data/ext/strophe_ruby/strophe_ruby.c +661 -0
- data/lib/strophe_ruby.rb +6 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/tasks/extconf.rake +13 -0
- data/tasks/extconf/strophe_ruby.rake +47 -0
- data/test/test_helper.rb +3 -0
- data/test/test_strophe_ruby.rb +11 -0
- data/test/test_strophe_ruby_extn.rb +9 -0
- metadata +93 -0
data/lib/strophe_ruby.rb
ADDED
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/strophe_ruby.rb'}"
|
9
|
+
puts "Loading strophe_ruby gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/tasks/extconf.rake
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
namespace :extconf do
|
2
|
+
desc "Compiles the Ruby extension"
|
3
|
+
task :compile
|
4
|
+
end
|
5
|
+
|
6
|
+
task :compile => "extconf:compile"
|
7
|
+
|
8
|
+
task :test => :compile
|
9
|
+
|
10
|
+
BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}"
|
11
|
+
$hoe.clean_globs |= ["ext/**/#{BIN}", "lib/**/#{BIN}", 'ext/**/Makefile']
|
12
|
+
$hoe.spec.require_paths = Dir['{lib,ext/*}']
|
13
|
+
$hoe.spec.extensions = FileList["ext/**/extconf.rb"].to_a
|
@@ -0,0 +1,47 @@
|
|
1
|
+
namespace :extconf do
|
2
|
+
extension = File.basename(__FILE__, '.rake')
|
3
|
+
|
4
|
+
ext = "ext/#{extension}"
|
5
|
+
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
6
|
+
ext_files = FileList[
|
7
|
+
"#{ext}/*.c",
|
8
|
+
"#{ext}/*.h",
|
9
|
+
"#{ext}/*.rl",
|
10
|
+
"#{ext}/expat/lib/*.h",
|
11
|
+
"#{ext}/expat/lib/*.c",
|
12
|
+
"#{ext}/strophe/*.h",
|
13
|
+
"#{ext}/strophe/*.c",
|
14
|
+
"#{ext}/extconf.rb",
|
15
|
+
"#{ext}/Makefile",
|
16
|
+
# "lib"
|
17
|
+
]
|
18
|
+
|
19
|
+
|
20
|
+
task :compile => extension do
|
21
|
+
if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
|
22
|
+
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
23
|
+
STDERR.puts "Gem actually failed to build. Your system is"
|
24
|
+
STDERR.puts "NOT configured properly to build #{GEM_NAME}."
|
25
|
+
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
26
|
+
exit(1)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Builds just the #{extension} extension"
|
31
|
+
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
|
32
|
+
|
33
|
+
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
34
|
+
Dir.chdir(ext) do ruby "extconf.rb" end
|
35
|
+
end
|
36
|
+
|
37
|
+
file ext_so => ext_files do
|
38
|
+
Dir.chdir(ext) do
|
39
|
+
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
|
40
|
+
if !ok
|
41
|
+
require "fileutils"
|
42
|
+
FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: strophe_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "Fran\xC3\xA7ois Lamontagne"
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-12-11 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.8.0
|
24
|
+
version:
|
25
|
+
description: "Ruby bindings for Strophe 'http://code.stanziq.com/strophe/', a C library for writing XMPP clients. If all you need is a simple XMPP bot that react to message and presence notifications, you might be better off with XMPPBot, which is an implementation I wrote on top of StropheRuby. IMPORTANT : This gem is quite experimental currently... it is not ready for production! Strophe 'http://code.stanziq.com/strophe/' is a robust and well written C library that allows the developer to implement XMPP clients. I wanted to be able to use the power of this library with the ruby syntax. I didn't use SWIG to generate the bindings for 2 reasons : 1. I wanted to learn how to write a C extension for ruby 2. I didn't like how SWIG generate gazilions of lines of code My other project, XMPPBot, is an implementation of Strophe Ruby that allows the ruby developer to write a XMPP bot in a few lines of code. License: GNU General Public License (GPL)"
|
26
|
+
email:
|
27
|
+
- flamontagne@gmail.com
|
28
|
+
executables: []
|
29
|
+
|
30
|
+
extensions:
|
31
|
+
- ext/strophe_ruby/extconf.rb
|
32
|
+
extra_rdoc_files:
|
33
|
+
- History.txt
|
34
|
+
- Manifest.txt
|
35
|
+
- PostInstall.txt
|
36
|
+
- README.rdoc
|
37
|
+
files:
|
38
|
+
- .autotest
|
39
|
+
- History.txt
|
40
|
+
- Manifest.txt
|
41
|
+
- PostInstall.txt
|
42
|
+
- README.rdoc
|
43
|
+
- Rakefile
|
44
|
+
- ext/strophe_ruby/extconf.rb
|
45
|
+
- ext/strophe_ruby/libexpat.a
|
46
|
+
- ext/strophe_ruby/libstrophe.a
|
47
|
+
- ext/strophe_ruby/strophe.h
|
48
|
+
- ext/strophe_ruby/strophe/common.h
|
49
|
+
- ext/strophe_ruby/strophe/hash.h
|
50
|
+
- ext/strophe_ruby/strophe/sock.h
|
51
|
+
- ext/strophe_ruby/strophe/tls.h
|
52
|
+
- ext/strophe_ruby/strophe_ruby.c
|
53
|
+
- lib/strophe_ruby.rb
|
54
|
+
- script/console
|
55
|
+
- script/destroy
|
56
|
+
- script/generate
|
57
|
+
- tasks/extconf.rake
|
58
|
+
- tasks/extconf/strophe_ruby.rake
|
59
|
+
- test/test_helper.rb
|
60
|
+
- test/test_strophe_ruby.rb
|
61
|
+
- test/test_strophe_ruby_extn.rb
|
62
|
+
has_rdoc: true
|
63
|
+
homepage: http://stropheruby.rubyforge.org
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options:
|
66
|
+
- --main
|
67
|
+
- README.rdoc
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
- ext/strophe_ruby
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
requirements: []
|
84
|
+
|
85
|
+
rubyforge_project: strophe_ruby
|
86
|
+
rubygems_version: 1.3.1
|
87
|
+
signing_key:
|
88
|
+
specification_version: 2
|
89
|
+
summary: Ruby bindings for Strophe 'http://code.stanziq.com/strophe/', a C library for writing XMPP clients
|
90
|
+
test_files:
|
91
|
+
- test/test_strophe_ruby_extn.rb
|
92
|
+
- test/test_helper.rb
|
93
|
+
- test/test_strophe_ruby.rb
|