porpoise 0.9.1 → 0.9.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0fd952488122e505e9d17f771a9e805a0e7d157
4
- data.tar.gz: 5144a78e32de577c50ebbb1fe41c1243df629f4f
3
+ metadata.gz: 70da1e3de3220160b8c00fd70a9d50337540f85f
4
+ data.tar.gz: 740fa453878aad9df5a2d2d8ae0c4c2404be01d7
5
5
  SHA512:
6
- metadata.gz: aa20af5753a6d928cb670497d059eda9df86b1ed7a9e5dd52949dbe9c475ea39697bbb187e2a527cb3d0b8ca789cc7ea9d351ed17a88082559f157293576113b
7
- data.tar.gz: 1277291bab102cfada2a440557e3464456b26e16eac7354fbc81e7a8f2f304f9dcf1f4ec4694196c72654b275ba2db90a2eb10812e02f7a13f1a0e7af36cd1c3
6
+ metadata.gz: b4f729b64723691c68b499916fc8a42497d7bdc29b7ae7854a1636067400db9af6343cdd58efba06562a2d0aeaa94558931772a6d68a79c5dc6eb3515a8d5fdc
7
+ data.tar.gz: 1664af19bba339e78dd17fd58954661f266cc302407076c55a06eac238a2568540adbbe7b991ddcdd9f8d860bc5ccdc767e7b89c1b3947cee08c10d6a02c75ce
data/Appraisals ADDED
@@ -0,0 +1,17 @@
1
+ appraise "rails-3" do
2
+ gem 'activerecord', "~> 3.2"
3
+ gem 'activesupport', "~> 3.2"
4
+ gem "rails", "~> 3.2"
5
+ end
6
+
7
+ appraise "rails-4" do
8
+ gem 'activerecord', "~> 4.2"
9
+ gem 'activesupport', "~> 4.2"
10
+ gem "rails", "~> 4.2"
11
+ end
12
+
13
+ appraise "rails-5" do
14
+ gem 'activerecord', "~> 5.1"
15
+ gem 'activesupport', "~> 5.1"
16
+ gem "rails", "~> 5.1"
17
+ end
data/README.md CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  ## Welcome
4
4
 
5
- Porpoise implements a Redis like interface using MySQL as its storage engine. This provides an easy replacement for Rails applications that currently use Redis to store key/value data and would like to switch to MySQL for whatever reason.
5
+ Porpoise implements an additional cache backend for Ruby on Rails applications. It's compatible with Rails' ActiveSupport::Cache interface and is easily configured. It also provides a Redis like interface using your chosen RDBMS as its storage engine. This provides an easy replacement for Rails applications that currently use Redis to store key/value data and would like to switch an RDBMS for whatever reason.
6
6
 
7
7
  ### Performance
8
8
 
9
- Redis outperforms this implementation by a long shot and I don't think I have to tell why. For an SQL based solution it still performs alright though. Besides, this thing integrates with Rails, uses ActiveRecord and all the bloat that comes with it. And altough a cache should help performance, cache read/write speed sometimes are not the bottleneck.
9
+ Redis outperforms this implementation by a long shot and I don't think I have to tell why. For an SQL based solution it still performs alright though. Besides, this thing integrates with Rails, uses ActiveRecord and all the bloat that comes with it. And altough a cache should help performance, cache read/write speed sometimes are not the problem. To prevent firing the same query when reading the same cache fragment over and over again, this thing comes with a short life in-memory cache to quickly return those items. In our situation, reading data was even faster than the Redis based solution.
10
10
 
11
11
  ### Then why?
12
12
 
13
- To simplify your stack? To get a real multi-master setup using MySQL/Galera? To get rid of an unstable situation?
13
+ To simplify your stack? To get a real multi-master setup using MySQL/Galera? To get rid of an unstable situation? To have a centralized cache when you have no Memcache or Redis at your disposal?
14
14
 
15
- This gem was written out of the need to get rid of our shaky Redis Dynomite cluster which we implemented due to the requirement of having real multi-master clusters. Master-slave- and failover setups tend to break over time, so multi-master is the only acceptable way to go.
15
+ This gem was written out of the need to get rid of a shaky Redis Dynomite cluster which we implemented due to the requirement of having real multi-master clusters. Master-slave- and failover setups tend to break over time, so multi-master is the only acceptable way to go.
16
16
 
