kue 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ test_app/*
7
7
  *.swo
8
8
  *.log
9
9
  .idea
10
+ .ruby-version
@@ -1,7 +1,2 @@
1
1
  rvm:
2
- - 1.8.7
3
- - 1.9.2
4
2
  - 1.9.3
5
- - jruby
6
- - ruby-head
7
- - ree
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright 2011 Daniel Watson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -4,7 +4,7 @@ Kue is a Rails ready key value store that uses active-record under the hood.
4
4
 
5
5
  ###Build Status
6
6
 
7
- [![Build Status](https://secure.travis-ci.org/dotnetguyuk/kue.png)](https://secure.travis-ci.org/dotnetguyuk/kue)
7
+ [![Build Status](https://travis-ci.org/dan-watson/kue.svg)](https://travis-ci.org/dan-watson/kue)
8
8
 
9
9
  ###What does Kue mean?
10
10
  K(eyVal)ue
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_path = 'lib'
20
20
 
21
- s.add_dependency 'activerecord', '~> 3.2.3'
21
+ s.add_dependency 'activerecord', '>= 4.0.0'
22
22
  s.add_development_dependency 'rspec'
23
23
  s.add_development_dependency 'sqlite3'
24
24
  s.add_development_dependency 'pry'
@@ -4,7 +4,7 @@ class KueSettingsTableCreateMigration < ActiveRecord::Migration
4
4
  t.string :key
5
5
  t.text :value
6
6
 
7
- t.timestamps
7
+ t.timestamps null: false
8
8
  end
9
9
  add_index :kue_settings, :key, :unique => true
10
10
  end
data/lib/kue.rb CHANGED
@@ -21,7 +21,7 @@ module Kue
21
21
 
22
22
  def []=(key, value)
23
23
  raise KueNilKeyError if key.nil?
24
- setting = KueStore.find_or_create_by_key(key)
24
+ setting = KueStore.find_or_create_by(key: key)
25
25
  setting.value = value.to_yaml
26
26
  setting.save!
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Kue
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,2 +1,3 @@
1
- adapter: sqlite3
2
- database: ":memory:"
1
+ sqlite3:
2
+ adapter: sqlite3
3
+ database: ":memory:"
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe KueStore do
4
4
  it 'should have the kue_settings table correctly setup' do
5
- ActiveRecord::Base.connection.table_exists?(:kue_settings).should be_true
5
+ ActiveRecord::Base.connection.table_exists?(:kue_settings).should be_truthy
6
6
  end
7
7
 
8
8
  it 'should save a new key and value' do
@@ -27,17 +27,17 @@ describe KueStore do
27
27
  end
28
28
 
29
29
  it 'should check for existance' do
30
- KueStore.exists?(:non_existant).should be_false
30
+ KueStore.exists?(:non_existant).should be_falsey
31
31
 
32
32
  KueStore[:existant] = 109
33
- KueStore.exists?(:existant).should be_true
33
+ KueStore.exists?(:existant).should be_truthy
34
34
  end
35
35
 
36
36
  it 'should delete a key and value' do
37
37
  KueStore[:delete_me] = 1098
38
- KueStore.exists?(:delete_me).should be_true
39
- KueStore.delete!(:delete_me).should be_true
40
- KueStore.exists?(:delete_me).should be_false
38
+ KueStore.exists?(:delete_me).should be_truthy
39
+ KueStore.delete!(:delete_me).should be_truthy
40
+ KueStore.exists?(:delete_me).should be_falsey
41
41
  end
42
42
 
43
43
  it 'should not throw an error when deleting a key that does not exist' do
@@ -84,4 +84,4 @@ describe 'Using Kue::Store outside of the KueStore class - introducing BlueStore
84
84
  BlueStore[:ok] = "One"
85
85
  BlueStore[:ok].should == "One"
86
86
  end
87
- end
87
+ end
@@ -19,20 +19,20 @@ require File.expand_path('../../lib/kue', __FILE__)
19
19
  active_record_configuration = YAML.load_file(File.expand_path('../config/database.yml', __FILE__))
20
20
 
21
21
  ActiveRecord::Base.configurations = active_record_configuration
22
- ActiveRecord::Base.establish_connection(active_record_configuration)
22
+ ActiveRecord::Base.establish_connection(:sqlite3)
23
23
 
24
24
  ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
25
25
  ActiveRecord::Base.default_timezone = :utc
26
26
 
27
- ActiveRecord::Base.silence do
28
- ActiveRecord::Migration.verbose = false
29
- load(File.expand_path('../../lib/generators/kue/install/templates/migration.rb', __FILE__))
30
- end
27
+ ActiveRecord::Migration.verbose = false
28
+ load(File.expand_path('../../lib/generators/kue/install/templates/migration.rb', __FILE__))
31
29
 
32
30
  #Run the migration
33
31
  KueSettingsTableCreateMigration.new.up
34
32
 
35
33
  RSpec.configure do |configuration|
34
+ configuration.expect_with(:rspec) { |c| c.syntax = :should }
35
+
36
36
  configuration.after(:each) do
37
37
  KueStore.destroy_all
38
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000 Z
12
+ date: 2015-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.2.3
21
+ version: 4.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.3
29
+ version: 4.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +88,7 @@ files:
88
88
  - .rvmrc
89
89
  - .travis.yml
90
90
  - Gemfile
91
+ - LICENSE
91
92
  - README.md
92
93
  - Rakefile
93
94
  - kue.gemspec
@@ -110,16 +111,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
111
  - - ! '>='
111
112
  - !ruby/object:Gem::Version
112
113
  version: '0'
114
+ segments:
115
+ - 0
116
+ hash: 3110198137919352643
113
117
  required_rubygems_version: !ruby/object:Gem::Requirement
114
118
  none: false
115
119
  requirements:
116
120
  - - ! '>='
117
121
  - !ruby/object:Gem::Version
118
122
  version: '0'
123
+ segments:
124
+ - 0
125
+ hash: 3110198137919352643
119
126
  requirements: []
120
127
  rubyforge_project: kue
121
- rubygems_version: 1.8.21
128
+ rubygems_version: 1.8.23
122
129
  signing_key:
123
130
  specification_version: 3
124
131
  summary: Kue is a simple key value store that uses ActiveRecord.
125
- test_files: []
132
+ test_files:
133
+ - spec/config/database.yml
134
+ - spec/kue_spec.rb
135
+ - spec/spec_helper.rb