zulip-client 0.2.4 → 0.2.5

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
- SHA1:
3
- metadata.gz: b2a0f70cc2bfc6b9d1fa3c4fa2d85694f38a6d0a
4
- data.tar.gz: 50146fdfb9988b66c179fd395845bbfefffb1e25
2
+ SHA256:
3
+ metadata.gz: d7b4e75f20a52abd6bcfb87eda7b6e1e597df088c551ef7abc626566136a82ec
4
+ data.tar.gz: fb9b56c59cfb1ecbedf8f9bd3665fe43284c2ab31ecf7d651d0d8aae350488da
5
5
  SHA512:
6
- metadata.gz: 68960c5d615390252a3b8a6c47c2f858c5d5545c12380ed583aa25f5ee703c786815c33156abd59a4b945c937722ef36bbfb72aa3ebb190eaddba69427b748b2
7
- data.tar.gz: e958e0b176209251144d1e9ed51ba6f40ee300277ee07e3690eb95c2e43a909a916ad95f51fc7415f14b233e90a038ee9267528ec05c2764cabdc0d3bb9ae145
6
+ metadata.gz: 87f18f4aa19495aea351bd184997d1af17307a76512c34cc0d6e8a0260aeb5b50bb47600bd78a3f443911412740180d68b55621c7834cac4294f05bde579ff60
7
+ data.tar.gz: e7106ee39c047ea525ee916d52e376da09237f6e7d5f50e7ff05b5d2a76b11e4b8ad636e788367cfe57a72f3e26eaebc8b26cc4defb328488d9c8d74a77ba8bb
@@ -1,10 +1,10 @@
1
1
  sudo: false
2
2
 
3
3
  rvm:
4
- - 2.4.1
5
- - 2.3.4
4
+ - 2.5.0
5
+ - 2.4.3
6
+ - 2.3
6
7
  - 2.2
7
- - 2.1
8
8
 
9
9
  before_install:
10
10
  - gem update bundler
data/README.md CHANGED
@@ -25,7 +25,7 @@ Send message to stream:
25
25
  ```ruby
26
26
  client = Zulip::Client.new(site: "https://zulip.example.com/",
27
27
  username: "test-bot@zulip.example.com",
28
- api_token: "xxxxxxxxxxxxx")
28
+ api_key: "xxxxxxxxxxxxx")
29
29
  client.send_message(type: :stream, to: "general", subject: "projects", content: "Hello, Zulip!")
30
30
  ```
31
31
 
@@ -10,12 +10,17 @@ Faraday.default_adapter = :typhoeus
10
10
 
11
11
  module Zulip
12
12
  class Client
13
+ DEFAULT_OPEN_TIMEOUT = 30
14
+ DEFAULT_TIMEOUT = 90
15
+
13
16
  attr_accessor :debug
14
17
 
15
18
  def initialize(site:, username:, api_key:, **options)
16
19
  @site = URI.parse(site)
17
20
  @connection = Faraday.new(@site.to_s, options) do |faraday|
18
21
  faraday.adapter Faraday.default_adapter
22
+ faraday.options[:open_timeout] ||= DEFAULT_OPEN_TIMEOUT
23
+ faraday.options[:timeout] ||= DEFAULT_TIMEOUT
19
24
  yield faraday if block_given?
20
25
  end
21
26
  @connection.basic_auth(username, api_key)
@@ -84,13 +89,11 @@ module Zulip
84
89
  queue_id, last_event_id = register(event_types: event_types, narrow: narrow)
85
90
  loop do
86
91
  break unless @running
87
- response = nil
88
- @connection.in_parallel do
89
- response = @connection.get do |request|
90
- request.url("/api/v1/events")
91
- request.params["queue_id"] = queue_id
92
- request.params["last_event_id"] = last_event_id
93
- end
92
+
93
+ response = @connection.get do |request|
94
+ request.url("/api/v1/events")
95
+ request.params["queue_id"] = queue_id
96
+ request.params["last_event_id"] = last_event_id
94
97
  end
95
98
 
96
99
  if response.success?
@@ -107,7 +110,7 @@ module Zulip
107
110
  when 400..499
108
111
  raise Zulip::ResponseError, response.reason_phrase
109
112
  when 500..599
110
- puts "Rtrying..."
113
+ puts "Retrying..."
111
114
  sleep 1
112
115
  end
113
116
  end
@@ -1,5 +1,5 @@
1
1
  module Zulip
2
2
  class Client
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Zulip client for Ruby"
12
12
  spec.description = "Zulip client for Ruby"
13
- spec.homepage = "https://github.com/okkez/zulip-client-ruby"
13
+ spec.homepage = "https://github.com/okkez/ruby-zulip-client"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zulip-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - okkez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-14 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -111,7 +111,7 @@ files:
111
111
  - lib/zulip/client/version.rb
112
112
  - lib/zulip/error.rb
113
113
  - zulip-client.gemspec
114
- homepage: https://github.com/okkez/zulip-client-ruby
114
+ homepage: https://github.com/okkez/ruby-zulip-client
115
115
  licenses:
116
116
  - MIT
117
117
  metadata: {}
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.6.11
134
+ rubygems_version: 2.7.6
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Zulip client for Ruby