From f2ba3f91746c3486253e236237c70193c3d41ad0 Mon Sep 17 00:00:00 2001 From: "Ryo Yoneyama (@yulii)" Date: Tue, 6 Dec 2016 11:23:37 +0900 Subject: [PATCH] =?UTF-8?q?lgtm=20=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - scripts/chart.coffee | 2 +- scripts/lgtm.coffee | 4 ++-- test/lgtm_test.coffee | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 441ef9f..c876086 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ }, "dependencies": { "aws-sdk": "^2.0.23", - "chart.js": "^2.2.2", "cheerio": "^0.22.0", "githubot": "^1.0.0-beta2", "hubot": ">= 2.6.0 < 3.0.0", diff --git a/scripts/chart.coffee b/scripts/chart.coffee index 1b5b13d..2b7c5b5 100644 --- a/scripts/chart.coffee +++ b/scripts/chart.coffee @@ -11,7 +11,7 @@ # path = require('path') # ChartImage = require('../module/chart_image') # -# module.exports = (robot) -> +module.exports = (robot) -> # # robot.helper = # url: () -> diff --git a/scripts/lgtm.coffee b/scripts/lgtm.coffee index ee91029..5f7c243 100644 --- a/scripts/lgtm.coffee +++ b/scripts/lgtm.coffee @@ -12,11 +12,11 @@ cheerio = require('cheerio') module.exports = (robot) -> # Looks good to me! - robot.hear /lgtm/i, (msg) -> + robot.respond /lgtm/i, (msg) -> robot.http("http://www.lgtm.in/g") .get() (err, res, body) -> if res.statusCode is 302 - robot.http(res.headers.location) + robot.http(res.headers.location, { rejectUnauthorized: false }) .get() (err, res, body) -> $ = cheerio.load(body) msg.send $('#imageUrl').attr('value') diff --git a/test/lgtm_test.coffee b/test/lgtm_test.coffee index 88c2e83..c6f4f2d 100644 --- a/test/lgtm_test.coffee +++ b/test/lgtm_test.coffee @@ -1,10 +1,10 @@ source = '../scripts/lgtm' expect = require('chai').expect -Robot = require('hubot/src/robot') +Robot = require('hubot/src/robot') TextMessage = require('hubot/src/message').TextMessage -describe 'lgtm', -> +describe 'lgtm', -> robot = null user = null adapter = null @@ -31,7 +31,7 @@ describe 'lgtm', -> catch e done e - adapter.receive(new TextMessage(user, 'lgtm')) + adapter.receive(new TextMessage(user, 'hubot lgtm')) it 'should respond to a tiqav image', (done) -> adapter.on 'send', (envelope, strings) ->