17
- So Redis /w Dynomite kept exploding at every little burp so we needed a solution. MySQL / Galera was already there as our primary datastore so the alternative was easily chosen. Reasons: proven multi-master setup and a more easy stack. With our userbase and use of Redis, performance was of minor importance.
17
+ So Redis /w Dynomite kept exploding at every little burp so we needed a solution. MySQL / Galera was already there as our primary datastore so the alternative was easily chosen. Reasons: proven multi-master setup and a less complex stack. This was a win/win solution. With our userbase and use of Redis, performance was of minor importance.
18
18
 
19
19
  ## Compatibility
20
20
 
21
- This gem has been tested with Rails 3, but probably also works with newer versions of Rails.
21
+ This gem has been tested with Rails 3, and includes tests for Rails 4 and Rails 5.
22
22
 
23
23
  ## Installation
24
24
 
@@ -43,7 +43,7 @@ After installation of the gem, install the required migration:
43
43
  Porpoise runs in a different database for easy optimization and decoupling. Add an entry in your config/database.yml for porpoise.
44
44
 
45
45
  porpoise_development:
46
- adapter: mysql2
46
+ adapter: <adapter of choice>
47
47
  username: <porpoise_db_user>
48
48
  ...
49
49
 
@@ -89,19 +89,18 @@ Fork this repo. Development is done from within a Docker container for which the
89
89
 
90
90
  Run all other actions from within the container. Tests:
91
91
 
92
- bundle exec rspec spec
93
-
94
- Tests take some time as there's some performance tests included.
92
+ appraisal install
93
+ appraisal rails-3 rspec spec
94
+ appraisal rails-4 rspec spec
95
+ appraisal rails-5 rspec spec
95
96
 
96
97
  Console:
97
98
 
98
- ./bin/console
99
-
100
- PR's are welcome :)
101
-
102
- ## Todo
99
+ appraisal rails-3 ./bin/console
100
+ appraisal rails-4 ./bin/console
101
+ appraisal rails-5 ./bin/console
103
102
 
104
- Of course there's still some work to do. Performance tests do not represent actual performance, as they currently use a memory store which should be file based to include disk I/O in the tests.
103
+ PR's are welcome :) This is my first gem thingie ever, so help me out.
105
104
 
106
105
  ## Contributing
107
106
 
data/Rakefile CHANGED
@@ -1,2 +1,4 @@
1
+ require "rubygems"
1
2
  require "bundler/gem_tasks"
