asir 1.1.8 → 1.1.9

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.
@@ -2,12 +2,12 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 1.9.2
5
- - jruby-18mode
6
- - jruby-19mode
7
- - rbx-18mode
8
- - rbx-19mode
9
5
  - ruby-head
10
- - jruby-head
11
6
  - 1.8.7
12
7
  - ree
8
+ - rbx-18mode
9
+ - rbx-19mode
10
+ - jruby-head
11
+ - jruby-18mode
12
+ - jruby-19mode
13
13
 
data/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ 2012-12-28 Kurt A. Stephens <ks.github@kurtstephens.com>
2
+
3
+ * v1.1.9: New version.
4
+ * Rubinius: Rubinius -Xversion=18 and =19 support.
5
+
6
+ 2012-12-17 Kurt A. Stephens <ks.github@kurtstephens.com>
7
+
8
+ * Yaml: Fixed yaml_spec.rb on 1.9.2.
9
+ * Thread: Join spawned Thread in ex26.rb.
10
+
11
+ 2012-12-17 Kurt A. Stephens <ks.github@kurtstephens.com>
12
+
13
+ * v1.1.8: New version.
14
+ * Yaml: Psych::Visitors::YAMLTree#binary? is undefined in some environments
15
+
1
16
  2012-12-11 Kurt A. Stephens <ks.github@kurtstephens.com>
2
17
 
3
18
  * v1.1.7: New version.
@@ -50,5 +50,6 @@ h2. Platform support
50
50
  * CRuby 1.8.7
51
51
  * CRuby 1.9.3-head
52
52
  * CRuby 2.0-head
53
+ * Rubinius 1.8 and 1.9 modes.
53
54
  * JRuby 1.6.x (with JRUBY_OPTS=--1.9) IN-PROGRESS
54
55
 
@@ -33,11 +33,5 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'rake', '>= 0.9.0'
34
34
  s.add_development_dependency 'rspec', '~> 2.12.0'
35
35
  s.add_development_dependency 'simplecov', '>= 0.1'
36
- case RUBY_VERSION
37
- when /^1\.8/
38
- gem.add_development_dependency 'ruby-debug', '>= 0.1'
39
- else
40
- gem.add_development_dependency 'ruby-debug19', '>= 0.1'
41
- end
42
36
  end
43
37
 
@@ -7,7 +7,7 @@ begin
7
7
  Email.asir.transport = t =
8
8
  ASIR::Transport::File.new(:file => service_log)
9
9
  t.encoder =
10
- ASIR::Coder::Yaml.new
10
+ ASIR::Coder::Yaml.new(:yaml_options => { :ASCII_8BIT_ok => true })
11
11
  pr Email.asir.send_email(:pdf_invoice,
12
12
  :to => "user@email.com",
13
13
  :customer => @customer)
@@ -10,7 +10,7 @@ begin
10
10
  :encoder => ASIR::Coder::Marshal.new),
11
11
  ASIR::Transport::Broadcast.new(:transports => [
12
12
  file = ASIR::Transport::File.new(:file => service_log,
13
- :encoder => ASIR::Coder::Yaml.new),
13
+ :encoder => ASIR::Coder::Yaml.new(:yaml_options => { :ASCII_8BIT_ok => true })),
14
14
  ASIR::Transport::Subprocess.new,
15
15
  ]),
16
16
  ])
@@ -6,7 +6,7 @@ require 'asir/transport/retry'
6
6
  begin
7
7
  File.unlink(service_log = "#{__FILE__}.service.log") rescue nil
8
8
  file = ASIR::Transport::File.new(:file => service_log,
9
- :encoder => ASIR::Coder::Yaml.new)
9
+ :encoder => ASIR::Coder::Yaml.new(:yaml_options => { :ASCII_8BIT_ok => true }))
10
10
  tcp = ASIR::Transport::TcpSocket.new(:port => 31918,
11
11
  :encoder => ASIR::Coder::Marshal.new)
12
12
  start_server_proc = lambda do | transport, message |
@@ -6,14 +6,17 @@ require 'example_helper'
6
6
  begin
7
7
  Email.asir.transport = t =
8
8
  ASIR::Transport::Thread.new
9
-
9
+ spawned_thread = nil
10
10
  t.after_thread_new = lambda do | transport, message, thread |
11
+ spawned_thread = thread
11
12
  $stderr.puts "\n #{$$}: Spawned Thread #{thread.inspect}"
12
13
  end
13
14
 
14
15
  pr Email.asir.send_email(:pdf_invoice,
15
16
  :to => "user@email.com",
16
17
  :customer => @customer)
18
+
19
+ spawned_thread.join
17
20
  end
18
21
 
19
22
  # !SLIDE END
@@ -28,7 +28,8 @@ module ASIR
28
28
  def initialize exc
29
29
  @exception_class = exc.class.name
30
30
  @exception_message = exc.message
31
- @exception_backtrace = exc.backtrace
31
+ # Map backtrace Location objects to Strings to support RBX.
32
+ @exception_backtrace = exc.backtrace.map{|x| x.to_s}
32
33
  end
33
34
 
34
35
  def invoke!
