confluencer 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{confluencer}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
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"]
@@ -35,7 +35,9 @@ module Confluence
35
35
  @details = []
36
36
  end
37
37
 
38
- def details(label)
38
+ def details(label = :all)
39
+ return @details if label == :all
40
+
39
41
  unless result = @details.find {|d| d.label == label}
40
42
  @details << (result = Details.new(label))
41
43
  end
@@ -43,6 +45,10 @@ module Confluence
43
45
  result
44
46
  end
45
47
 
48
+ def details=(value)
49
+ @details = value
50
+ end
51
+
46
52
  def children(klass = self.class)
47
53
  children = client.getChildren(page_id)
48
54
  children.collect { |child| klass.find(:id => child["id"]) } if children
@@ -107,4 +107,14 @@ describe Confluence::Page do
107
107
 
108
108
  page.to_hash['content'].should include("{details:label=confluencer}\ncreator=rgabo\n{details}")
109
109
  end
110
+
111
+ it "should copy metadata from one page to another" do
112
+ page = create_test_page
113
+ page.details(:confluencer)[:creator] = 'rgabo'
114
+
115
+ new_page = create_test_page
116
+ new_page.details = page.details
117
+
118
+ new_page.details(:confluencer)[:creator].should == 'rgabo'
119
+ end
110
120
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gabor Ratky