3
+ require "bundler/setup"
2
4
  task :default => :spec
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 3.2"
6
+ gem "activesupport", "~> 3.2"
7
+ gem "rails", "~> 3.2"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,130 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ porpoise (0.9.1)
5
+ activerecord (>= 3.2)
6
+ activesupport (>= 3.2)
7
+ rails (>= 3.2)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (3.2.22.5)
13
+ actionpack (= 3.2.22.5)
14
+ mail (~> 2.5.4)
15
+ actionpack (3.2.22.5)
16
+ activemodel (= 3.2.22.5)
17
+ activesupport (= 3.2.22.5)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ journey (~> 1.0.4)
21
+ rack (~> 1.4.5)
22
+ rack-cache (~> 1.2)
23
+ rack-test (~> 0.6.1)
24
+ sprockets (~> 2.2.1)
25
+ activemodel (3.2.22.5)
26
+ activesupport (= 3.2.22.5)
27
+ builder (~> 3.0.0)
28
+ activerecord (3.2.22.5)
29
+ activemodel (= 3.2.22.5)
30
+ activesupport (= 3.2.22.5)
31
+ arel (~> 3.0.2)
32
+ tzinfo (~> 0.3.29)
33
+ activeresource (3.2.22.5)
34
+ activemodel (= 3.2.22.5)
35
+ activesupport (= 3.2.22.5)
36
+ activesupport (3.2.22.5)
37
+ i18n (~> 0.6, >= 0.6.4)
38
+ multi_json (~> 1.0)
39
+ appraisal (2.2.0)
40
+ bundler
41
+ rake
42
+ thor (>= 0.14.0)
43
+ arel (3.0.3)
44
+ builder (3.0.4)
45
+ diff-lcs (1.3)
46
+ docile (1.1.5)
47
+ erubis (2.7.0)
48
+ hike (1.2.3)
49
+ i18n (0.8.6)
50
+ journey (1.0.4)
51
+ json (1.8.6)
52
+ mail (2.5.5)
53
+ mime-types (~> 1.16)
54
+ treetop (~> 1.4.8)
55
+ mime-types (1.25.1)
56
+ multi_json (1.12.2)
57
+ polyglot (0.3.5)
58
+ rack (1.4.7)
59
+ rack-cache (1.7.1)
60
+ rack (>= 0.4)
61
+ rack-ssl (1.3.4)
62
+ rack
63
+ rack-test (0.6.3)
64
+ rack (>= 1.0)
65
+ rails (3.2.22.5)
66
+ actionmailer (= 3.2.22.5)
67
+ actionpack (= 3.2.22.5)
68
+ activerecord (= 3.2.22.5)
69
+ activeresource (= 3.2.22.5)
70
+ activesupport (= 3.2.22.5)
71
+ bundler (~> 1.0)
72
+ railties (= 3.2.22.5)
73
+ railties (3.2.22.5)
74
+ actionpack (= 3.2.22.5)
75
+ activesupport (= 3.2.22.5)
76
+ rack-ssl (~> 1.3.2)
77
+ rake (>= 0.8.7)
78
+ rdoc (~> 3.4)
79
+ thor (>= 0.14.6, < 2.0)
80
+ rake (10.5.0)
81
+ rdoc (3.12.2)
82
+ json (~> 1.4)
83
+ rspec (3.6.0)
84
+ rspec-core (~> 3.6.0)
85
+ rspec-expectations (~> 3.6.0)
86
+ rspec-mocks (~> 3.6.0)
87
+ rspec-core (3.6.0)
88
+ rspec-support (~> 3.6.0)
89
+ rspec-expectations (3.6.0)
90
+ diff-lcs (>= 1.2.0, < 2.0)
91
+ rspec-support (~> 3.6.0)
92
+ rspec-mocks (3.6.0)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.6.0)
95
+ rspec-support (3.6.0)
96
+ simplecov (0.15.1)
97
+ docile (~> 1.1.0)
98
+ json (>= 1.8, < 3)
99
+ simplecov-html (~> 0.10.0)
100
+ simplecov-html (0.10.2)
101
+ sprockets (2.2.3)
102
+ hike (~> 1.2)
103
+ multi_json (~> 1.0)
104
+ rack (~> 1.0)
105
+ tilt (~> 1.1, != 1.3.0)
106
+ sqlite3 (1.3.13)
107
+ thor (0.20.0)
108
+ tilt (1.4.1)
109
+ treetop (1.4.15)
110
+ polyglot
111
+ polyglot (>= 0.3.1)
112
+ tzinfo (0.3.53)
113
+
114
+ PLATFORMS
115
+ ruby
116
+
117
+ DEPENDENCIES
118
+ activerecord (~> 3.2)
119
+ activesupport (~> 3.2)
120
+ appraisal
121
+ bundler (~> 1.13)
122
+ porpoise!
123
+ rails (~> 3.2)
124
+ rake (~> 10.0)
125
+ rspec (~> 3.2)
126
+ simplecov (~> 0)
127
+ sqlite3 (~> 1.3)
128
+
129
+ BUNDLED WITH
130
+ 1.14.6
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.2"
6
+ gem "activesupport", "~> 4.2"
7
+ gem "rails", "~> 4.2"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,148 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ porpoise (0.9.1)
5
+ activerecord (>= 3.2)
6
+ activesupport (>= 3.2)
7
+ rails (>= 3.2)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (4.2.10)
13
+ actionpack (= 4.2.10)
14
+ actionview (= 4.2.10)
15
+ activejob (= 4.2.10)
16
+ mail (~> 2.5, >= 2.5.4)
17
+ rails-dom-testing (~> 1.0, >= 1.0.5)
18
+ actionpack (4.2.10)
19
+ actionview (= 4.2.10)
20
+ activesupport (= 4.2.10)
21
+ rack (~> 1.6)
22
+ rack-test (~> 0.6.2)
23
+ rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
+ actionview (4.2.10)
26
+ activesupport (= 4.2.10)
27
+ builder (~> 3.1)
28
+ erubis (~> 2.7.0)
29
+ rails-dom-testing (~> 1.0, >= 1.0.5)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
31
+ activejob (4.2.10)
32
+ activesupport (= 4.2.10)
33
+ globalid (>= 0.3.0)
34
+ activemodel (4.2.10)
35
+ activesupport (= 4.2.10)
36
+ builder (~> 3.1)
37
+ activerecord (4.2.10)
38
+ activemodel (= 4.2.10)
39
+ activesupport (= 4.2.10)
40
+ arel (~> 6.0)
41
+ activesupport (4.2.10)
42
+ i18n (~> 0.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
45
+ tzinfo (~> 1.1)
46
+ appraisal (2.2.0)
47
+ bundler
48
+ rake
49
+ thor (>= 0.14.0)
50
+ arel (6.0.4)
51
+ builder (3.2.3)
52
+ concurrent-ruby (1.0.5)
53
+ crass (1.0.2)
54
+ diff-lcs (1.3)
55
+ docile (1.1.5)
56
+ erubis (2.7.0)
57
+ globalid (0.4.0)
58
+ activesupport (>= 4.2.0)
59
+ i18n (0.8.6)
60
+ json (2.1.0)
61
+ loofah (2.1.1)
62
+ crass (~> 1.0.2)
63
+ nokogiri (>= 1.5.9)
64
+ mail (2.6.6)
65
+ mime-types (>= 1.16, < 4)
66
+ mime-types (3.1)
67
+ mime-types-data (~> 3.2015)
68
+ mime-types-data (3.2016.0521)
69
+ mini_portile2 (2.3.0)
70
+ minitest (5.10.3)
71
+ nokogiri (1.8.1)
72
+ mini_portile2 (~> 2.3.0)
73
+ rack (1.6.8)
74
+ rack-test (0.6.3)
75
+ rack (>= 1.0)
76
+ rails (4.2.10)
77
+ actionmailer (= 4.2.10)
78
+ actionpack (= 4.2.10)
79
+ actionview (= 4.2.10)
80
+ activejob (= 4.2.10)
81
+ activemodel (= 4.2.10)
82
+ activerecord (= 4.2.10)
83
+ activesupport (= 4.2.10)
84
+ bundler (>= 1.3.0, < 2.0)
85
+ railties (= 4.2.10)
86
+ sprockets-rails
87
+ rails-deprecated_sanitizer (1.0.3)
88
+ activesupport (>= 4.2.0.alpha)
89
+ rails-dom-testing (1.0.8)
90
+ activesupport (>= 4.2.0.beta, < 5.0)
91
+ nokogiri (~> 1.6)
92
+ rails-deprecated_sanitizer (>= 1.0.1)
93
+ rails-html-sanitizer (1.0.3)
94
+ loofah (~> 2.0)
95
+ railties (4.2.10)
96
+ actionpack (= 4.2.10)
97
+ activesupport (= 4.2.10)
98
+ rake (>= 0.8.7)
99
+ thor (>= 0.18.1, < 2.0)
100
+ rake (10.5.0)
101
+ rspec (3.6.0)
102
+ rspec-core (~> 3.6.0)
103
+ rspec-expectations (~> 3.6.0)
104
+ rspec-mocks (~> 3.6.0)
105
+ rspec-core (3.6.0)
106
+ rspec-support (~> 3.6.0)
107
+ rspec-expectations (3.6.0)
108
+ diff-lcs (>= 1.2.0, < 2.0)
109
+ rspec-support (~> 3.6.0)
110
+ rspec-mocks (3.6.0)
111
+ diff-lcs (>= 1.2.0, < 2.0)
112
+ rspec-support (~> 3.6.0)
113
+ rspec-support (3.6.0)
114
+ simplecov (0.15.1)
115
+ docile (~> 1.1.0)
116
+ json (>= 1.8, < 3)
117
+ simplecov-html (~> 0.10.0)
118
+ simplecov-html (0.10.2)
119
+ sprockets (3.7.1)
120
+ concurrent-ruby (~> 1.0)
121
+ rack (> 1, < 3)
122
+ sprockets-rails (3.2.1)
123
+ actionpack (>= 4.0)
124
+ activesupport (>= 4.0)
125
+ sprockets (>= 3.0.0)
126
+ sqlite3 (1.3.13)
127
+ thor (0.20.0)
128
+ thread_safe (0.3.6)
129
+ tzinfo (1.2.3)
130
+ thread_safe (~> 0.1)
131
+
132
+ PLATFORMS
133
+ ruby
134
+
135
+ DEPENDENCIES
136
+ activerecord (~> 4.2)
137
+ activesupport (~> 4.2)
138
+ appraisal
139
+ bundler (~> 1.13)
140
+ porpoise!
141
+ rails (~> 4.2)
142
+ rake (~> 10.0)
143
+ rspec (~> 3.2)
144
+ simplecov (~> 0)
145
+ sqlite3 (~> 1.3)
146
+
147
+ BUNDLED WITH
148
+ 1.14.6
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.1"
6
+ gem "activesupport", "~> 5.1"
7
+ gem "rails", "~> 5.1"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,155 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ porpoise (0.9.1)
5
+ activerecord (>= 3.2)
6
+ activesupport (>= 3.2)
7
+ rails (>= 3.2)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.1.4)
13
+ actionpack (= 5.1.4)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (~> 0.6.1)
16
+ actionmailer (5.1.4)
17
+ actionpack (= 5.1.4)
18
+ actionview (= 5.1.4)
19
+ activejob (= 5.1.4)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.1.4)
23
+ actionview (= 5.1.4)
24
+ activesupport (= 5.1.4)
25
+ rack (~> 2.0)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.1.4)
30
+ activesupport (= 5.1.4)
31
+ builder (~> 3.1)
32
+ erubi (~> 1.4)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.1.4)
36
+ activesupport (= 5.1.4)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.1.4)
39
+ activesupport (= 5.1.4)
40
+ activerecord (5.1.4)
41
+ activemodel (= 5.1.4)
42
+ activesupport (= 5.1.4)
43
+ arel (~> 8.0)
44
+ activesupport (5.1.4)
45
+ concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ i18n (~> 0.7)
47
+ minitest (~> 5.1)
48
+ tzinfo (~> 1.1)
49
+ appraisal (2.2.0)
50
+ bundler
51
+ rake
52
+ thor (>= 0.14.0)
53
+ arel (8.0.0)
54
+ builder (3.2.3)
55
+ concurrent-ruby (1.0.5)
56
+ crass (1.0.2)
57
+ diff-lcs (1.3)
58
+ docile (1.1.5)
59
+ erubi (1.6.1)
60
+ globalid (0.4.0)
61
+ activesupport (>= 4.2.0)
62
+ i18n (0.8.6)
63
+ json (2.1.0)
64
+ loofah (2.1.1)
65
+ crass (~> 1.0.2)
66
+ nokogiri (>= 1.5.9)
67
+ mail (2.6.6)
68
+ mime-types (>= 1.16, < 4)
69
+ method_source (0.9.0)
70
+ mime-types (3.1)
71
+ mime-types-data (~> 3.2015)
72
+ mime-types-data (3.2016.0521)
73
+ mini_portile2 (2.3.0)
74
+ minitest (5.10.3)
75
+ nio4r (2.1.0)
76
+ nokogiri (1.8.1)
77
+ mini_portile2 (~> 2.3.0)
78
+ rack (2.0.3)
79
+ rack-test (0.7.0)
80
+ rack (>= 1.0, < 3)
81
+ rails (5.1.4)
82
+ actioncable (= 5.1.4)
83
+ actionmailer (= 5.1.4)
84
+ actionpack (= 5.1.4)
85
+ actionview (= 5.1.4)
86
+ activejob (= 5.1.4)
87
+ activemodel (= 5.1.4)
88
+ activerecord (= 5.1.4)
89
+ activesupport (= 5.1.4)
90
+ bundler (>= 1.3.0)
91
+ railties (= 5.1.4)
92
+ sprockets-rails (>= 2.0.0)
93
+ rails-dom-testing (2.0.3)
94
+ activesupport (>= 4.2.0)
95
+ nokogiri (>= 1.6)
96
+ rails-html-sanitizer (1.0.3)
97
+ loofah (~> 2.0)
98
+ railties (5.1.4)
99
+ actionpack (= 5.1.4)
100
+ activesupport (= 5.1.4)
101
+ method_source
102
+ rake (>= 0.8.7)
103
+ thor (>= 0.18.1, < 2.0)
104
+ rake (10.5.0)
105
+ rspec (3.6.0)
106
+ rspec-core (~> 3.6.0)
107
+ rspec-expectations (~> 3.6.0)
108
+ rspec-mocks (~> 3.6.0)
109
+ rspec-core (3.6.0)
110
+ rspec-support (~> 3.6.0)
111
+ rspec-expectations (3.6.0)
112
+ diff-lcs (>= 1.2.0, < 2.0)
113
+ rspec-support (~> 3.6.0)
114
+ rspec-mocks (3.6.0)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.6.0)
117
+ rspec-support (3.6.0)
118
+ simplecov (0.15.1)
119
+ docile (~> 1.1.0)
120
+ json (>= 1.8, < 3)
121
+ simplecov-html (~> 0.10.0)
122
+ simplecov-html (0.10.2)
123
+ sprockets (3.7.1)
124
+ concurrent-ruby (~> 1.0)
125
+ rack (> 1, < 3)
126
+ sprockets-rails (3.2.1)
127
+ actionpack (>= 4.0)
128
+ activesupport (>= 4.0)
129
+ sprockets (>= 3.0.0)
130
+ sqlite3 (1.3.13)
131
+ thor (0.20.0)
132
+ thread_safe (0.3.6)
133
+ tzinfo (1.2.3)
134
+ thread_safe (~> 0.1)
135
+ websocket-driver (0.6.5)
136
+ websocket-extensions (>= 0.1.0)
137
+ websocket-extensions (0.1.2)
138
+
139
+ PLATFORMS
140
+ ruby
141
+
142
+ DEPENDENCIES
143
+ activerecord (~> 5.1)
144
+ activesupport (~> 5.1)
145
+ appraisal
146
+ bundler (~> 1.13)
147
+ porpoise!
148
+ rails (~> 5.1)
149
+ rake (~> 10.0)
150
+ rspec (~> 3.2)
151
+ simplecov (~> 0)
152
+ sqlite3 (~> 1.3)
153
+
154
+ BUNDLED WITH
155
+ 1.14.6
@@ -9,7 +9,6 @@ class PorpoiseCreateKeyValueObjects < ActiveRecord::Migration
9
9
 
