confluencer 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
data/confluencer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{confluencer}
8
- s.version = "0.2.6"
8
+ s.version = "0.2.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gabor Ratky"]
12
- s.date = %q{2010-05-06}
12
+ s.date = %q{2010-05-07}
13
13
  s.description = %q{ActiveRecord-like classes to access Confluence through XMLRPC.}
14
14
  s.email = %q{rgabo@rgabostyle.com}
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/confluence/blog_entry.rb",
30
30
  "lib/confluence/bookmark.rb",
31
31
  "lib/confluence/client.rb",
32
+ "lib/confluence/error.rb",
32
33
  "lib/confluence/page.rb",
33
34
  "lib/confluence/record.rb",
34
35
  "lib/confluence/session.rb",
@@ -61,7 +61,12 @@ module Confluence
61
61
  begin
62
62
  block.call(@confluence)
63
63
  rescue XMLRPC::FaultException => e
64
- raise e.faultString
64
+ case message = e.faultString.rpartition(':').last
65
+ when /Transaction rolled back/
66
+ raise Confluence::Error, "Could not save or update record."
67
+ else
68
+ raise Confluence::Error, message
69
+ end
65
70
  end
66
71
  end
67
72
  end
@@ -0,0 +1,4 @@
1
+ module Confluence
2
+ class Error < StandardError
3
+ end
4
+ end
@@ -42,14 +42,14 @@ module Confluence
42
42
  def self.find_by_id(page_id)
43
43
  begin
44
44
  self.new(client.getPage(page_id))
45
- rescue RuntimeError
45
+ rescue Confluence::Error
46
46
  end
47
47
  end
48
48
 
49
49
  def self.find_by_title(space, title)
50
50
  begin
51
51
  self.new(client.getPage(space, title))
52
- rescue RuntimeError
52
+ rescue Confluence::Error
53
53
  end
54
54
  end
55
55
  end
data/lib/confluencer.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # ensure that lib is in the load path
2
2
  $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
+ require 'confluence/error'
5
+
4
6
  require 'confluence/client'
5
7
  require 'confluence/session'
6
8
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 6
9
- version: 0.2.6
8
+ - 7
9
+ version: 0.2.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gabor Ratky
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-06 00:00:00 +02:00
17
+ date: 2010-05-07 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -53,6 +53,7 @@ files:
53
53
  - lib/confluence/blog_entry.rb
54
54
  - lib/confluence/bookmark.rb
55
55
  - lib/confluence/client.rb
56
+ - lib/confluence/error.rb
56
57
  - lib/confluence/page.rb
57
58
  - lib/confluence/record.rb
58
59
  - lib/confluence/session.rb