ecfr 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: 85c87c825574d6224010a1647a47b368d2812912fcd6191b5ac3dfeb5f3966da
4
- data.tar.gz: a6f606db625df4f721763499457279ebeb35ba92aa53cbd4410fa400d6518701
3
+ metadata.gz: 9a461ee470f942857af590c19d394480c9fae9120f34d350177c2cfcdde01afa
4
+ data.tar.gz: c5e33627c9a6de6cc626588dc5772c9e51276aab272293960f85672c7e2c30d4
5
5
  SHA512:
6
- metadata.gz: a7fb4dacbb2efa5c73fa9e3263e1d5348a436bf749f4df941f43d5ee658ffd03e5427281f37b0b06280eb3d3c9aa2402fd94953c2cba87c6d32a098508396080
7
- data.tar.gz: cc6bcf78a7d2ca7acca3f992c31f0716a0162e0f081a6e51a1ee8301a3d8e8e6c420150ab3d1ae023c025c358efbced1d8f9f7c2e5a4790c8381dc35bf34e947
6
+ metadata.gz: 5f1289d6881ae12c16bf38d3f6f19b4d62690f8fd651273b2146a08a2c8e6c1e715f279f71dee059ff7304c5f2e4b092cc95b003fbfacd84c6bd712616ba7ce8
7
+ data.tar.gz: feb036c209435977e25198394deb3a814d76f821ee560d643bf5c4dcd1a0bf0f4abc649921d8fbd9dce11d467c07eb2660319149aa1343e8351d494348cbbf14
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.4] - 2023-04-24
4
+ ### Additions
5
+ - Add Ecfr::VarnishCacheService for clearing of cache
6
+
3
7
  ## [1.0.3] - 2023-04-21
4
8
  ### Changes
5
9
  - Adjust PDF service name and set url default
@@ -17,6 +17,7 @@ module Ecfr
17
17
  renderer_service_url: nil,
18
18
  search_service_url: nil,
19
19
  subscriptions_service_url: nil,
20
+ varnish_cache_service_url: nil,
20
21
  versioner_service_url: nil,
21
22
  # basic auth - some endpoints require auth
22
23
  ecfr_basic_auth_username: nil,
@@ -0,0 +1,25 @@
1
+ module Ecfr
2
+ #
3
+ # Varnish is used to provide cache based on an expires header set by
4
+ # various service endpoints. Varnish is only routable internally.
5
+ #
6
+ module VarnishCacheService
7
+ class Base < Ecfr::Base
8
+ def self.base_url
9
+ Ecfr.config.varnish_cache_service_url
10
+ end
11
+
12
+ def self.service_name
13
+ "Varnish Cache Service"
14
+ end
15
+
16
+ def self.expire(path)
17
+ purge(path)
18
+ end
19
+
20
+ def self.expire_everything
21
+ expire("/.*")
22
+ end
23
+ end
24
+ end
25
+ end
data/lib/ecfr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ecfr
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.4"
5
5
  end
data/lib/ecfr.rb CHANGED
@@ -56,6 +56,7 @@ module Ecfr
56
56
  Ecfr::RendererService,
57
57
  Ecfr::SearchService,
58
58
  Ecfr::SubscriptionsService,
59
+ Ecfr::VarnishCacheService,
59
60
  Ecfr::VersionerService
60
61
  ]
61
62
  end
@@ -87,4 +88,5 @@ require_relative "ecfr/prince_xml_service/base"
87
88
  require_relative "ecfr/renderer_service/base"
88
89
  require_relative "ecfr/search_service/base"
89
90
  require_relative "ecfr/subscriptions_service/base"
91
+ require_relative "ecfr/varnish_cache_service/base"
90
92
  require_relative "ecfr/versioner_service/base"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecfr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peregrinator
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2023-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -341,6 +341,7 @@ files:
341
341
  - lib/ecfr/testing/factory_bot_helpers/ecfr_gem_initialize_helpers.rb
342
342
  - lib/ecfr/testing/helpers/response_helper.rb
343
343
  - lib/ecfr/testing/strategies/ecfr_attribute_hash_strategy.rb
344
+ - lib/ecfr/varnish_cache_service/base.rb
344
345
  - lib/ecfr/version.rb
345
346
  - lib/ecfr/versioner_service/ancestors.rb
346
347
  - lib/ecfr/versioner_service/ancestors/metadata_node_info.rb