10
10
  Porpoise::KeyValueObject.connection.add_index :key_value_objects, :key, unique: true
11
11
  Porpoise::KeyValueObject.connection.add_index :key_value_objects, [:key, :expiration_date]
12
- Porpoise::KeyValueObject.connection.add_index :key_value_objects, :key, name: 'key_fulltext_idx', type: :fulltext
13
12
  Porpoise::KeyValueObject.connection.add_index :key_value_objects, :data_type
14
13
  Porpoise::KeyValueObject.connection.add_index :key_value_objects, :expiration_date
15
14
  end
@@ -22,14 +22,16 @@ class Porpoise::KeyValueObject < ActiveRecord::Base
22
22
 
23
23
  serialize :value
24
24
 
25
- attr_accessible :key, :value, :data_type, :expiration_date
25
+ if ActiveRecord::VERSION::MAJOR == 3
26
+ attr_accessible :key, :value, :data_type, :expiration_date
27
+ end
26
28
 
27
29
  after_initialize :check_data_type
28
30
  before_validation :set_data_type
29
31
 
30
32
  validates_inclusion_of :data_type, in: %w(String Hash Array)
31
33
 
32
- scope :not_expired, conditions: ['(expiration_date IS NOT NULL AND expiration_date > ?) OR expiration_date IS NULL', Time.now]
34
+ scope :not_expired, -> { where(['(expiration_date IS NOT NULL AND expiration_date > ?) OR expiration_date IS NULL', Time.now]) }
33
35
 
