efo_nelfo 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26b8e9f4719970e00eef63fac39f609584966b05
4
- data.tar.gz: daa8bd69f71f561c9afd61258a12a11c527cee57
3
+ metadata.gz: 06f9ae41470f7ec5868f8fd94fd888c0d4169b41
4
+ data.tar.gz: 14d7f5c2ea9b10a8125b3e89aad2b08d92794041
5
5
  SHA512:
6
- metadata.gz: 5aa301f7e5b3b633ac34ca8cdd9afb3753415bcc340606c7afb3929421ee28ed73a08a804baaa78e1d572b99fac28ae5231a0bfb147be5ad5f85e5bf5e3a57fc
7
- data.tar.gz: 3eb540f61970da6e5d28a5ba66eb7264dc21acdc46d49f77c8ba66aa421c0f01d7e3594ebcc3eaab44d972d734a545758e8b68e92cb81aae222591e4c8b20f48
6
+ metadata.gz: 2c9aa39390094e1565b171f2fb8a42367fe7eec2233e390a75b3804f76e5d0949333e4e43a31ad70347ae19f3b581bbdf7797ea3c8174f7c835da9b41ff1921d
7
+ data.tar.gz: 083a82ef15c19943d31594efe997c6e68b07e48e066570d94ed136baefca287485eda6a91041eac4b6540c5936b24084af7058c01ddb15630416e86ffa6e675e
@@ -106,7 +106,8 @@ module EfoNelfo
106
106
  # Creates an attribute setter for name
107
107
  def create_setter_for(name, options)
108
108
  define_method "#{name}=" do |value|
109
- attributes[name] = format_value(value, options[:type])
109
+ encoded_value = value.respond_to?(:encode) ? value.encode(Encoding::ISO_8859_1) : value
110
+ attributes[name] = format_value(encoded_value, options[:type])
110
111
  end
111
112
  end
112
113
 
@@ -1,3 +1,3 @@
1
1
  module EfoNelfo
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -30,6 +30,11 @@ describe EfoNelfo::Property do
30
30
  obj.foo.must_equal 'Test'
31
31
  end
32
32
 
33
+ it "converts encoding to ISO-8859-1" do
34
+ obj.foo = 'Sjøhest'
35
+ obj.foo.encoding.name.must_equal 'ISO-8859-1'
36
+ end
37
+
33
38
  it "adds an alias getter and setter for foo" do
34
39
  obj.foo = 'Test'
35
40
  obj.Føbar.must_equal 'Test'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: efo_nelfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudleik Rasch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-08 00:00:00.000000000 Z
11
+ date: 2013-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler