firefighter 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/firefighter/realtime_database.rb +11 -3
- data/lib/firefighter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b94b5878f703b6332b33493fe3c09ed2b9860a8d402952ce91fd047640ee67
|
4
|
+
data.tar.gz: 586bb23666589a122d0722b9772e0d850d27fca12c49eb9ddf70ffd52cc47c3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ba9000e62c3baf013389f774faee390fff31fce12deb119e53d269ff300a7630ac20a10c1de2badb4b9936c24db602b6d13a336c98f017210b25dfda72156b0
|
7
|
+
data.tar.gz: 356363578224f2e8a95959a7f3a4ce1d770f0f74abd9e13ecbb645950db304fe8c2acaeacde444d6b9e34fcf1aa8b40297d03b191701cc63af1d6e96e1ebf02a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -45,6 +45,8 @@ account = identitytoolkit.verify_password('test@test.de', 'totalgeheimespasswort
|
|
45
45
|
# from_env uses environment variables:
|
46
46
|
# - FIREBASE_WEB_DB_NAME
|
47
47
|
# - FIREBASE_WEB_DB_SECRET
|
48
|
+
# - FIREBASE_WEB_DB_HOST (defaults to host for us-central1)
|
49
|
+
|
48
50
|
realtime_database = Firefighter::RealtimeDatabase.from_env
|
49
51
|
|
50
52
|
realtime_database.write("some-path/key", {some: 'data'})
|
@@ -5,13 +5,21 @@ module Firefighter
|
|
5
5
|
def self.from_env
|
6
6
|
new(
|
7
7
|
db_name: ENV['FIREBASE_WEB_DB_NAME'],
|
8
|
-
db_secret: ENV['FIREBASE_WEB_DB_SECRET']
|
8
|
+
db_secret: ENV['FIREBASE_WEB_DB_SECRET'],
|
9
|
+
db_host: ENV['FIREBASE_WEB_DB_HOST'] || DEFAULT_DB_HOST,
|
9
10
|
)
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
+
DB_HOSTS = {
|
14
|
+
'us-central1' => 'firebaseio.com',
|
15
|
+
'europe-west1' => 'europe-west1.firebasedatabase.app',
|
16
|
+
}
|
17
|
+
DEFAULT_DB_HOST = DB_HOSTS['us-central1']
|
18
|
+
|
19
|
+
def initialize(db_name:, db_secret:, db_host: DEFAULT_DB_HOST)
|
13
20
|
@db_name = db_name
|
14
21
|
@db_secret = db_secret
|
22
|
+
@db_host = db_host
|
15
23
|
end
|
16
24
|
|
17
25
|
def listen(path)
|
@@ -45,7 +53,7 @@ module Firefighter
|
|
45
53
|
private
|
46
54
|
|
47
55
|
def endpoint(path)
|
48
|
-
"https://#{@db_name}
|
56
|
+
"https://#{@db_name}.#{@db_host}/#{path}.json?auth=#{@db_secret}"
|
49
57
|
end
|
50
58
|
end
|
51
59
|
end
|
data/lib/firefighter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firefighter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- phoet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|