hitnmiss 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ module Hitnmiss
2
+ module Repository
3
+ module DriverManagement
4
+ def self.extended(mod)
5
+ mod.driver :in_memory
6
+ end
7
+
8
+ def driver(driver_name=nil)
9
+ if driver_name
10
+ @driver_name = driver_name
11
+ else
12
+ @driver_name
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ module Hitnmiss
2
+ module Repository
3
+ module Fetcher
4
+ private
5
+
6
+ def fetch(*args)
7
+ raise Hitnmiss::Errors::NotImplemented
8
+ end
9
+
10
+ def fetch_all(keyspace)
11
+ raise Hitnmiss::Errors::NotImplemented
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,31 @@
1
+ module Hitnmiss
2
+ module Repository
3
+ module KeyGeneration
4
+ KEY_COMPONENT_SEPARATOR = '.'.freeze
5
+ KEY_COMPONENT_TYPE_SEPARATOR = ':'.freeze
6
+
7
+ def self.included(mod)
8
+ mod.extend(ClassMethods)
9
+ mod.include(InstanceMethods)
10
+ end
11
+
12
+ module ClassMethods
13
+ def keyspace
14
+ name
15
+ end
16
+ end
17
+
18
+ module InstanceMethods
19
+ private
20
+
21
+ def generate_key(*args)
22
+ components = args.map do |arg|
23
+ "#{arg.class.name}#{KEY_COMPONENT_TYPE_SEPARATOR}#{arg}"
24
+ end
25
+ return "#{self.class.keyspace}#{KEY_COMPONENT_SEPARATOR}" \
26
+ "#{components.join(KEY_COMPONENT_SEPARATOR)}"
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ module Hitnmiss
2
+ VERSION = "2.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,157 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hitnmiss
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew De Ponte
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-07-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: timecop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: codeclimate-test-reporter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.4'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.4'
97
+ description: Ruby gem to support using the Repository pattern for read-through, write-behind
98
+ caching using POROs
99
+ email:
100
+ - cyphactor@gmail.com
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".codeclimate.yml"
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".travis.yml"
109
+ - CHANGELOG.md
110
+ - CODE_OF_CONDUCT.md
111
+ - CONTRIBUTING.md
112
+ - DEVELOPMENT.md
113
+ - Gemfile
114
+ - LICENSE.txt
115
+ - README.md
116
+ - Rakefile
117
+ - bin/console
118
+ - bin/setup
119
+ - hitnmiss.gemspec
120
+ - lib/hitnmiss.rb
121
+ - lib/hitnmiss/background_refresh_repository.rb
122
+ - lib/hitnmiss/driver.rb
123
+ - lib/hitnmiss/driver_registry.rb
124
+ - lib/hitnmiss/entity.rb
125
+ - lib/hitnmiss/errors.rb
126
+ - lib/hitnmiss/in_memory_driver.rb
127
+ - lib/hitnmiss/repository.rb
128
+ - lib/hitnmiss/repository/cache_management.rb
129
+ - lib/hitnmiss/repository/driver_management.rb
130
+ - lib/hitnmiss/repository/fetcher.rb
131
+ - lib/hitnmiss/repository/key_generation.rb
132
+ - lib/hitnmiss/version.rb
133
+ homepage: https://github.com/Acornsgrow/hitnmiss
134
+ licenses:
135
+ - MIT
136
+ metadata: {}
137
+ post_install_message:
138
+ rdoc_options: []
139
+ require_paths:
140
+ - lib
141
+ required_ruby_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ requirements: []
152
+ rubyforge_project:
153
+ rubygems_version: 2.5.1
154
+ signing_key:
155
+ specification_version: 4
156
+ summary: Ruby read-through, write-behind caching using POROs
157
+ test_files: []