darjeelink 0.14.5 → 0.14.8

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: 11b58c6d79e63e250e80fccc4dc0ab8aa6e1daf8848e51e14afd9a3637a6dea2
4
- data.tar.gz: 2ab545a7e59ac4a248f773ead73aeb4e35b3937afd3ffb37b912a1c537c6c8ea
3
+ metadata.gz: fe18ade1a67f8f92f09f7e95ea71d8bb27bfe1ac9604be8dd4e62b0156b987b7
4
+ data.tar.gz: 616617118a3317479035593d85daeed19ad7b538ca27a54cd5a1861d2e80f631
5
5
  SHA512:
6
- metadata.gz: 92311cceed07587d5e2ba80c25849e1e7a39d4f7e37351482bd6eaa2d65b47bf712ff25600acae1b6508cab6ed65dc792cf9506b94093d8275005027e620bd75
7
- data.tar.gz: ed319fe3f5aaded52f783defcaedeb9efa2e199cf1a6e060cc23ad68318c872de5b95d49af7146ec4b2c0b2c9758e0afb493edf156c92dea947d8b61ccfcbdf1
6
+ metadata.gz: bebc83488bca28c7291c095d24b0ae3cacddf8a07e28fb2db332e99ed4dcc3b0236ff8b63c8dc70289af2e0203bd6fb59d004b8d463d8d2b2c47f8a04e385376
7
+ data.tar.gz: '088614333aa05239f7c819b5acbad2115fd6728a4245b5228c69e3cccc617f4ce541a1d898113ffa7c199847fa88ccb899128bbd93f849c9beae904ddce0a047'
data/README.md CHANGED
@@ -120,9 +120,11 @@ Change the database url to be different to the development one i.e. `postgres://
120
120
  ## Releasing
121
121
  Darjeelink follows [Semantic Versioning](https://semver.org)
122
122
 
123
+ NB: Before releasing, ensure that the gem is working as expected by running the tests. If possible perform some manual testing via a webserver.
124
+
123
125
  Once all necessary changes have made it in to master and you are ready to do a release you need to do these steps.
124
126
 
125
- Note that if you are running in a vagrant VM, most of these steps can be done from within the VM.
127
+ Note that if you are running in a vagrant VM or `docker-shell.sh` constainer, most of these steps can be done from the terminal session.
126
128
 
127
129
  - Update `lib/darjeelink/version.rb` to the new version
128
130
  - Run `bundle install` to pick up the change in Gemfile.lock
@@ -9,25 +9,27 @@ module Darjeelink
9
9
 
10
10
  private
11
11
 
12
- def determine_ip_to_verify
13
- if Rails.application.client_ip_header
14
- request.headers[Rails.application.client_ip_header]
15
- else
16
- request.ip
17
- end
18
- end
19
-
12
+ # Disabling these rubocop rules. This is a simple function and tested in production sinve version 0.14.4.
13
+ #
14
+ # rubocop:disable Metrics/AbcSize
15
+ # rubocop:disable Layout/LineLength
20
16
  # Check user IP address against whitelist from ENV
21
17
  def check_ip_whitelist
22
18
  return unless Rails.env.production?
23
19
  return unless Rails.application.config.permitted_ips
24
20
 
25
- ip_to_verify = determine_ip_to_verify
21
+ ip_to_verify = if Rails.application.config.respond_to?(:client_ip_header) && Rails.application.config.client_ip_header.present?
22
+ request.headers[Rails.application.config.client_ip_header]
23
+ else
24
+ request.ip
25
+ end
26
26
 
27
27
  return if Rails.application.config.permitted_ips.split(',').include? ip_to_verify
28
28
 
29
29
  render plain: 'Access Denied', status: :forbidden
30
30
  end
31
+ # rubocop:enable Metrics/AbcSize
32
+ # rubocop:enable Layout/LineLength
31
33
 
32
34
  # Authenticate against Google OAuth
33
35
  def authenticate
@@ -29,6 +29,7 @@ Darjeelink.configure do |config|
29
29
  'twitter-advert': 'Twitter advert',
30
30
  'twitter-tweet': 'Twitter tweet',
31
31
  'whatsapp-share': 'WhatsApp share',
32
+ 'what-action': 'WhatAction',
32
33
  youtube: 'Youtube',
33
34
  other: 'Other'
34
35
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Darjeelink
4
- VERSION = '0.14.5'
4
+ VERSION = '0.14.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darjeelink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.5
4
+ version: 0.14.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hulme
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth