asciidoctor-diagram 1.3.0.preview.2 → 1.3.0.preview.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.adoc CHANGED
@@ -11,6 +11,11 @@ Enhancements::
11
11
  * Updated PlantUML to revision 8004 (23/08/2014)
12
12
  * Remove dependency on RJB to simplify installation
13
13
 
14
+ Bug Fixes::
15
+
16
+ * Issue #49: Resolve issue that made Java 6 installation prompt appear on Mac OS X
17
+ * Issue #51: Resolved issue where PNG files generated by Graphviz were not processed correctly on Windows
18
+
14
19
  == 1.2.0
15
20
 
16
21
  Enhancements::
@@ -18,7 +18,9 @@ module Asciidoctor
18
18
  :body => code
19
19
  )
20
20
 
21
- raise "Ditaa image generation failed: #{response[:reason]}" unless response[:code] == 200
21
+ unless response[:code] == 200
22
+ raise "Ditaa image generation failed: #{response[:reason]} #{response[:body]}"
23
+ end
22
24
 
23
25
  response[:body]
24
26
  end
@@ -31,7 +31,9 @@ module Asciidoctor
31
31
  :headers => headers
32
32
  )
33
33
 
34
- raise "PlantUML image generation failed: #{response[:reason]}" unless response[:code] == 200
34
+ unless response[:code] == 200
35
+ raise "PlantUML image generation failed: #{response[:reason]} #{response[:body]}"
36
+ end
35
37
 
36
38
  response[:body]
37
39
  end
@@ -31,7 +31,7 @@ module Asciidoctor
31
31
 
32
32
  raise "#{tool} image generation failed" unless result_code == 0
33
33
 
34
- File.read(target_file.path)
34
+ File.read(target_file.path, :mode => 'rb')
35
35
  ensure
36
36
  target_file.unlink
37
37
  end
@@ -24,6 +24,11 @@ module Asciidoctor
24
24
  def io
25
25
  @client
26
26
  end
27
+
28
+ def shutdown
29
+ # KILL is a bit heavy handed, but TERM does not seem to shut down the JVM on Windows.
30
+ Process.kill('KILL', @server.pid)
31
+ end
27
32
  end
28
33
 
29
34
  def self.load
@@ -31,18 +36,27 @@ module Asciidoctor
31
36
  return
32
37
  end
33
38
 
34
- command_server
39
+ instance
35
40
  @loaded = true
36
41
  end
37
42
 
38
- def self.command_server
43
+ def self.instance
39
44
  @java_exe ||= find_java
40
45
  raise "Could not find Java executable" unless @java_exe
41
- @command_server ||= CommandServer.new(@java_exe, classpath)
46
+
47
+ unless @command_server
48
+ server = CommandServer.new(@java_exe, classpath)
49
+ @command_server = server
50
+ at_exit do
51
+ server.shutdown
52
+ end
53
+ end
54
+
55
+ @command_server
42
56
  end
43
57
 
44
58
  def self.send_request(req)
45
- svr = command_server
59
+ svr = instance
46
60
  headers = req[:headers] ||= {}
47
61
  headers['Host'] = "localhost:#{svr.port}"
48
62
  format_request(req, svr.io)
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Diagram
3
- VERSION = "1.3.0.preview.2"
3
+ VERSION = "1.3.0.preview.3"
4
4
  end
5
5
  end
data/spec/test_helper.rb CHANGED
@@ -30,7 +30,7 @@ module Asciidoctor
30
30
  end
31
31
 
32
32
  RSpec.configure do |c|
33
- TEST_DIR = 'testing'
33
+ TEST_DIR = File.expand_path('testing')
34
34
 
35
35
  c.before(:suite) do
36
36
  FileUtils.rm_r TEST_DIR if Dir.exists? TEST_DIR
@@ -45,12 +45,8 @@ RSpec.configure do |c|
45
45
  test_dir = File.expand_path(metadata[:description].gsub(/[^\w]+/, '_'), group_dir)
46
46
  Dir.mkdir(test_dir)
47
47
 
48
- old_wd = Dir.pwd
49
- Dir.chdir test_dir
50
- begin
48
+ Dir.chdir(test_dir) do
51
49
  example.run
52
- ensure
53
- Dir.chdir old_wd
54
50
  end
55
51
  end
56
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-diagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0.preview.2
4
+ version: 1.3.0.preview.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: