ruby-dbus-openplacos 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS CHANGED
@@ -5,6 +5,22 @@ Note about bug numbers:
5
5
  Issue#1 - http://github.com/mvidner/ruby-dbus/issues#issue/1
6
6
  bnc#1 - https://bugzilla.novell.com/show_bug.cgi?id=1
7
7
 
8
+ == Ruby D-Bus 0.7.0 - 2011-07-26
9
+
10
+ Features:
11
+ * Added ASystemBus and ASessionBus, non-singletons useful in tests
12
+ and threads.
13
+
14
+ Bug fixes:
15
+ * Fixed handling of multibyte strings (Issue#8, by Takayuki YAMAGUCHI).
16
+ * Allow reopening of a dbus_interface declaration (Issue#9, by T. YAMAGUCHI).
17
+ * Fixed ruby-1.9.2 compatibility again (Issue#12).
18
+ * Fixed authentication on BSD (Issue#11, by Jonathan Walker)
19
+ * Fixed exiting a nested event loop for synchronous calls
20
+ (reported by Timo Warns).
21
+ * Fixed introspection calls leaking reply handlers.
22
+ * "rake test" now works, doing what was called "rake env:test"
23
+
8
24
  == Ruby D-Bus 0.6.0 - 2010-12-11
9
25
 
10
26
  Features:
data/Rakefile CHANGED
@@ -3,33 +3,32 @@ require 'rake'
3
3
  require 'rake/gempackagetask'
4
4
  require 'fileutils'
5
5
  include FileUtils
6
+ require 'tmpdir'
6
7
  require 'rake/rdoctask'
7
8
  require 'rake/testtask'
8
9
 
9
10
  desc 'Default: run tests in the proper environment'
10
- task :default => "env:test"
11
+ task :default => :test
11
12
 
12
13
  def common_test_task(t)
13
14
  t.libs << "lib"
14
15
  t.test_files = FileList['test/*_test.rb', 'test/t[0-9]*.rb']
15
16
  t.verbose = true
16
17
  end
17
- Rake::TestTask.new {|t| common_test_task t }
18
+ Rake::TestTask.new("bare:test") {|t| common_test_task t }
18
19
 
19
20
  begin
20
21
  require 'rcov/rcovtask'
21
- Rcov::RcovTask.new {|t| common_test_task t }
22
+ Rcov::RcovTask.new("bare:rcov") {|t| common_test_task t }
22
23
  rescue LoadError
23
24
  # no rcov, never mind
24
25
  end
25
26
 
26
27
  %w(test rcov).each do |tname|
27
- namespace :env do
28
- desc "Run #{tname} in the proper environment"
29
- task tname do |t|
30
- cd "test" do
31
- system "./test_env rake #{tname}"
32
- end
28
+ desc "Run bare:#{tname} in the proper environment"
29
+ task tname do |t|
30
+ cd "test" do
31
+ system "./test_env rake bare:#{tname}"
33
32
  end
34
33
  end
35
34
  end
@@ -40,6 +39,17 @@ Rake::GemPackageTask.new(GEMSPEC) do |pkg|
40
39
  # no other formats needed
41
40
  end
42
41
 
42
+ desc "Build a package from a clone of the local Git repo"
43
+ task :package_git do |t|
44
+ Dir.mktmpdir do |temp|
45
+ sh "git clone . #{temp}"
46
+ cd temp do
47
+ sh "rake package"
48
+ end
49
+ cp_r "#{temp}/pkg", "."
50
+ end
51
+ end
52
+
43
53
  Rake::RDocTask.new do |rd|
44
54
  rd.rdoc_dir = 'doc/rdoc'
45
55
  rd.rdoc_files.include("README", "lib/**/*.rb")
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.7.0
data/lib/dbus/auth.rb CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  $debug = $DEBUG #it's all over the state machine
10
10
 
11
+ require 'rbconfig'
12
+
11
13
  module DBus
12
14
  # Exception raised when authentication fails somehow.
13
15
  class AuthenticationFailed < Exception
@@ -118,7 +120,11 @@ module DBus
118
120
 
119
121
  # Start the authentication process.
120
122
  def authenticate
121
- @socket.write(0.chr)
123
+ if (RbConfig::CONFIG["target_os"] =~ /bsd/)
124
+ @socket.sendmsg(0.chr, 0, nil, [:SOCKET, :SCM_CREDS, ""])
125
+ else
126
+ @socket.write(0.chr)
127
+ end
122
128
  next_authenticator
123
129
  @state = :Starting
124
130
  while @state != :Authenticated
@@ -142,12 +148,12 @@ module DBus
142
148
  # Try authentication using the next authenticator.
143
149
  def next_authenticator
144
150
  begin
145
- raise AuthException if @auth_list.size == 0
151
+ raise AuthenticationFailed if @auth_list.size == 0
146
152
  @authenticator = @auth_list.shift.new
147
153
  auth_msg = ["AUTH", @authenticator.name, @authenticator.authenticate]
148
154
  puts "DEBUG: auth_msg: #{auth_msg.inspect}" if $debug
149
155
  send(auth_msg)
150
- rescue AuthException
156
+ rescue AuthenticationFailed
151
157
  @socket.close
152
158
  raise
153
159
  end
data/lib/dbus/bus.rb CHANGED
@@ -30,11 +30,20 @@ module DBus
30
30
  attr_reader :root
31
31
 
32
32
  # Create a new service with a given _name_ on a given _bus_.
33
- def initialize(name, bus)
33
+ def initialize(name, bus,threaded = false)
34
34
  @name, @bus = name, bus
35
+ @threaded = threaded
35
36
  @root = Node.new("/")
36
37
  end
37
-
38
+
39
+ def threaded?
40
+ return @threaded
41
+ end
42
+
43
+ def threaded=(threaded)
44
+ @threaded = threaded
45
+ end
46
+
38
47
  # Determine whether the service name already exists.
39
48
  def exists?
40
49
  bus.proxy.ListNames[0].member?(@name)
@@ -242,11 +251,7 @@ module DBus
242
251
  @queue_used_by_thread[thread_in_wait] << ret # puts the message in the queue
243
252
  end
244
253
  else
245
- if main_thread
246
- @main_message_queue << ret
247
- else
248
- process(ret) # there is no main.run thread, process the message
249
- end
254
+ @main_message_queue << ret
250
255
  end
251
256
  end
252
257
  }
@@ -630,9 +635,7 @@ module DBus
630
635
  if (@threaded)
631
636
  @queue_used_by_thread.delete(Thread.current)
632
637
  else
633
- until [DBus::Message::ERROR,
634
- DBus::Message::METHOD_RETURN].include?(retm.message_type) and
635
- retm.reply_serial == m.serial
638
+ while @method_call_replies.has_key? m.serial
636
639
  retm = wait_for_message
637
640
  process(retm)
638
641
  end
data/lib/dbus/export.rb CHANGED
@@ -42,6 +42,14 @@ module DBus
42
42
 
43
43
  # Dispatch a message _msg_ to call exported methods
44
44
  def dispatch(msg)
45
+ if @service.threaded?
46
+ Thread.new { process_dispatch(msg)}
47
+ else
48
+ process_dispatch(msg)
49
+ end
50
+ end
51
+
52
+ def process_dispatch(msg)
45
53
  case msg.message_type
46
54
  when Message::METHOD_CALL
47
55
  reply = nil
@@ -70,6 +78,7 @@ module DBus
70
78
  end
71
79
  end
72
80
 
81
+
73
82
  # Select (and create) the interface that the following defined methods
74
83
  # belong to.
75
84
  def self.dbus_interface(s)
@@ -8,6 +8,7 @@ GEMSPEC = Gem::Specification.new do |s|
8
8
  s.summary = "Fork from ruby-dbus"
9
9
  # s.description = FIXME
10
10
  s.version = File.read("VERSION").strip
11
+ s.license = "LGPL v2.1"
11
12
  s.author = "Openplacos Team"
12
13
  s.homepage = "https://github.com/flagos/ruby-dbus"
13
14
  s.files = FileList["{doc/tutorial,examples,lib,test}/**/*", "Rakefile", "ruby-dbus-openplacos.gemspec", "VERSION"].to_a.sort
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dbus-openplacos
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
- - 6
9
- - 2
10
- version: 0.6.2
7
+ - 7
8
+ - 0
9
+ version: 0.7.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Openplacos Team
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-05-07 00:00:00 +02:00
17
+ date: 2012-03-10 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -84,8 +83,8 @@ files:
84
83
  - NEWS
85
84
  has_rdoc: true
86
85
  homepage: https://github.com/flagos/ruby-dbus
87
- licenses: []
88
-
86
+ licenses:
87
+ - LGPL v2.1
89
88
  post_install_message:
90
89
  rdoc_options: []
91
90
 
@@ -96,7 +95,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
95
  requirements:
97
96
  - - ">="
98
97
  - !ruby/object:Gem::Version
99
- hash: 57
100
98
  segments:
101
99
  - 1
102
100
  - 8
@@ -107,14 +105,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
105
  requirements:
108
106
  - - ">="
109
107
  - !ruby/object:Gem::Version
110
- hash: 3
111
108
  segments:
112
109
  - 0
113
110
  version: "0"
114
111
  requirements: []
115
112
 
116
113
  rubyforge_project:
117
- rubygems_version: 1.5.3
114
+ rubygems_version: 1.3.7
118
115
  signing_key:
119
116
  specification_version: 3
120
117
  summary: Fork from ruby-dbus