castle-rb 1.2.12 → 1.2.13

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
  SHA1:
3
- metadata.gz: 31540e9160fdebfa32408ff4eb628d66735a44a9
4
- data.tar.gz: 86de8e3b76a4cfe72541a9932081bd42af13ab1e
3
+ metadata.gz: 1709b4da2a8474e4d61c66cb8e9bcd6051772d76
4
+ data.tar.gz: 22a86c01dd9714f2c1485f7b883abc3058e9e6b6
5
5
  SHA512:
6
- metadata.gz: 296f0c509c04e4f671ec62dac7329b972d494342437247875bcf76cacdf0e27c5f04da61017bcfadc18b8f98898423f0b807fcd35eb1f2af4187d0ead6506a0f
7
- data.tar.gz: 063acc0eb147a34c4b37a0fd3b3e69cbd52f3ed79bd5c80babb2f5ed28d7278be451e7a8162500f2b42d5df98b270923f8cd0bf611d9ef93a80170fa608160c2
6
+ metadata.gz: c4e308d7f1257f0698b6b7fbe71a725148c2a1624cfcd83e1d799737b2f046fd4ed892781866cb8ba08b8eb4f918b0480e128d7ce20cb08a351511b2845cabd4
7
+ data.tar.gz: 09cef947e6ed3d9e6009868a914b08513fe213edf4af2d76bd650d887db68433f933137626b78222d1bbe2e44a69a359a231e4123d9e4d1ff8b9f0bd1ad890d9
data/README.md CHANGED
@@ -50,5 +50,8 @@ Castle.configure do |config|
50
50
 
51
51
  # Castle::RequestError is raised when timing out (default: 30.0)
52
52
  config.request_timeout = 2.0
53
+
54
+ # For tracking in non-web environments: https://castle.io/docs/sources (default: 'web')
55
+ config.source_header = 'backend'
53
56
  end
54
57
  ```
@@ -21,6 +21,7 @@ module Castle
21
21
 
22
22
  class Configuration
23
23
  attr_accessor :request_timeout
24
+ attr_accessor :source_header
24
25
 
25
26
  def initialize
26
27
  self.request_timeout = 30.0
@@ -66,6 +66,11 @@ module Castle
66
66
  rescue # ignored
67
67
  end
68
68
 
69
+ if Castle.config.source_header
70
+ env[:request_headers]["X-Castle-Source"] =
71
+ Castle.config.source_header
72
+ end
73
+
69
74
  env[:request_headers]["User-Agent"] =
70
75
  "Castle/v1 RubyBindings/#{Castle::VERSION}"
71
76
 
@@ -1,3 +1,3 @@
1
1
  module Castle
2
- VERSION = "1.2.12"
2
+ VERSION = "1.2.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: castle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.12
4
+ version: 1.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan Brissmyr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-06 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: her