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 +4 -4
- data/lib/efo_nelfo/property.rb +2 -1
- data/lib/efo_nelfo/version.rb +1 -1
- data/spec/property_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06f9ae41470f7ec5868f8fd94fd888c0d4169b41
|
4
|
+
data.tar.gz: 14d7f5c2ea9b10a8125b3e89aad2b08d92794041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9aa39390094e1565b171f2fb8a42367fe7eec2233e390a75b3804f76e5d0949333e4e43a31ad70347ae19f3b581bbdf7797ea3c8174f7c835da9b41ff1921d
|
7
|
+
data.tar.gz: 083a82ef15c19943d31594efe997c6e68b07e48e066570d94ed136baefca287485eda6a91041eac4b6540c5936b24084af7058c01ddb15630416e86ffa6e675e
|
data/lib/efo_nelfo/property.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/efo_nelfo/version.rb
CHANGED
data/spec/property_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|