vuderacha-activekv 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/activekv/base.rb +3 -3
  2. data/spec/base.rb +4 -2
  3. metadata +2 -2
data/lib/activekv/base.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
- require 'json' rescue nil # This prevents the json gem loading afterwards and messing up the JSON serialisation
3
2
  require 'activesupport'
3
+ require 'json' rescue nil # This prevents the json gem loading afterwards and messing up the JSON serialisation
4
4
 
5
5
  module ActiveKV
6
6
  class Base
@@ -12,7 +12,7 @@ module ActiveKV
12
12
  end
13
13
 
14
14
  def to_json(options = {})
15
- ActiveSupport::JSON.encode(instance_values, options)
15
+ instance_values.to_json
16
16
  end
17
17
 
18
18
  # Configures the ActiveKV support with the given configuration file
@@ -123,7 +123,7 @@ module ActiveKV
123
123
  raise NilKeyError if send(self.class.key).nil?
124
124
 
125
125
  # Transform ourselves to json, and get our key
126
- new_val = ActiveSupport::JSON.encode(self)
126
+ new_val = self.to_json
127
127
  key_val = self.class.create_key send(self.class.key)
128
128
 
129
129
  # Retrieve the appropriate store, and save
data/spec/base.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  $:.push File.join(File.dirname(__FILE__), '..', 'lib')
2
+ # Fix for Textmate problem
3
+ $:.reject! { |e| e.include? 'TextMate' }
2
4
  require 'activekv'
3
5
 
4
6
  RACK_ENV = :test unless defined? RACK_ENV
@@ -108,8 +110,8 @@ describe "ActiveKV::Base when configured" do
108
110
  attr_accessor :another_prop
109
111
  end
110
112
 
111
- p = WithSomeParams.new :name => 'asr', :another_prop => 'world'
113
+ p = WithSomeParams.new :name => 'asr', :another_prop => ['world']
112
114
  p.name.should == 'asr'
113
- p.another_prop.should == 'world'
115
+ p.another_prop.should == ['world']
114
116
  end
115
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vuderacha-activekv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Jones
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-25 00:00:00 -07:00
12
+ date: 2009-03-28 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency