lita-jls 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82fcfffe36fd74ada588e3e69026933c65307904
4
- data.tar.gz: e7e5e78740affb2ec4e9de2eec9345eb84f77da3
3
+ metadata.gz: d33db5680adf9952523d2cdb99cb4377733394e8
4
+ data.tar.gz: 94680838656ee32417342429dd18fb12c2c65954
5
5
  SHA512:
6
- metadata.gz: aab3bdc7a67337e64cac4acd57de18f70ba3713adc38915462dca2e60e85b97c41f95c40e8616763992e098d6d1c82b7fa7ce07ba80931a33f2cd026cf84397d
7
- data.tar.gz: 78b56db4fe290dd3ae558cdc3c84a3c0a99d0cc6fd54050c22de2fa83746c334191a697e25250462b730e0031ecfe0fab459edbb421ee01752eacfd3a86782f7
6
+ metadata.gz: a59cd31dbb1704432766b1b7364483f7f44df7e51ef898aed72e86f2af5a12cd19882cf70240f3cb8138bfede4eb72d0a8ae508187ed574384e64f57264a46be
7
+ data.tar.gz: fc80e8d6d5c85fd4ee630350a56e07e90ff949f76c456f2d31e071603b8eb3dd3abb29762c4efc6d7bbaed99400483fdc4672681ab9c8cfec25f1633934e52bf
@@ -40,19 +40,6 @@ module LitaJLS
40
40
  true
41
41
  end # cla?
42
42
 
43
- def logstash_team?(user)
44
- ["electrical",
45
- "jordansissel",
46
- "ph",
47
- "colinsurprenant",
48
- "jsvd",
49
- "untergeek",
50
- "talevy",
51
- "kurtado",
52
- "suyograo",
53
- "purbon"].include?(user.downcase)
54
- end
55
-
56
43
  # Clone a git url into a local path.
57
44
  #
58
45
  # This caches a remote git repo and performs a clone against that in
@@ -8,6 +8,7 @@ require "lita-jls/bot_builder"
8
8
  require "lita-jls/repository"
9
9
  require "lita-jls/github_url_parser"
10
10
  require "lita-jls/util"
11
+ require "faraday_middleware"
11
12
 
12
13
  # TODO(sissel): This code needs some suuuper serious refactoring and testing improvements.
13
14
  # TODO(sissel): Remove any usage of Rugged. This library requires compile-time
@@ -186,10 +187,10 @@ module Lita
186
187
  source_github_pr[:body] + "\nMoved from #{source_url}")
187
188
  end
188
189
 
189
- @private
190
190
  # downloads the patch file in mail format and saves it to a file
191
191
  def download_patch(pr_url, pr_num)
192
- http = Faraday.new("https://github.com")
192
+ http = http_conn
193
+
193
194
  response = http.get(URI.parse(pr_url).path)
194
195
  if response.status != 200
195
196
  raise "Unable to fetch pull request #{pr_url}"
@@ -208,7 +209,6 @@ module Lita
208
209
  return patch_file
209
210
  end
210
211
 
211
- @private
212
212
  def parse_github_url(url)
213
213
  github_parser = LitaJLS::GithubUrlParser.parse(url, :link => :repository)
214
214
  github_parser.validate!
@@ -251,7 +251,7 @@ module Lita
251
251
 
252
252
  # TODO(sissel): Fetch the PR patch
253
253
  logger.info("Fetching PR patch", :url => pr_url)
254
- http = Faraday.new("https://github.com")
254
+ http = http_conn
255
255
  response = http.get(URI.parse(pr_url).path)
256
256
  if !response.success?
257
257
  logger.warn("Failed fetching patch", :url => pr_url, :status => response.status, :headers => response.headers)
@@ -314,6 +314,13 @@ module Lita
314
314
  raise e
315
315
  end
316
316
  end
317
+
318
+ def http_conn
319
+ Faraday.new("https://github.com") do |conn|
320
+ conn.use FaradayMiddleware::FollowRedirects
321
+ conn.adapter :net_http
322
+ end
323
+ end
317
324
  end # class Jls
318
325
 
319
326
  Lita.register_handler(Jls)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-jls"
3
- spec.version = "0.0.11"
3
+ spec.version = "0.0.12"
4
4
  spec.authors = ["Jordan Sissel"]
5
5
  spec.email = ["jls@semicomplete.com"]
6
6
  spec.description = %q{Some stuff for the lita.io bot}
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.add_runtime_dependency "lita", ">= 3.3"
18
18
  spec.add_runtime_dependency "cabin", ">= 0"
19
19
  spec.add_runtime_dependency "faraday", ">= 0"
20
+ spec.add_runtime_dependency "faraday_middleware"
20
21
 
21
22
  # For access to Github's api
22
23
  spec.add_runtime_dependency "octokit", ">= 0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-jls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday_middleware
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: octokit
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -317,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
331
  version: '0'
318
332
  requirements: []
319
333
  rubyforge_project:
320
- rubygems_version: 2.4.3
334
+ rubygems_version: 2.2.2
321
335
  signing_key:
322
336
  specification_version: 4
323
337
  summary: Some stuff for the lita.io bot