purple_ruby 0.6.2 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +7 -2
  2. data/README.txt +13 -29
  3. data/ext/purple_ruby.c +13 -5
  4. metadata +27 -9
data/History.txt CHANGED
@@ -1,2 +1,7 @@
1
- == 0.1.0
2
-
1
+ == 0.6.4
2
+
3
+ Add a noted problem on OSX.
4
+
5
+ == 0.6.3
6
+
7
+ Fix the segment fault on PurpleRuby.init: variable initialize parameters
data/README.txt CHANGED
@@ -4,50 +4,34 @@ purple_ruby is a ruby gem to write servers that send and recive IM messages. It
4
4
 
5
5
  For MSN, we recommend msn-pecan ( http://code.google.com/p/msn-pecan/ ), which is more more stable than official MSN plugin.
6
6
 
7
- Please check examples/purplegw_example.rb for details. Bascially you just tell it what to do when an IM was received, and there is an embedded tcp 'proxy' which allows you send IM messages.
7
+ Please check examples/purplegw_example.rb for details. Bascially you just tell it what to do when an event happens (e.g. IM was received), and there is an embedded tcp 'proxy' which allows you send IM messages.
8
8
 
9
9
  Why not "ruburple"? I have used ruburple ( http://rubyforge.org/projects/ruburple ), but found it blocks a lot. libpurple needs to run its own event loop which interferes with ruby's green thread model. Ruburple's author has done lots of hard work to workaround the problem ( http://rubyforge.org/pipermail/ruburple-development/2007-June/000005.html ), but it does not work well.
10
10
 
11
11
  == INSTALLATION
12
12
 
13
+ RubyGems v1.3.6 and up is required.
14
+
13
15
  Ubuntu:
14
16
  ---------------
15
17
  sudo apt-get install libpurple0 libpurple-dev
16
- gem sources -a http://gems.github.com (you only have to do this once)
17
- sudo gem install yong-purple_ruby
18
+ sudo gem install purple_ruby
18
19
 
19
20
  Redhat/Centos
20
21
  ---------------
21
- wget -O /etc/yum.repos.d/pidgin.repo http://rpm.pidgin.im/centos/pidgin.repo
22
- yum -y install glib2-devel libpurple-devel
23
- gem sources -a http://gems.github.com (you only have to do this once)
24
- sudo gem install yong-purple_ruby
22
+ sudo wget -O /etc/yum.repos.d/pidgin.repo http://rpm.pidgin.im/centos/pidgin.repo
23
+ sudo yum -y install glib2-devel libpurple-devel
24
+ sudo gem install purple_ruby
25
25
 
26
26
  OSX:
27
27
  ----
28
- sudo port -d selfupdate
29
- sudo port install gnutls
30
- (wait forever....)
31
- sudo port install nss
32
- (wait forever....)
33
- wget http://downloads.sourceforge.net/pidgin/pidgin-2.5.7.tar.bz2
34
- tar xvjf pidgin-2.5.7.tar.bz2
35
- cd pidgin-2.5.7
36
- ./configure --disable-gtkui --disable-screensaver --disable-consoleui --disable-sm --disable-perl --disable-tk --disable-tcl --disable-gstreamer --disable-schemas-install --disable-gestures --disable-cap --disable-gevolution --disable-gtkspell --disable-startup-notification --disable-avahi --disable-nm --disable-dbus --disable-meanwhile
37
- make
38
- (wait forever...)
39
- sudo make install
40
-
41
- edit your ~/.bash_profile and add this line
42
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
43
-
44
- gem sources -a http://gems.github.com (you only have to do this once)
45
- sudo gem install yong-purple_ruby
46
-
47
- == Copyright
48
-
49
- purple_ruby is Copyright (c) 2009 Xue Yong Zhi and Intridea, Inc. ( http://intridea.com ), released under the GPL License.
28
+ sudo port install pidgin
29
+ sudo gem install purple_ruby
50
30
 
31
+ == Notes
51
32
 
33
+ If you have problems login into gtalk with the error "NotImplementedError: method `respond_to?' called on terminated object (0x1018c9af0)", it's highly possible that the library is conflicted with libxml-ruby gem. Try to upgrade libxml2 to the latest version and recompile libxml-ruby will fix the problem
52
34
 
35
+ == Copyright
53
36
 
37
+ purple_ruby is Copyright (c) 2009-2010 Xue Yong Zhi and Intridea, Inc. ( http://intridea.com ), released under the GPL License.
data/ext/purple_ruby.c CHANGED
@@ -361,23 +361,31 @@ static void sighandler(int sig)
361
361
  {
362
362
  switch (sig) {
363
363
  case SIGINT:
364
+ case SIGQUIT:
365
+ case SIGTERM:
364
366
  g_main_loop_quit(main_loop);
365
367
  break;
366
368
  }
367
369
  }
368
370
 
369
- static VALUE init(VALUE self, VALUE debug, VALUE path)
371
+ static VALUE init(int argc, VALUE* argv, VALUE self)
370
372
  {
373
+ VALUE debug, path;
374
+ rb_scan_args(argc, argv, "02", &debug, &path);
375
+
371
376
  signal(SIGCHLD, SIG_IGN);
372
377
  signal(SIGPIPE, SIG_IGN);
373
378
  signal(SIGINT, sighandler);
374
-
379
+ signal(SIGQUIT, sighandler);
380
+ signal(SIGTERM, sighandler);
381
+
375
382
  data_hash_table = g_hash_table_new(NULL, NULL);
376
383
  fd_hash_table = g_hash_table_new(NULL, NULL);
377
384
 
378
- purple_debug_set_enabled((debug == Qnil || debug == Qfalse) ? FALSE : TRUE);
385
+ purple_debug_set_enabled((NIL_P(debug) || debug == Qfalse) ? FALSE : TRUE);
379
386
 
380
- if (path != Qnil) {
387
+ if (!NIL_P(path)) {
388
+ Check_Type(path, T_STRING);
381
389
  purple_util_set_user_dir(RSTRING(path)->ptr);
382
390
  }
383
391
 
@@ -767,7 +775,7 @@ void Init_purple_ruby()
767
775
  CALL = rb_intern("call");
768
776
 
769
777
  cPurpleRuby = rb_define_class("PurpleRuby", rb_cObject);
770
- rb_define_singleton_method(cPurpleRuby, "init", init, 1);
778
+ rb_define_singleton_method(cPurpleRuby, "init", init, -1);
771
779
  rb_define_singleton_method(cPurpleRuby, "list_protocols", list_protocols, 0);
772
780
  rb_define_singleton_method(cPurpleRuby, "watch_signed_on_event", watch_signed_on_event, 0);
773
781
  rb_define_singleton_method(cPurpleRuby, "watch_connection_error", watch_connection_error, 0);
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purple_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ hash: 15
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 4
10
+ version: 0.6.4
5
11
  platform: ruby
6
12
  authors:
7
13
  - yong
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-04-01 00:00:00 -04:00
18
+ date: 2009-04-01 00:00:00 +08:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: hoe
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 49
30
+ segments:
31
+ - 1
32
+ - 8
33
+ - 3
23
34
  version: 1.8.3
24
- version:
35
+ type: :development
36
+ version_requirements: *id001
25
37
  description: A ruby gem to write server that sends and recives IM messages
26
38
  email: yong@intridea.com
27
39
  executables: []
@@ -53,21 +65,27 @@ rdoc_options:
53
65
  require_paths:
54
66
  - ext
55
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
56
69
  requirements:
57
70
  - - ">="
58
71
  - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
59
75
  version: "0"
60
- version:
61
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
62
78
  requirements:
63
79
  - - ">="
64
80
  - !ruby/object:Gem::Version
81
+ hash: 3
82
+ segments:
83
+ - 0
65
84
  version: "0"
66
- version:
67
85
  requirements: []
68
86
 
69
87
  rubyforge_project: purplegw_ruby
70
- rubygems_version: 1.3.5
88
+ rubygems_version: 1.3.7
71
89
  signing_key:
72
90
  specification_version: 2
73
91
  summary: A ruby gem to write server that sends and recives IM messages