cal-invite 0.2.1 → 0.3.1

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.
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # lib/cal_invite/caching.rb
4
- require 'active_support/concern'
5
-
6
- module CalInvite
7
- module Caching
8
- extend ActiveSupport::Concern
9
-
10
- class_methods do
11
- def fetch_from_cache(key, options = {}, &block)
12
- full_key = generate_cache_key(key)
13
- store = CalInvite.configuration.cache_store
14
-
15
- if store.respond_to?(:fetch)
16
- store.fetch(full_key, options, &block)
17
- else
18
- cached = store.read(full_key)
19
- return cached if cached
20
-
21
- value = block.call
22
- store.write(full_key, value, options)
23
- value
24
- end
25
- end
26
-
27
- def write_to_cache(key, value, options = {})
28
- full_key = generate_cache_key(key)
29
- options[:expires_in] ||= CalInvite.configuration.cache_expires_in
30
- CalInvite.configuration.cache_store.write(full_key, value, options)
31
- end
32
-
33
- def read_from_cache(key)
34
- full_key = generate_cache_key(key)
35
- CalInvite.configuration.cache_store.read(full_key)
36
- end
37
-
38
- def clear_cache!
39
- store = CalInvite.configuration.cache_store
40
- if store.respond_to?(:delete_matched)
41
- store.delete_matched("#{CalInvite.configuration.cache_prefix}:*")
42
- else
43
- store.clear
44
- end
45
- end
46
-
47
- def clear_event_cache!(event_id)
48
- delete_cache_pattern("events:#{event_id}")
49
- end
50
-
51
- def clear_provider_cache!(provider)
52
- delete_cache_pattern("providers:#{provider}")
53
- end
54
-
55
- def generate_cache_key(*parts)
56
- ([CalInvite.configuration.cache_prefix] + parts).join(':')
57
- end
58
-
59
- private
60
-
61
- def delete_cache_pattern(pattern)
62
- store = CalInvite.configuration.cache_store
63
- full_pattern = generate_cache_key(pattern)
64
-
65
- if store.respond_to?(:delete_matched)
66
- store.delete_matched("#{full_pattern}:*")
67
- else
68
- # Fallback for stores that don't support pattern deletion
69
- store.delete(full_pattern)
70
- end
71
- end
72
- end
73
- end
74
- end
data/lib/tasks/rdoc.rake DELETED
@@ -1,13 +0,0 @@
1
- # lib/tasks/rdoc.rake
2
- require 'rdoc/task'
3
-
4
- RDoc::Task.new do |rdoc|
5
- rdoc.rdoc_dir = 'doc'
6
- rdoc.title = 'CalInvite Documentation'
7
- rdoc.main = 'README.md'
8
- rdoc.options << '--line-numbers'
9
- rdoc.options << '--charset' << 'UTF-8'
10
- rdoc.options << '--markup' << 'markdown'
11
- rdoc.rdoc_files.include('README.md', 'LICENSE', 'lib/**/*.rb')
12
- rdoc.rdoc_files.exclude('lib/cal_invite/version.rb')
13
- end