pdflib_wrapper 0.0.1 → 0.0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3a9c0f4277d392c7dd3b1b94d15dadcbf014e77
4
- data.tar.gz: f5d7599ddce561c8f1a72aceb37e978891538777
3
+ metadata.gz: a8f29701c2f544842334b4eca7ac7b6aa056a7bd
4
+ data.tar.gz: 2df135da682e6d725a46c8d3cdc8d1ef2299448c
5
5
  SHA512:
6
- metadata.gz: efa66b4dfa354ca340d0548b45db6953caa0e01d71fe3f0f171bb47664f917e996663e07ce8726d1f15aeadd41f1aeb6d60c18e143da392e293e52fcbd985bba
7
- data.tar.gz: 7bc89e70ad8405c43f2efea4e504b1dc28bf7ac78bb3a9812bfe6a325b7fcd7f9bd8c756293c2accafa11ff232d85224eb87d1a210b1e7ce99c6777845584494
6
+ metadata.gz: 3c9df8f7b7b1fd66278126097feedff40dd3592eed43a16218546cab145150d7e805edf2c45dffbeb7c07a12d6e235c03ed4520f809b1dc728089ec923a4cff3
7
+ data.tar.gz: 9cf74bc9d4635dd63a9c62a10e059e163947f6551d59997fe61a754317eb7a26f86dae55e8f98360723753e45175063465ec475b269e3594ad740376a79adeec
@@ -11,13 +11,13 @@ class OptionListMapper
11
11
  OptionListMapper.map_to_string(@modified_options, key, options[key])
12
12
  @modified_options << ' '
13
13
  end
14
- @modified_options << singles.map{|key| options[key]}.flatten.join(' ')
14
+ @modified_options << singles.map{|key| OptionListMapper.map_single(key, options[key])}.join(' ')
15
15
  end
16
16
 
17
17
  class << self
18
18
 
19
19
  def create_options(options_list="",kvs=[],singles=[],opts={})
20
- new(options_list,kvs,singles,opts).modified_options
20
+ new(options_list,kvs,singles,opts).modified_options.strip
21
21
  end
22
22
 
23
23
  def map_to_string(string, key, value, display_brackets=true, display_key=true)
@@ -45,6 +45,11 @@ class OptionListMapper
45
45
  string
46
46
  end
47
47
 
48
+ def map_single(key, value)
49
+ return '' if value.nil?
50
+ "#{key} #{value}"
51
+ end
52
+
48
53
  end
49
54
 
50
55
  end
@@ -1,3 +1,3 @@
1
1
  module PdflibWrapper
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.1.1'
3
3
  end
@@ -18,9 +18,11 @@ describe OptionListMapper do
18
18
  end
19
19
 
20
20
  it "maps singles and kvs correctly" do
21
- opts = {user_password: 'test', master_password: 'testing', permissions: ['nomodify', 'nocopy'], random: 'random', text: 'text'}
21
+ opts = {user_password: 'test', master_password: 'testing', permissions: ['nomodify', 'nocopy'], random: 'text'}
22
22
  kvs = [:user_password, :master_password, :permissions]
23
23
  singles = [:random, :text]
24
24
  OptionListMapper.create_options("", kvs,singles,opts).should eq("user_password=test master_password=testing permissions={nomodify nocopy} random text")
25
25
  end
26
+
27
+
26
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdflib_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Studener