ohm 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ohm.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require "base64"
4
+ require File.join(File.dirname(__FILE__), "ohm", "compat")
4
5
  require File.join(File.dirname(__FILE__), "ohm", "redis")
5
6
  require File.join(File.dirname(__FILE__), "ohm", "validations")
6
7
 
@@ -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
@@ -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 => "Ruby Tuesday")
78
- assert_equal "UTF-8", Meetup[event.id].name.encoding.to_s
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.23
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