activerecord_settings 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48a87bf726834d2f83bc7f033e5621a493b61696
4
- data.tar.gz: 7950f1f8a72055f21839812c54777f130c7b5ec9
3
+ metadata.gz: acb5163e3ac64e445fb074545f4fee826376c057
4
+ data.tar.gz: bd0c63c6d92f8fa6a4b32055a20c9f2cd854eac0
5
5
  SHA512:
6
- metadata.gz: 0f199104198669eadeab3e3c498ae948f67503d9828c25887694772e989872ab893091a70ceec40583f0cdd9a887eb07e7a98112231f759f5dc0df257d2ddf89
7
- data.tar.gz: 971c701e6f0028d2a37a2687610fe823948a5bfaafa3000c61ffb1d7f615f0a8ed7b2ff9653ce49c6f6415b983f1d653aaa67b77b75e98016c063e64f1776b7b
6
+ metadata.gz: 84bc77c26c96c60fd4c5b1ad13eaee370b1238d5deab8112997300e46e07d62b532869bcf2c2f6729e153f0df8790846027b349b2bfe5f7b3325f18c879a8c53
7
+ data.tar.gz: 40b1b7436d19e4747993d73ebdf07bc40ff3c225b58eba681c87284e1b2980ac08a6fd0fabb38bf86704724f9054e33fe5d86f38e05c215feaede1aca53b0558
data/Gemfile.lock CHANGED
@@ -1,65 +1,71 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord_settings (0.0.1)
5
- activerecord (>= 3.0, < 5.2)
4
+ activerecord_settings (0.0.3)
5
+ activerecord (>= 4.0, < 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionpack (3.2.22.5)
11
- activemodel (= 3.2.22.5)
12
- activesupport (= 3.2.22.5)
13
- builder (~> 3.0.0)
14
- erubis (~> 2.7.0)
15
- journey (~> 1.0.4)
16
- rack (~> 1.4.5)
17
- rack-cache (~> 1.2)
18
- rack-test (~> 0.6.1)
19
- sprockets (~> 2.2.1)
20
- activemodel (3.2.22.5)
21
- activesupport (= 3.2.22.5)
22
- builder (~> 3.0.0)
23
- activerecord (3.2.22.5)
24
- activemodel (= 3.2.22.5)
25
- activesupport (= 3.2.22.5)
26
- arel (~> 3.0.2)
27
- tzinfo (~> 0.3.29)
28
- activesupport (3.2.22.5)
29
- i18n (~> 0.6, >= 0.6.4)
30
- multi_json (~> 1.0)
31
- arel (3.0.3)
32
- builder (3.0.4)
10
+ actionpack (5.1.4)
11
+ actionview (= 5.1.4)
12
+ activesupport (= 5.1.4)
13
+ rack (~> 2.0)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (5.1.4)
18
+ activesupport (= 5.1.4)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
23
+ activemodel (5.1.4)
24
+ activesupport (= 5.1.4)
25
+ activerecord (5.1.4)
26
+ activemodel (= 5.1.4)
27
+ activesupport (= 5.1.4)
28
+ arel (~> 8.0)
29
+ activesupport (5.1.4)
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ i18n (~> 0.7)
32
+ minitest (~> 5.1)
33
+ tzinfo (~> 1.1)
34
+ arel (8.0.0)
35
+ builder (3.2.3)
33
36
  concurrent-ruby (1.0.5)
37
+ crass (1.0.3)
34
38
  diff-lcs (1.3)
35
- erubis (2.7.0)
39
+ erubi (1.7.0)
36
40
  generator_spec (0.9.4)
37
41
  activesupport (>= 3.0.0)
38
42
  railties (>= 3.0.0)
39
- hike (1.2.3)
40
43
  i18n (0.9.3)
41
44
  concurrent-ruby (~> 1.0)
42
- journey (1.0.4)
43
- json (1.8.6)
44
- multi_json (1.13.1)
45
- power_assert (0.2.6)
46
- rack (1.4.7)
47
- rack-cache (1.7.1)
48
- rack (>= 0.4)
49
- rack-ssl (1.3.4)
50
- rack
51
- rack-test (0.6.3)
52
- rack (>= 1.0)
53
- railties (3.2.22.5)
54
- actionpack (= 3.2.22.5)
55
- activesupport (= 3.2.22.5)
56
- rack-ssl (~> 1.3.2)
45
+ loofah (2.1.1)
46
+ crass (~> 1.0.2)
47
+ nokogiri (>= 1.5.9)
48
+ method_source (0.9.0)
49
+ mini_portile2 (2.3.0)
50
+ minitest (5.11.3)
51
+ nokogiri (1.8.2)
52
+ mini_portile2 (~> 2.3.0)
53
+ power_assert (1.1.1)
54
+ rack (2.0.3)
55
+ rack-test (0.8.2)
56
+ rack (>= 1.0, < 3)
57
+ rails-dom-testing (2.0.3)
58
+ activesupport (>= 4.2.0)
59
+ nokogiri (>= 1.6)
60
+ rails-html-sanitizer (1.0.3)
61
+ loofah (~> 2.0)
62
+ railties (5.1.4)
63
+ actionpack (= 5.1.4)
64
+ activesupport (= 5.1.4)
65
+ method_source
57
66
  rake (>= 0.8.7)
58
- rdoc (~> 3.4)
59
- thor (>= 0.14.6, < 2.0)
67
+ thor (>= 0.18.1, < 2.0)
60
68
  rake (10.5.0)
61
- rdoc (3.12.2)
62
- json (~> 1.4)
63
69
  rspec (3.7.0)
64
70
  rspec-core (~> 3.7.0)
65
71
  rspec-expectations (~> 3.7.0)
@@ -73,18 +79,14 @@ GEM
73
79
  diff-lcs (>= 1.2.0, < 2.0)
74
80
  rspec-support (~> 3.7.0)
75
81
  rspec-support (3.7.1)
76
- sprockets (2.2.3)
77
- hike (~> 1.2)
78
- multi_json (~> 1.0)
79
- rack (~> 1.0)
80
- tilt (~> 1.1, != 1.3.0)
81
82
  sqlite3 (1.3.13)
82
- test-unit (3.1.5)
83
+ test-unit (3.2.7)
83
84
  power_assert
84
85
  thor (0.20.0)
85
- tilt (1.4.1)
86
+ thread_safe (0.3.6)
86
87
  timecop (0.9.1)
87
- tzinfo (0.3.53)
88
+ tzinfo (1.2.4)
89
+ thread_safe (~> 0.1)
88
90
 
89
91
  PLATFORMS
90
92
  ruby
@@ -100,4 +102,4 @@ DEPENDENCIES
100
102
  timecop (~> 0.9)
101
103
 
102
104
  BUNDLED WITH
103
- 1.16.1
105
+ 1.16.0
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # ActiverecordSettings
1
+ # Activerecord Settings
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activerecord_settings`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem creates a very simple activerecord based key value store. It can be useful if you want a place to store stuff that is more durable than a redis/memcache cache, or you simply don't want or need the complexity of running an additional cache.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,34 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ Create the migration to create the activerecord table with
24
+
25
+ bundle exec rails g activerecord_settings:install
26
+
27
+ Then you can set and get values like this
28
+
29
+ ActiverecordSettings::Setting.set('key', anything_yaml_can_serialize)
30
+ ActiverecordSettings::Setting.get('key')
31
+ => anything_yaml_can_serialize
32
+
33
+ You can also set keys to have expiries
34
+
35
+ ActiverecordSettings::Setting.set('key', "It's morning", expires: 10.minutes.from_now)
36
+ ActiverecordSettings::Setting.get('key')
37
+ => "It's morning"
38
+ # Some time passes, Thorin sings about gold
39
+ ActiverecordSettings::Setting.get('key')
40
+ => nil
41
+
42
+ ```ActiverecordSettings::Setting``` is a bit of a mouthful, so you can create a shorthand for it by putting something like the following in an initiliazer
43
+
44
+ Setting = ActiverecordSettings::Setting
45
+
46
+ And then you can do this
47
+
48
+ Setting.set('key', anything_yaml_can_serialize)
49
+ Setting.get('key')
50
+ => anything_yaml_can_serialize
26
51
 
27
52
  ## Development
28
53
 
@@ -32,7 +57,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
57
 
33
58
  ## Contributing
34
59
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord_settings.
60
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dansingerman/activerecord_settings.
36
61
 
37
62
  ## License
38
63
 
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency "activerecord", [">= 3.0", "< 5.2"]
24
+ spec.add_dependency "activerecord", [">= 4.0", "< 5.2"]
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.16"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,3 +1,3 @@
1
1
  module ActiverecordSettings
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Singerman
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '4.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '3.0'
29
+ version: '4.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.2'