34
36
  def expired?
35
37
  !self.expiration_date.nil? && self.expiration_date < Time.now
@@ -1,3 +1,3 @@
1
1
  module Porpoise
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
data/lib/porpoise.rb CHANGED
@@ -2,7 +2,6 @@ require "porpoise/version"
2
2
 
3
3
  require "active_record"
4
4
  require "active_support"
5
- require "mysql2"
6
5
 
7
6
  # Porpoise specific
8
7
  require "porpoise/key_value_object"
data/porpoise.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Wessel van Heerde"]
10
10
  spec.email = ["wessel.van.heerde@sentia.com"]
11
11
  spec.licenses = ['MIT']
12
- spec.summary = "Rails caching with a MySQL backend. Also a MySQL key/value store with a Redis compatible interface. Store and access objects in a Redis like way using MySQL as storage backend."
12
+ spec.summary = "Rails caching with an RDBMS backend. Also a key/value store with a Redis compatible interface backed by an RDBMS."
13
13
  spec.homepage = "https://github.com/sentialabs/porpoise"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -19,15 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = '>= 2.0'
23
+
22
24
  spec.add_development_dependency "bundler", "~> 1.13"
23
25
  spec.add_development_dependency "rake", "~> 10.0"
24
26
  spec.add_development_dependency "rspec", "~> 3.2"
