ohm 0.0.23 → 0.0.24
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.
- data/lib/ohm.rb +1 -0
- data/lib/ohm/compat.rb +12 -0
- data/test/model_test.rb +4 -2
- metadata +2 -1
data/lib/ohm.rb
CHANGED
data/lib/ohm/compat.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# This file provides Ruby 1.8 compatibility. The intended functionality
|
4
|
+
# is not present, because we cannot guess the original encoding, thus
|
5
|
+
# making Iconv unsuitable for a conversion.
|
6
|
+
if RUBY_VERSION < "1.9"
|
7
|
+
class String
|
8
|
+
def force_encoding(encoding)
|
9
|
+
self
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/test/model_test.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require File.join(File.dirname(__FILE__), "test_helper")
|
2
4
|
require "ostruct"
|
3
5
|
|
@@ -74,8 +76,8 @@ class TestRedis < Test::Unit::TestCase
|
|
74
76
|
end
|
75
77
|
|
76
78
|
should "save the attributes in UTF8" do
|
77
|
-
event = Meetup.create(:name => "
|
78
|
-
assert_equal "
|
79
|
+
event = Meetup.create(:name => "32° Kisei-sen")
|
80
|
+
assert_equal "32° Kisei-sen", Meetup[event.id].name
|
79
81
|
end
|
80
82
|
|
81
83
|
should "delete the attribute if set to nil" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Martens
|
@@ -25,6 +25,7 @@ extensions: []
|
|
25
25
|
extra_rdoc_files: []
|
26
26
|
|
27
27
|
files:
|
28
|
+
- lib/ohm/compat.rb
|
28
29
|
- lib/ohm/redis.rb
|
29
30
|
- lib/ohm/validations.rb
|
30
31
|
- lib/ohm.rb
|