firebug 1.2.2 → 1.3.0

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: 47f730e5a45a44a96661d01fc4331f33103c9b306e5a910f5b9ec868f858d960
4
- data.tar.gz: 7ebbfa00cacbc730ee3a18666dd6a35b7212fb7baa9fcd9d24017cf28fd5fa8f
3
+ metadata.gz: 714b21952917ec17c9c58516e64193dcc2994d51b43edc7c6a4f7f97f1c93663
4
+ data.tar.gz: e2aed63c7816a652d3eb847e5559e0edeba49c3012745ccfe1b4f462d8e82381
5
5
  SHA512:
6
- metadata.gz: 35361b28047791b6d8f24cad802da7423dcb663f7fa2941f26d9f1fc7489074955b9604941eac1e5fd660305415c37b7ca5aac6c38d4df9d29d16d0d52ee8adc
7
- data.tar.gz: 863583e8e78b2f607b0802a77c6ed42a49ca3d646ae0420816cbe4d9bb5b73466ff9d03ef116cccd0ecc5faab8cbce2cd1e76fa35d92efbe92f8ffbe905fd6e1
6
+ metadata.gz: 3be45116cb8571164994368e7e14b49eed6c7680133b35efdb42d77c83ee0a2dc40b5b0c233626718fa36870c372930eff36376127cd87f8441bfe0f98849bf4
7
+ data.tar.gz: bfbe17e9d5c2deaabecc71fa1a167e3f9da84fd686a26ea659ba7aee38de1b4b7c8763431a5a0625e5c072e69084158312093a878d26bdbaba60882abab89508
@@ -158,8 +158,8 @@ module ActionDispatch # :nodoc:
158
158
  # @return [Hash]
159
159
  def find_by_params(req, sid)
160
160
  params = { session_id: sid }
161
- params[:ip_address] = req.remote_ip if Firebug.config.match_ip_address
162
- if Firebug.config.match_user_agent
161
+ params[:ip_address] = req.remote_ip if Firebug.config.match_ip_address.call(req)
162
+ if Firebug.config.match_user_agent.call(req)
163
163
  params[:user_agent] = Firebug.config.truncate_user_agent ? req.user_agent&.slice(0...120) : req.user_agent
164
164
  end
165
165
  params
@@ -9,9 +9,9 @@ module Firebug
9
9
  # The name of the sessions table.
10
10
  # @attr [Boolean] truncate_user_agent
11
11
  # Truncate the user-agent to 120 characters.
12
- # @attr [Boolean] match_user_agent
12
+ # @attr [Proc] match_user_agent
13
13
  # Use the user-agent in addition to the session ID.
14
- # @attr [Boolean] match_ip_address
14
+ # @attr [Proc] match_ip_address
15
15
  # Use the remote ip address in addition to the session ID.
16
16
  # @attr [Boolean] silence_logger
17
17
  # Silence ActiveRecord logs.
@@ -20,11 +20,11 @@ module Firebug
20
20
  # @see ActionDispatch::Session::CodeIgniterStore#commit_session?
21
21
  class Configuration
22
22
  attr_reader :table_name
23
+ attr_reader :match_user_agent
24
+ attr_reader :match_ip_address
23
25
 
24
26
  attr_accessor :key
25
27
  attr_accessor :truncate_user_agent
26
- attr_accessor :match_user_agent
27
- attr_accessor :match_ip_address
28
28
  attr_accessor :session_filter
29
29
  attr_accessor :silence_logger
30
30
 
@@ -37,6 +37,16 @@ module Firebug
37
37
  self.session_filter = ->(_) { true }
38
38
  end
39
39
 
40
+ # @param [Proc,Boolean] value
41
+ def match_user_agent=(value)
42
+ @match_user_agent = value.respond_to?(:call) ? value : ->(_) { value }
43
+ end
44
+
45
+ # @param [Proc,Boolean] value
46
+ def match_ip_address=(value)
47
+ @match_ip_address = value.respond_to?(:call) ? value : ->(_) { value }
48
+ end
49
+
40
50
  # Sets the table name for (see Firebug::Session)
41
51
  #
42
52
  # @param [String] value
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Firebug
4
4
  # The current version of Firebug
5
- VERSION = '1.2.2'
5
+ VERSION = '1.3.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Frase
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-03 00:00:00.000000000 Z
11
+ date: 2019-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack