obf 0.2.4 → 0.2.5

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/external.rb +6 -3
  3. data/lib/obf/pdf.rb +5 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dd93aa5841bcdf4538a71b0338ab2b13f3ea674
4
- data.tar.gz: c3b6ecf6cdeba8605bd34ac2a890b1e9f8345b4f
3
+ metadata.gz: 7e1b5472c682875d9a7105a13e5d8c082755b708
4
+ data.tar.gz: c2f86abbb91ed2b93a4a7ef249ecb20378c0a9a0
5
5
  SHA512:
6
- metadata.gz: ac95324522ab772b27ded6a24215d86128b809c0b3f71cc4b08c27b15e815f948de8cb0148e67c2ab06f198e6156930b607d6c7412b7232a7d3ceb1b948d2895
7
- data.tar.gz: 483a7f515b1fc3b96bb87cf335dc5d9efeb044da802d117e94450b61d49ba2addc9b91eda38b2cc7921eea8e08cdb1fb1903ba3c9965ceddaaf5d5a5fd8658c3
6
+ metadata.gz: dc5bb78ba9ac04762f648e13d88fe6c55ab13e7ab900f56fcea0b98b96e2fe8126e81535350e9b98fa2c2d47c09e3fbbc0516b356618e3aa6c104c1b920a7b0e
7
+ data.tar.gz: 09780a4f5476a8993fa9dbd76ce298e80f84da98aa08660246718417d889dffe0cbb5d5637b63c10f256c901e149ef4b47dacdad950c4da12c5974e5ddf4ddf9
@@ -2,15 +2,18 @@ module OBF::External
2
2
  def self.to_obf(hash, dest_path, path_hash=nil)
3
3
  res = OBF::Utils.obf_shell
4
4
  res['id'] = hash['id']
5
+ res['locale'] = hash['locale'] || 'en'
5
6
  res['name'] = hash['name']
6
7
  res['default_layout'] = hash['default_layout'] || 'landscape'
7
8
  res['url'] = hash['url']
8
9
  res['data_url'] = hash['data_url']
9
10
  res['description_html'] = hash['description_html']
10
11
  res['license'] = OBF::Utils.parse_license(hash['license'])
11
- res['settings'] = {
12
- 'private' => !!(hash['settings'] && hash['settings']['private'])
13
- }
12
+ hash.each do |key, val|
13
+ if key && key.match(/^ext_/)
14
+ res[key] = val
15
+ end
16
+ end
14
17
  grid = []
15
18
 
16
19
  images = []
@@ -65,6 +65,10 @@ module OBF::PDF
65
65
 
66
66
  # header
67
67
  pdf.bounding_box([0, doc_height], :width => doc_width, :height => 100) do
68
+ if options['pages']
69
+ page_num = options['pages'][obj['id']]
70
+ pdf.add_dest("page#{page_num}", pdf.dest_fit)
71
+ end
68
72
  pdf.line_width = 2
69
73
  pdf.font_size 16
70
74
 
@@ -136,7 +140,7 @@ module OBF::PDF
136
140
  pdf.stroke_color "eeeeee"
137
141
  pdf.fill_and_stroke_rounded_rectangle [button_width - 25, button_height - 5], 20, text_height, 5
138
142
  pdf.fill_color "000000"
139
- pdf.text_box page, :at => [button_width - 25, button_height - 5], :width => 20, :height => text_height, :align => :center, :valign => :center
143
+ pdf.formatted_text_box [{:text => page, :anchor => "page#{page}"}], :at => [button_width - 25, button_height - 5], :width => 20, :height => text_height, :align => :center, :valign => :center
140
144
  end
141
145
 
142
146
  pdf.fill_color "000000"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-03 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json