bifrost-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/bifrost-client.gemspec +1 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/lib/bifrost/client.rb +2 -2
- data/lib/bifrost/client/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ad06c57701c03134c8e27053d76423bce2be19016dd54b67342976ba93b41d7
|
4
|
+
data.tar.gz: a04a78603b1d759d8a4f5266c00673d07a71335d7d0e51c1fd24bd22308be2ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e0d57e6c16576ea65c646b6a79b604f64a14da074ff18e254b804de503315de2ae6d210690a74f79b7d5fd8d05eaa8896f5a417e5e09e18a3c449c0d6af609c
|
7
|
+
data.tar.gz: 1bad75eb3c3f69cf376e70b683ff733a372d449d1f4d60deb060659200fb478d61152c4f57ed05d2d4fc99f4f8b8ecd4149fbfba0d28a64a2b96de3071740654
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Bifrost Ruby Client
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/alternatelabs/bifrost-ruby-client.svg?branch=master)](https://travis-ci.org/alternatelabs/bifrost-ruby-client)
|
4
|
+
|
5
|
+
A ruby client library for the [bifrost crystal](https://github.com/alternatelabs/bifrost) websockets server.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
data/bifrost-client.gemspec
CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Bifrost::Client::VERSION
|
9
9
|
spec.authors = ["Pete Hawkins"]
|
10
10
|
spec.email = ["pete@alternatelabs.co"]
|
11
|
+
spec.metadata = { "source_code_uri" => "https://github.com/alternatelabs/bifrost-ruby-client" }
|
11
12
|
|
12
13
|
spec.summary = %q{Ruby client library for the bifrost crystal websocket server}
|
13
14
|
spec.description = %q{Bifrost is a crystal websocket server, this is a client library to simplify broadcasting messages to it.}
|
data/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/lib/bifrost/client.rb
CHANGED
@@ -19,7 +19,7 @@ module Bifrost
|
|
19
19
|
event: event,
|
20
20
|
data: data
|
21
21
|
},
|
22
|
-
exp: Time.now.to_i +
|
22
|
+
exp: Time.now.to_i + 60
|
23
23
|
}
|
24
24
|
jwt = JWT.encode(data, jwt_secret, "HS512")
|
25
25
|
uri = URI.parse(bifrost_server_url)
|
@@ -41,7 +41,7 @@ module Bifrost
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def token_for(channels:)
|
44
|
-
payload = { channels: channels }
|
44
|
+
payload = { channels: channels, exp: Time.now.to_i + 60 }
|
45
45
|
JWT.encode(payload, jwt_secret, "HS512")
|
46
46
|
end
|
47
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bifrost-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Hawkins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -98,13 +98,16 @@ files:
|
|
98
98
|
- Rakefile
|
99
99
|
- bifrost-client.gemspec
|
100
100
|
- bin/console
|
101
|
+
- bin/rake
|
102
|
+
- bin/rspec
|
101
103
|
- bin/setup
|
102
104
|
- lib/bifrost/client.rb
|
103
105
|
- lib/bifrost/client/version.rb
|
104
106
|
homepage: https://github.com/alternatelabs/bifrost
|
105
107
|
licenses:
|
106
108
|
- MIT
|
107
|
-
metadata:
|
109
|
+
metadata:
|
110
|
+
source_code_uri: https://github.com/alternatelabs/bifrost-ruby-client
|
108
111
|
post_install_message:
|
109
112
|
rdoc_options: []
|
110
113
|
require_paths:
|