polyrex 0.8.14 → 0.8.15

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.
Files changed (2) hide show
  1. data/lib/polyrex.rb +5 -3
  2. metadata +2 -2
data/lib/polyrex.rb CHANGED
@@ -49,12 +49,14 @@ class Polyrex
49
49
  @doc.to_s(options)
50
50
  end
51
51
 
52
- def save(filepath=nil)
52
+ def save(filepath=nil, options={})
53
53
  refresh_summary
54
54
  filepath ||= @local_filepath
55
55
  @local_filepath = filepath
56
- File.open(filepath,'w'){|f| @doc.write f}
57
- end
56
+ xml = @doc.to_s(options)
57
+ buffer = block_given? ? yield(xml) : xml
58
+ File.open(filepath,'w'){|f| f.write buffer}
59
+ end
58
60
 
59
61
  # -- start of crud methods --
60
62
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.14
5
+ version: 0.8.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-03-15 00:00:00 +00:00
13
+ date: 2012-03-29 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency