prismic_rails 1.3.1 → 1.3.2

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: a6cc3936847f401ef1ce58fbffa002607058b5cc6f82e58db8eb3869da7834d9
4
- data.tar.gz: d7b8911b70577b7d5b26aa4045a6efb6cd6429c52e171061daf11b72859c15d9
3
+ metadata.gz: ce7b8b9e8d97497e55efda115c2eb79922dbe1dc08eda69934ca3dfd8b6129de
4
+ data.tar.gz: d5c9313c2fa4ff0b1a359b68eba7292597770f979accb96434131ec796c336ef
5
5
  SHA512:
6
- metadata.gz: e77214ca32ba81f1c2fb1ab82db1fde7bb3eab69138c35a27dca836be4ffcf1d56a675e65a8064d528ab886eaec1a62c81dce9523ecf6a1069de68123d9fc765
7
- data.tar.gz: 2e2a359920ae13c4593a50d8f71607f86f80878a0b947e8b88374f37f1291b571e0eab7a57296dbbe3cf7e3000d86fadbdda410e7c805f9fb697c72e72e6611a
6
+ metadata.gz: 8ca365cd2935f8c90ded2c90fb0cb7da35f76e13489aae9b38086ba30a5da870804109fb06cd680f53c2fb28d1fb80c4b2eb2ba9dc7bcff8df81be50006f1f17
7
+ data.tar.gz: d81e12c54779a18d3b9ca1bc8f6dce93c628d472698114e20e4d31dc1066396dc53d3871f49f276f26f029da82f1ea020defe46969897d726360fcc4cce146f3
@@ -37,7 +37,7 @@ module PrismicRails
37
37
  # Returns the Prismic::API Object or nil if prismic.io is down
38
38
  def self.api
39
39
  begin
40
- @api = Prismic.api(self.config.url, self.config.token)
40
+ Prismic.api(self.config.url, self.config.token)
41
41
  rescue Prismic::API::PrismicWSConnectionError,
42
42
  Prismic::API::BadPrismicResponseError,
43
43
  Prismic::API::PrismicWSAuthError,
@@ -62,15 +62,15 @@ module PrismicRails
62
62
  PrismicRails.config.caching
63
63
  end
64
64
 
65
- # Get the master ref out of the rails cache if prismic is not available
65
+ # Get the last cached master ref out of the rails cache if prismic is not available
66
66
  def self.get_cached_ref
67
- if api.nil?
68
- @ref = Rails.cache.fetch('prismic_rails_ref')
69
- else
70
- master_ref = get_ref
71
- Rails.cache.write('prismic_rails_ref', master_ref)
72
- @ref = master_ref
73
- end
67
+ master_ref = get_ref
68
+ Rails.cache.write('prismic_rails_ref', master_ref)
69
+ master_ref
70
+ rescue NoPrismicAPIConnection
71
+ cached_ref = Rails.cache.fetch('prismic_rails_ref')
72
+ raise NoPrismicAPIConnection if cached_ref.nil?
73
+ cached_ref
74
74
  end
75
75
 
76
76
  # Get the master ref from the Prismic::API object
@@ -1,5 +1,5 @@
1
1
  # :nodoc:
2
2
  module PrismicRails
3
3
  # :nodoc:
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.2"
5
5
  end
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prismic_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Langenegger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2020-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prismic.io
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
- - - "~>"
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.5'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.5'
30
- - - "~>"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.5'
33
33
  - !ruby/object:Gem::Dependency
@@ -90,40 +90,40 @@ dependencies:
90
90
  name: rdoc
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: '5.1'
96
- - - "~>"
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '5.1'
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
105
  version: '5.1'
106
- - - "~>"
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '5.1'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: vcr
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ">="
113
+ - - "~>"
114
114
  - !ruby/object:Gem::Version
115
115
  version: 3.0.3
116
- - - "~>"
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: 3.0.3
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: 3.0.3
126
- - - "~>"
126
+ - - ">="
127
127
  - !ruby/object:Gem::Version
128
128
  version: 3.0.3
129
129
  - !ruby/object:Gem::Dependency
@@ -251,7 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  - !ruby/object:Gem::Version
252
252
  version: '0'
253
253
  requirements: []
254
- rubygems_version: 3.0.3
254
+ rubyforge_project:
255
+ rubygems_version: 2.7.6
255
256
  signing_key:
256
257
  specification_version: 4
257
258
  summary: PrismicRails provides rails view helpers to query prismic.io.