mn_utils_gem 1.15.5 → 1.15.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cb2242c85a59f5121267a32bf9780e98031b9528bf8ffb8ca95d61f07c7adfd
4
- data.tar.gz: e707f6c3e714907f537f7a9273ed0f6f012c6fa33ec872a22e58c55b9e8d608e
3
+ metadata.gz: 34ccf6b962ba9d0c600c9c382909d963c90c974b3917ade3bfdfe8400f485958
4
+ data.tar.gz: e18cec25d4609bd243bcc6dbc77365be5ba6697ac2219c4060307c24d03691dc
5
5
  SHA512:
6
- metadata.gz: 3f234616bd84ec8c81aad94d790049406d087b7c59c772127e8a7dd73c24511eb3660b81c3be5b47d9514ffff39f4485e7fba1c1b89f90596c8bec72ba9eec40
7
- data.tar.gz: 172c9cd714f9c18ed0266698aa6005867ae16e5459a1851272d158efab6bba3328f15e49a67954305714a44a8866541f0f6faf4c113b876a5b8ed5b28872f30e
6
+ metadata.gz: 716223af250d3b715100dd0eae29d5111d1f06ef292077b90d229ba832ebee4afe4525c028df20c4ea17c10636ed2e14c76d9a4dbe51762e238e6124c8cd366a
7
+ data.tar.gz: c6b4481774032e00d0059543949a6e7a8d30fe9d831af7165acb63b47884d2d7cd89e41af31412e37465e1af0b25388bb102d5c6a34087b46793228cd15b2eef
@@ -81,7 +81,7 @@ module MnUtilsAuth
81
81
  def redis_server
82
82
  @redis_server ||= Redis.new(
83
83
  url: ENV['MN_REDIS_URL'],
84
- ssl: ENV['MN_REDIS_SSL'].to_bool,
84
+ ssl: string_to_bool(ENV['MN_REDIS_SSL']),
85
85
  semian: {
86
86
  name: 'user-service',
87
87
  tickets: 4,
@@ -100,5 +100,11 @@ module MnUtilsAuth
100
100
  "#{SSO_COOKIE_VALUE_PREFIX}#{SecureRandom.uuid}"
101
101
  end
102
102
 
103
+ def string_to_bool(s)
104
+ return true if s =~ (/^(true|t|yes|y|1)$/i)
105
+ return false if s.empty? || s =~ (/^(false|f|no|n|0)$/i)
106
+
107
+ raise ArgumentError.new "invalid value: #{s}"
108
+ end
103
109
  end
104
110
  end
@@ -1,3 +1,3 @@
1
1
  module MnUtilsGem
2
- VERSION = "1.15.5"
2
+ VERSION = "1.15.6"
3
3
  end
data/lib/mn_utils_gem.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "mn_utils_gem/version"
2
- require "mn_utils_gem/string_to_bool"
3
2
  require "mn_utils_gem/site_action"
4
3
  require "mn_utils_gem/gui"
5
4
  require "mn_utils_gem/transactional_email"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mn_utils_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.5
4
+ version: 1.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shamim Mirzai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-01 00:00:00.000000000 Z
11
+ date: 2019-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gelf
@@ -174,7 +174,6 @@ files:
174
174
  - lib/mn_utils_gem/gui.rb
175
175
  - lib/mn_utils_gem/site_action.rb
176
176
  - lib/mn_utils_gem/sso.rb
177
- - lib/mn_utils_gem/string_to_bool.rb
178
177
  - lib/mn_utils_gem/transactional_email.rb
179
178
  - lib/mn_utils_gem/version.rb
180
179
  homepage: https://github.com/mumsnet/mn_utils_gem
@@ -1,8 +0,0 @@
1
- class String
2
- def to_bool
3
- return true if self =~ (/^(true|t|yes|y|1)$/i)
4
- return false if self.empty? || self =~ (/^(false|f|no|n|0)$/i)
5
-
6
- raise ArgumentError.new "invalid value: #{self}"
7
- end
8
- end