25
27
  spec.add_development_dependency "sqlite3", "~> 1.3"
26
28
  spec.add_development_dependency "simplecov", "~> 0"
27
- spec.add_development_dependency "rspec-benchmark", "~> 0"
29
+ spec.add_development_dependency "appraisal"
28
30
 
29
- spec.add_dependency 'mysql2', '~> 0.3.20'
30
- spec.add_dependency 'activerecord', "~> 3.2"
31
- spec.add_dependency 'activesupport', "~> 3.2"
32
- spec.add_dependency "rails", '~> 3.2'
31
+ spec.add_dependency 'activerecord', ">= 3.2"
32
+ spec.add_dependency 'activesupport', ">= 3.2"
33
+ spec.add_dependency "rails", ">= 3.2"
33
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: porpoise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wessel van Heerde
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-06 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,73 +81,59 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec-benchmark
84
+ name: appraisal
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: mysql2
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.3.20
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.3.20
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: activerecord
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - "~>"
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '3.2'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - "~>"
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: '3.2'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: activesupport
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - "~>"
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: '3.2'
132
118
  type: :runtime
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - "~>"
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '3.2'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: rails
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - "~>"
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: '3.2'
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - "~>"
136
+ - - ">="
151
137
  - !ruby/object:Gem::Version
