ndb-rails 1.17.2 → 1.18.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 +4 -4
- data/lib/ndb/rails/configuration.rb +5 -0
- data/lib/ndb/rails/version.rb +1 -1
- data/lib/ndb/rails.rb +14 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62c5d5a045dcda1a06017975d002111b3258b6ef563545ff9243b79d150f6a23
|
|
4
|
+
data.tar.gz: 9c28b01fd0a158a653d158d2b36f6b92bf03ad65a56687cb631e35e3fc29e219
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d26232f14d6d4ca6bbe4b669c1bb8a955d221821ab56710b248d3c4daa3617ee1264f5a4bac266d322e5d0db5bfb3c1cd0093d58221e9ca5d72fbc622e3afd29
|
|
7
|
+
data.tar.gz: ce9a71bc13929a768fc1fab57b017e1e8024085660359c4906137c8743bdedfe66606a659c1124afc6e6cb8143c9ce7552fa12990c5369bb3408571c2010e730
|
|
@@ -15,6 +15,10 @@ module Ndb
|
|
|
15
15
|
# ("test2_" for a parallel test worker). nil by default.
|
|
16
16
|
attr_accessor :collection_prefix
|
|
17
17
|
|
|
18
|
+
# user_agent is the token of the app (for example "myapp/1.2"). It goes
|
|
19
|
+
# at the end of the User-Agent of every request. nil by default.
|
|
20
|
+
attr_accessor :user_agent
|
|
21
|
+
|
|
18
22
|
# The `streams:` block of config/ndb.yml, for `ndb streams`:
|
|
19
23
|
# "concurrency" (the threads of each consumer class) and "only" (the
|
|
20
24
|
# names of the classes to run).
|
|
@@ -38,6 +42,7 @@ module Ndb
|
|
|
38
42
|
@timeout = settings["timeout"] if settings.key?("timeout")
|
|
39
43
|
@pool_size = settings["pool_size"] if settings.key?("pool_size")
|
|
40
44
|
@ready_timeout = settings["ready_timeout"] if settings.key?("ready_timeout")
|
|
45
|
+
@user_agent = settings["user_agent"] if settings.key?("user_agent")
|
|
41
46
|
@streams = settings["streams"] if settings["streams"].is_a?(Hash)
|
|
42
47
|
|
|
43
48
|
self
|
data/lib/ndb/rails/version.rb
CHANGED
data/lib/ndb/rails.rb
CHANGED
|
@@ -41,9 +41,22 @@ module Ndb
|
|
|
41
41
|
token: configuration.token,
|
|
42
42
|
timeout: configuration.timeout,
|
|
43
43
|
pool_size: configuration.pool_size,
|
|
44
|
-
ready_timeout: configuration.ready_timeout
|
|
44
|
+
ready_timeout: configuration.ready_timeout,
|
|
45
|
+
user_agent: user_agent
|
|
45
46
|
)
|
|
46
47
|
end
|
|
48
|
+
|
|
49
|
+
# The tokens that go after the User-Agent of the ndb gem: this gem,
|
|
50
|
+
# the Rails version when Rails is loaded, then the token of the app
|
|
51
|
+
# (config user_agent).
|
|
52
|
+
def user_agent
|
|
53
|
+
tokens = ["ndb-rails/#{VERSION}"]
|
|
54
|
+
|
|
55
|
+
tokens << "rails/#{::Rails.version}" if defined?(::Rails) && ::Rails.respond_to?(:version)
|
|
56
|
+
tokens << configuration.user_agent.to_s.strip
|
|
57
|
+
|
|
58
|
+
tokens.reject(&:empty?).join(" ")
|
|
59
|
+
end
|
|
47
60
|
end
|
|
48
61
|
end
|
|
49
62
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ndb-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thadeu
|
|
@@ -43,7 +43,7 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 1.
|
|
46
|
+
version: 1.18.0
|
|
47
47
|
- - "<"
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
49
|
version: '2'
|
|
@@ -53,7 +53,7 @@ dependencies:
|
|
|
53
53
|
requirements:
|
|
54
54
|
- - ">="
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: 1.
|
|
56
|
+
version: 1.18.0
|
|
57
57
|
- - "<"
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '2'
|