activerecord_settings 0.0.2 → 0.0.3
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 +4 -4
- data/Gemfile.lock +57 -55
- data/README.md +31 -6
- data/activerecord_settings.gemspec +1 -1
- data/lib/activerecord_settings/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: acb5163e3ac64e445fb074545f4fee826376c057
|
|
4
|
+
data.tar.gz: bd0c63c6d92f8fa6a4b32055a20c9f2cd854eac0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
5
|
-
activerecord (>=
|
|
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 (
|
|
11
|
-
|
|
12
|
-
activesupport (=
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
rack
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
activesupport (
|
|
56
|
-
|
|
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
|
-
|
|
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.
|
|
83
|
+
test-unit (3.2.7)
|
|
83
84
|
power_assert
|
|
84
85
|
thor (0.20.0)
|
|
85
|
-
|
|
86
|
+
thread_safe (0.3.6)
|
|
86
87
|
timecop (0.9.1)
|
|
87
|
-
tzinfo (
|
|
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.
|
|
105
|
+
1.16.0
|
data/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Activerecord Settings
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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/
|
|
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", [">=
|
|
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"
|
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.
|
|
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: '
|
|
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: '
|
|
29
|
+
version: '4.0'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '5.2'
|