152
138
  version: '3.2'
153
139
  description:
@@ -158,6 +144,7 @@ extensions: []
158
144
  extra_rdoc_files: []
159
145
  files:
160
146
  - ".gitignore"
147
+ - Appraisals
161
148
  - Dockerfile
162
149
  - Gemfile
163
150
  - LICENSE
@@ -165,6 +152,12 @@ files:
165
152
  - Rakefile
166
153
  - bin/console
167
154
  - bin/setup
155
+ - gemfiles/rails_3.gemfile
156
+ - gemfiles/rails_3.gemfile.lock
157
+ - gemfiles/rails_4.gemfile
158
+ - gemfiles/rails_4.gemfile.lock
159
+ - gemfiles/rails_5.gemfile
160
+ - gemfiles/rails_5.gemfile.lock
168
161
  - lib/active_support/cache/porpoise_store.rb
169
162
  - lib/generators/porpoise/install_generator.rb
170
163
  - lib/generators/porpoise/templates/migration.rb
@@ -189,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
182
  requirements:
190
183
  - - ">="
191
184
  - !ruby/object:Gem::Version
192
- version: '0'
185
+ version: '2.0'
193
186
  required_rubygems_version: !ruby/object:Gem::Requirement
194
187
  requirements:
195
188
  - - ">="
@@ -200,7 +193,6 @@ rubyforge_project:
200
193
  rubygems_version: 2.5.2
201
194
  signing_key:
202
195
  specification_version: 4
203
- summary: Rails caching with a MySQL backend. Also a MySQL key/value store with a Redis
204
- compatible interface. Store and access objects in a Redis like way using MySQL as
205
- storage backend.
196
+ summary: Rails caching with an RDBMS backend. Also a key/value store with a Redis
197
+ compatible interface backed by an RDBMS.
206
198
  test_files: []