@@ -7,6 +7,7 @@ module ASIR
7
7
  class ThreadPool
8
8
  include Initialization, AdditionalData
9
9
  attr_accessor :thread_class, :workers, :n_workers
10
+ attr_accessor :auto_start_workers
10
11
  attr_accessor :work_queue
11
12
  attr_accessor :verbose
12
13
  attr_accessor :run
@@ -133,7 +134,7 @@ module ASIR
133
134
  def join *args
134
135
  until @workers.empty?
135
136
  @workers.each do | worker |
136
- worker.join(*args)
137
+ worker && worker.join(*args)
137
138
  end
138
139
  end
139
140
  end
@@ -1,3 +1,3 @@
1
1
  module ASIR
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.9"
3
3
  end
@@ -4,17 +4,6 @@ when /java/
4
4
  gem 'json_pure'
5
5
  else
6
6
  gem 'json'
7
- case RUBY_VERSION
8
- when /^2\./
9
- gem 'simplecov'
10
- when /^1\.9/
11
- gem 'ruby-debug19'
12
- gem 'simplecov'
13
- # require 'ruby-debug' # BROKEN in 1.9.3-head
14
- when /^1\.8/
15
- gem 'ruby-debug'
16
- gem 'simplecov'
17
- require 'ruby-debug'
18
- end
7
+ gem 'simplecov'
19
8
  end
20
9
 
@@ -19,6 +19,9 @@ describe "ASIR::Coder::Yaml" do
19
19
  [ :Symbol, ':Symbol' ],
20
20
  ].each do | x |
21
21
  x, str = *x
22
+ if x == nil and RUBY_VERSION == '1.9.2'
23
+ str = '!!null '
24
+ end
22
25
  str ||= x.to_s
23
26
  str = "--- #{str}\n"
24
27
  str << "...\n" if RUBY_VERSION !~ /^1\.8/
@@ -37,12 +40,14 @@ describe "ASIR::Coder::Yaml" do
37
40
  case RUBY_VERSION
38
41
  when /^1\.8/
39
42
  out.should =~ /^ :binary: !binary /m
43
+ when '1.9.2'
44
+ out.should =~ /^ :binary: |-\n/m
40
45
  else
41
46
  out.should =~ /^ :binary: ! "\\x04/m
42
47
  end
43
48
  end
44
49
 
45
- it 'should handle :ascii_8bit_ok.' do
50
+ it 'should handle :ASCII_8BIT_ok.' do
46
51
  @enc.yaml_options = { :ASCII_8BIT_ok => true }
47
52
  out = do_message
48
53
  out.should =~ /^ :ascii_8bit: hostname/m
@@ -80,7 +85,12 @@ describe "ASIR::Coder::Yaml" do
80
85
  str.encoding.inspect.should == "#<Encoding:ASCII-8BIT>"
81
86
 
82
87
  yaml = ::YAML.dump(str)
83
- yaml.should == "--- !binary |-\n IzxFbmNvZGluZzpBU0NJSS04QklUPg==\n"
88
+ case RUBY_VERSION
89
+ when '1.9.2'
90
+ yaml.should == "--- ! '#<Encoding:ASCII-8BIT>'\n"
91
+ else
92
+ yaml.should == "--- !binary |-\n IzxFbmNvZGluZzpBU0NJSS04QklUPg==\n"
93
+ end
84
94
 
85
95
  yaml = ::YAML.dump(str, nil, :never_binary => true)
86
96
  yaml.should == "--- ! '#<Encoding:ASCII-8BIT>'\n"
@@ -91,7 +101,12 @@ describe "ASIR::Coder::Yaml" do
91
101
 
92
102
  @enc.yaml_options = @dec.yaml_options = nil
93
103
  out = @enc.prepare.encode(str)
94
- out.should == "--- !binary |-\n OGJpdGFzY2lp\n"
104
+ case RUBY_VERSION
105
+ when '1.9.2'
106
+ out.should == "--- 8bitascii\n...\n"
107
+ else
108
+ out.should == "--- !binary |-\n OGJpdGFzY2lp\n"
109
+ end
95
110
  @dec.prepare.decode(str).should == str
96
111
 
97
112
  @enc.yaml_options = { :never_binary => true }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asir
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-17 00:00:00.000000000 Z
12
+ date: 2012-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uuid
@@ -123,22 +123,6 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0.1'
126
- - !ruby/object:Gem::Dependency
127
- name: ruby-debug19
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '0.1'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0.1'
142
126
  description: Abstracting Services in Ruby
143
127
  email: ks.ruby@kurtstephens.com
144
128
  executables:
@@ -296,18 +280,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
280
  - - ! '>='
297
281
  - !ruby/object:Gem::Version
298
282
  version: '0'
299
- segments:
300
- - 0
301
- hash: -3079512589042146949
302
283
  required_rubygems_version: !ruby/object:Gem::Requirement
303
284
  none: false
304
285
  requirements:
305
286
  - - ! '>='
306
287
  - !ruby/object:Gem::Version
307
288
  version: '0'
308
- segments:
309
- - 0
310
- hash: -3079512589042146949
311
289
  requirements: []
312
290
  rubyforge_project:
313
291
  rubygems_version: 1.8.24