stockpile 1.1 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.autotest +3 -22
- data/.minitest.rb +2 -2
- data/.rubocop.yml +212 -0
- data/.simplecov-prelude.rb +9 -0
- data/.travis.yml +6 -7
- data/.workenv +5 -0
- data/Code-of-Conduct.md +76 -0
- data/Gemfile +1 -1
- data/History.md +48 -0
- data/Licence.rdoc +1 -1
- data/Manifest.txt +5 -1
- data/README.rdoc +5 -6
- data/Rakefile +35 -27
- data/lib/stockpile.rb +4 -4
- data/lib/stockpile/base.rb +9 -7
- data/lib/stockpile/memory.rb +11 -8
- data/test/minitest_config.rb +2 -6
- data/test/test_stockpile.rb +37 -37
- data/test/test_stockpile_base.rb +46 -41
- metadata +28 -24
- data/History.rdoc +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1653950791d5fd843c349e0e0ff6904b414ae783
|
4
|
+
data.tar.gz: 2d66981b77636ffdcaad743772cfb947ff6cabdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d537a5118ab9f6fed1888bcb2f3ba4969962b323436ca6f17f295f62e8c4abfbf7fe4c7803b3b3875535583a1ae909ee4c18f39cd96176a585899cc3e95f7274
|
7
|
+
data.tar.gz: e2187afa754b8224d32648e940c48b7f63f2d1603db0895fb33b0303c78bc95a17ca6d17a76c08ca36569426e624461495aaf4a05478c6fc931250aea0103e40
|
data/.autotest
CHANGED
@@ -1,27 +1,8 @@
|
|
1
1
|
# -*- ruby -*-
|
2
|
+
# frozen-string-literal: true
|
2
3
|
|
3
|
-
require
|
4
|
+
require 'autotest/restart'
|
4
5
|
|
5
6
|
Autotest.add_hook :initialize do |at|
|
6
|
-
|
7
|
-
at.testlib = ".minitest.rb"
|
8
|
-
# at.testlib = "minitest/unit"
|
9
|
-
#
|
10
|
-
# at.extra_files << "../some/external/dependency.rb"
|
11
|
-
#
|
12
|
-
# at.libs << ":../some/external"
|
13
|
-
#
|
14
|
-
# at.add_exception "vendor"
|
15
|
-
#
|
16
|
-
# at.add_mapping(/dependency.rb/) do |f, _|
|
17
|
-
# at.files_matching(/test_.*rb$/)
|
18
|
-
# end
|
19
|
-
#
|
20
|
-
# %w(TestA TestB).each do |klass|
|
21
|
-
# at.extra_class_map[klass] = "test/test_misc.rb"
|
22
|
-
# end
|
7
|
+
at.testlib = '.minitest.rb'
|
23
8
|
end
|
24
|
-
|
25
|
-
# Autotest.add_hook :run_command do |at|
|
26
|
-
# system "rake build"
|
27
|
-
# end
|
data/.minitest.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
gem
|
2
|
-
require
|
1
|
+
gem 'minitest'
|
2
|
+
require 'minitest/autorun'
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
---
|
2
|
+
# inherit_from: .rubocop_todo.yml
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
Include:
|
6
|
+
- '**/Rakefile'
|
7
|
+
- '**/config.rb'
|
8
|
+
Exclude:
|
9
|
+
- 'bin/**/*'
|
10
|
+
- 'config/**/*'
|
11
|
+
- 'script/**/*'
|
12
|
+
- 'tmp/**/*'
|
13
|
+
DisplayCopNames: true
|
14
|
+
TargetRubyVersion: 2.3
|
15
|
+
|
16
|
+
Style/AlignHash:
|
17
|
+
EnforcedHashRocketStyle: key
|
18
|
+
EnforcedColonStyle: key
|
19
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
20
|
+
|
21
|
+
Style/AndOr:
|
22
|
+
EnforcedStyle: conditionals
|
23
|
+
|
24
|
+
Style/BarePercentLiterals:
|
25
|
+
EnforcedStyle: percent_q
|
26
|
+
|
27
|
+
Style/BracesAroundHashParameters:
|
28
|
+
EnforcedStyle: context_dependent
|
29
|
+
|
30
|
+
Style/Documentation:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Style/Lambda:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Style/TrailingCommaInLiteral:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/TrailingCommaInArguments:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/ClassAndModuleChildren:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/MultilineMethodCallIndentation:
|
46
|
+
EnforcedStyle: indented
|
47
|
+
|
48
|
+
Style/MultilineOperationIndentation:
|
49
|
+
EnforcedStyle: indented
|
50
|
+
|
51
|
+
Style/DotPosition:
|
52
|
+
EnforcedStyle: trailing
|
53
|
+
|
54
|
+
Style/AlignParameters:
|
55
|
+
EnforcedStyle: with_fixed_indentation
|
56
|
+
|
57
|
+
# This replaces the old Style/Blocks. The default for this is still stupid
|
58
|
+
# (multiline blocks are do/end and single-line blocks are {/}), but it now
|
59
|
+
# performs a semantic analysis, allowing for the more nuanced version proposed
|
60
|
+
# by Jim Weirich around 2004. If a block is used as part of an assignment or
|
61
|
+
# method chaining, prefer {/} delimiters; if not, prefer do/end delimiters. It
|
62
|
+
# isn't *quite* that simple in all circumstances, but we can add them to one of
|
63
|
+
# three groups: ProceduralMethods (prefer do/end), FunctionalMethods ({/}), and
|
64
|
+
# ignored (because it does not matter).
|
65
|
+
Style/BlockDelimiters:
|
66
|
+
Enabled: false
|
67
|
+
EnforcedStyle: semantic
|
68
|
+
ProceduralMethods:
|
69
|
+
# Methods that are known to be procedural in nature but look functional from
|
70
|
+
# their usage, e.g.
|
71
|
+
#
|
72
|
+
# time = Benchmark.realtime do
|
73
|
+
# foo.bar
|
74
|
+
# end
|
75
|
+
#
|
76
|
+
# Here, the return value of the block is discarded but the return value of
|
77
|
+
# `Benchmark.realtime` is used.
|
78
|
+
- benchmark
|
79
|
+
- bm
|
80
|
+
- bmbm
|
81
|
+
- create
|
82
|
+
- each_with_object
|
83
|
+
- measure
|
84
|
+
- new
|
85
|
+
- realtime
|
86
|
+
- tap
|
87
|
+
- with_object
|
88
|
+
- assert_raises
|
89
|
+
- solr_search
|
90
|
+
- solr_paginated
|
91
|
+
- all_of
|
92
|
+
- any_of
|
93
|
+
FunctionalMethods:
|
94
|
+
# Methods that are known to be functional in nature but look procedural from
|
95
|
+
# their usage, e.g.
|
96
|
+
#
|
97
|
+
# let(:foo) { Foo.new }
|
98
|
+
#
|
99
|
+
# Here, the return value of `Foo.new` is used to define a `foo` helper but
|
100
|
+
# doesn't appear to be used from the return value of `let`.
|
101
|
+
- let
|
102
|
+
- let!
|
103
|
+
- subject
|
104
|
+
- watch
|
105
|
+
IgnoredMethods:
|
106
|
+
# Methods that can be either procedural or functional and cannot be
|
107
|
+
# categorised from their usage alone, e.g.
|
108
|
+
#
|
109
|
+
# foo = lambda do |x|
|
110
|
+
# puts "Hello, #{x}"
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# foo = lambda do |x|
|
114
|
+
# x * 100
|
115
|
+
# end
|
116
|
+
#
|
117
|
+
# Here, it is impossible to tell from the return value of `lambda` whether
|
118
|
+
# the inner block's return value is significant.
|
119
|
+
- lambda
|
120
|
+
- proc
|
121
|
+
- it
|
122
|
+
Performance/FixedSize:
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Style/FormatString:
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
Style/NumericLiterals:
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Style/SpaceInsideBrackets:
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Style/CommentAnnotation:
|
135
|
+
Enabled: false
|
136
|
+
|
137
|
+
Style/AsciiComments:
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
Style/ClassCheck:
|
141
|
+
EnforcedStyle: kind_of?
|
142
|
+
|
143
|
+
Style/RegexpLiteral:
|
144
|
+
EnforcedStyle: mixed
|
145
|
+
|
146
|
+
Style/CommandLiteral:
|
147
|
+
EnforcedStyle: percent_x
|
148
|
+
|
149
|
+
Style/UnneededPercentQ:
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
Style/IndentAssignment:
|
153
|
+
Enabled: false
|
154
|
+
|
155
|
+
Metrics/AbcSize:
|
156
|
+
Enabled: false
|
157
|
+
|
158
|
+
Metrics/CyclomaticComplexity:
|
159
|
+
Enabled: false
|
160
|
+
|
161
|
+
Metrics/MethodLength:
|
162
|
+
Enabled: false
|
163
|
+
|
164
|
+
Metrics/ModuleLength:
|
165
|
+
Enabled: false
|
166
|
+
|
167
|
+
Metrics/ClassLength:
|
168
|
+
Enabled: false
|
169
|
+
|
170
|
+
Metrics/PerceivedComplexity:
|
171
|
+
Enabled: false
|
172
|
+
|
173
|
+
Metrics/LineLength:
|
174
|
+
Max: 90
|
175
|
+
Exclude:
|
176
|
+
- test/**/*
|
177
|
+
- Gemfile
|
178
|
+
|
179
|
+
Style/MethodDefParentheses:
|
180
|
+
Exclude:
|
181
|
+
- test/**/*
|
182
|
+
|
183
|
+
Style/DoubleNegation:
|
184
|
+
Enabled: false
|
185
|
+
|
186
|
+
Style/FileName:
|
187
|
+
Exclude:
|
188
|
+
- Gemfile
|
189
|
+
- .autotest
|
190
|
+
- .simplecov-prelude.rb
|
191
|
+
|
192
|
+
Style/RedundantSelf:
|
193
|
+
Exclude:
|
194
|
+
- test/test_helper.rb
|
195
|
+
|
196
|
+
Style/SignalException:
|
197
|
+
EnforcedStyle: semantic
|
198
|
+
|
199
|
+
Style/Alias:
|
200
|
+
EnforcedStyle: prefer_alias_method
|
201
|
+
|
202
|
+
Style/SpecialGlobalVars:
|
203
|
+
Enabled: false
|
204
|
+
|
205
|
+
Performance/RedundantBlockCall:
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Style/LambdaCall:
|
209
|
+
Enabled: false
|
210
|
+
|
211
|
+
Style/ParallelAssignment:
|
212
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
---
|
2
|
+
sudo: false
|
2
3
|
language: ruby
|
3
4
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
-
|
5
|
+
- 2.3.0
|
6
|
+
- 2.2
|
7
|
+
- 2.1
|
8
|
+
- 2.0
|
8
9
|
- ruby-head
|
9
|
-
- jruby-
|
10
|
-
- jruby-head
|
10
|
+
- jruby-9.0
|
11
11
|
- rbx-2
|
12
12
|
matrix:
|
13
13
|
allow_failures:
|
14
14
|
- rvm: rbx-2
|
15
|
-
- rvm: jruby-head
|
16
15
|
- rvm: ruby-head
|
17
16
|
gemfile:
|
18
17
|
- Gemfile
|
data/.workenv
ADDED
data/Code-of-Conduct.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
## Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
### Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age,
|
8
|
+
body size, disability, ethnicity, gender identity and expression, level of
|
9
|
+
experience, nationality, personal appearance, race, religion, or sexual
|
10
|
+
identity and orientation.
|
11
|
+
|
12
|
+
### Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
### Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
### Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an
|
52
|
+
appointed representative at an online or offline event. Representation of a
|
53
|
+
project may be further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
### Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
62
|
+
incident. Further details of specific enforcement policies may be posted
|
63
|
+
separately.
|
64
|
+
|
65
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
66
|
+
faith may face temporary or permanent repercussions as determined by other
|
67
|
+
members of the project's leadership.
|
68
|
+
|
69
|
+
### Attribution
|
70
|
+
|
71
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
72
|
+
version 1.4, available at
|
73
|
+
[http://contributor-covenant.org/version/1/4][version]
|
74
|
+
|
75
|
+
[homepage]: http://contributor-covenant.org
|
76
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/History.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
### 2.0 / 2016-04-04
|
2
|
+
|
3
|
+
* 1 major change
|
4
|
+
|
5
|
+
* Dropped support for Ruby 1.9 families.
|
6
|
+
|
7
|
+
* 1 bugfix
|
8
|
+
|
9
|
+
* Fix [stockpile-redis issue #1][]. Although not reported against
|
10
|
+
Stockpile, this issue was caused by calling #fetch (and #delete)
|
11
|
+
against an OpenStruct options object in any instance of
|
12
|
+
Stockpile::Base.
|
13
|
+
|
14
|
+
* 1 governance change
|
15
|
+
|
16
|
+
* Add a Code of Conduct based on the Contributor's Covenant 1.4.
|
17
|
+
|
18
|
+
* Miscellaneous
|
19
|
+
|
20
|
+
* Added Rubocop.
|
21
|
+
|
22
|
+
### 1.1 / 2015-02-10
|
23
|
+
|
24
|
+
* 3 minor enhancements
|
25
|
+
|
26
|
+
* Created a base adapter, Stockpile::Base, that implements the core public
|
27
|
+
interface of a connection manager in a consistent way for argument parsing.
|
28
|
+
|
29
|
+
* Created a memory adapter as an example adapter. (This had previously been
|
30
|
+
a test adapter created in the test environment.)
|
31
|
+
|
32
|
+
* Documented changes to how clients can be specified for Stockpile.new,
|
33
|
+
Stockpile#connect, and Stockpile#connection_for.
|
34
|
+
|
35
|
+
* 1 bugfix
|
36
|
+
|
37
|
+
* Fix [issue #2][], where
|
38
|
+
the use of the cache adapter causes the Stockpile cache manager to
|
39
|
+
initialize too early.
|
40
|
+
|
41
|
+
### 1.0 / 2015-01-21
|
42
|
+
|
43
|
+
* 1 major enhancement
|
44
|
+
|
45
|
+
* Birthday!
|
46
|
+
|
47
|
+
[issue #2]: https://github.com/halostatue/stockpile/issues/2
|
48
|
+
[stockpile-redis issue #1]: https://github.com/halostatue/stockpile-redis/issues/1
|
data/Licence.rdoc
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
This software is available under an MIT-style licence.
|
4
4
|
|
5
|
-
* Copyright 2015 Austin Ziegler
|
5
|
+
* Copyright 2015–2016 Austin Ziegler
|
6
6
|
|
7
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
8
8
|
this software and associated documentation files (the "Software"), to deal in
|