Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 5a7111b

Browse files
Add deprecation more deprecation calls, based on current replacements.json
1 parent 5fda766 commit 5a7111b

21 files changed

+95
-20
lines changed

src/hubot-scripts.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HubotScripts.deprecate = (robot, filename) ->
2222

2323
replacement = replacements[filename]
2424
if replacement
25-
robot.logger.warning "#{filename} has moved to its own package. Remove it from your hubot-scripts.json and see #{replacement} for how to install the new version"
25+
robot.logger.warning "#{filename} in hubot-scripts.json has moved to its own package. Remove it from hubot-scripts.json and see #{replacement} for how to install the new version"
2626
deprecatedScriptsUsed.push(filename)
2727

2828
module.exports = HubotScripts

src/scripts/9gag.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
# hubot 9gag me - Returns a random meme image
1313
#
1414
# Author:
15-
# EnriqueVidal
15+
# EnriqueVidal
1616
#
1717
# Contributors:
1818
# dedeibel (gif support)
1919

2020
Path = require("path")
2121
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
22+
2223
Select = require( "soupselect" ).select
2324
HTMLParser = require "htmlparser"
2425

src/scripts/ambush.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
# Author:
1414
# jmoses
1515

16+
Path = require("path")
17+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
18+
1619
appendAmbush = (data, toUser, fromUser, message) ->
1720
data[toUser.name] or= []
1821

1922
data[toUser.name].push [fromUser.name, message]
2023

2124
module.exports = (robot) ->
22-
23-
robot.logger.warning "ambush.coffee has moved from hubot-scripts to its own package. See https://github.com/hubot-scripts/hubot-ambush installation instructions"
25+
HubotScripts.deprecate(robot, __filename)
2426

2527
robot.brain.on 'loaded', =>
2628
robot.brain.data.ambushes ||= {}

src/scripts/asana.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
# abh1nav
2424
# rajiv
2525

26+
Path = require("path")
27+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
28+
2629
url = 'https://app.asana.com/api/1.0'
2730

2831
workspace = process.env.HUBOT_ASANA_WORKSPACE_ID
2932
project = process.env.HUBOT_ASANA_PROJECT_ID
3033
api_key = process.env.HUBOT_ASANA_API_KEY
3134

32-
3335
getRequest = (msg, path, callback) ->
3436
msg.http("#{url}#{path}")
3537
.headers("Accept": "application/json")
@@ -64,6 +66,7 @@ addTask = (msg, taskName, path, params, userAcct) ->
6466
msg.send "Error creating task."
6567

6668
module.exports = (robot) ->
69+
HubotScripts.deprecate(robot, __filename)
6770
# Add a task
6871
robot.hear /^(todo|task):\s?(@\w+)?(.*)/i, (msg) ->
6972
taskName = msg.match[3]

src/scripts/auth.coffee

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@
2424
# Author:
2525
# alexwilliamsca
2626

27+
Path = require("path")
28+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
29+
2730
module.exports = (robot) ->
28-
robot.logger.warning "auth.coffee has moved from hubot-scripts to its own package. See https://github.com/hubot-scripts/hubot-auth installation instructions"
31+
HubotScripts.deprecate(robot, __filename)
2932

3033
admin = process.env.HUBOT_AUTH_ADMIN
3134

@@ -34,7 +37,7 @@ module.exports = (robot) ->
3437
user = robot.brain.userForName(name)
3538
if user? and user.roles?
3639
if role in user.roles then return true
37-
40+
3841
return false
3942

4043
robot.Auth = new Auth
@@ -48,7 +51,7 @@ module.exports = (robot) ->
4851
if !user?
4952
msg.reply "#{name} does not exist"
5053
return
51-
54+
5255
user.roles = user.roles or [ ]
5356

5457
if newRole in user.roles
@@ -71,7 +74,7 @@ module.exports = (robot) ->
7174
if !user?
7275
msg.reply "#{name} does not exist"
7376
return
74-
77+
7578
user.roles = user.roles or [ ]
7679
if newRole == 'admin'
7780
msg.reply "Sorry, the 'admin' role can only be removed from the HUBOT_AUTH_ADMIN env variable."
@@ -88,7 +91,7 @@ module.exports = (robot) ->
8891
if !user?
8992
msg.reply "#{name} does not exist"
9093
return
91-
94+
9295
user.roles = user.roles or [ ]
9396

9497
if name.toLowerCase() in admin.toLowerCase().split(',') then isAdmin = ' and is also an admin' else isAdmin = ''

src/scripts/darksky.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
#
1919
# Author:
2020
# kyleslattery
21+
Path = require("path")
22+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
23+
2124
module.exports = (robot) ->
25+
HubotScripts.deprecate(robot, __filename)
26+
2227
robot.respond /weather ?(.+)?/i, (msg) ->
2328
location = msg.match[1] || process.env.HUBOT_DARK_SKY_DEFAULT_LOCATION
2429
return if not location

src/scripts/factoid.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# Author:
2323
# arthurkalm
2424

25+
Path = require("path")
26+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
27+
2528
class Factoids
2629
constructor: (@robot) ->
2730
@robot.brain.on 'loaded', =>
@@ -90,6 +93,8 @@ class Factoids
9093
this.niceGet match[1]
9194

9295
module.exports = (robot) ->
96+
HubotScripts.deprecate(robot, __filename)
97+
9398
factoids = new Factoids robot
9499

95100
robot.hear /^~(.+)/i, (msg) ->

src/scripts/gitlab.coffee

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@
2525
# Author:
2626
# omribahumi
2727

28-
url = require 'url'
29-
querystring = require 'querystring'
28+
path = require("path")
29+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
30+
url = require 'url'
31+
querystring = require 'querystring'
3032

3133
module.exports = (robot) ->
34+
HubotScripts.deprecate(robot, __filename)
35+
3236
gitlabChannel = process.env.GITLAB_CHANNEL or "#gitlab"
3337
debug = process.env.GITLAB_DEBUG?
3438

@@ -102,4 +106,3 @@ module.exports = (robot) ->
102106
robot.router.post "/gitlab/web", (req, res) ->
103107
handler "web", req, res
104108
res.end ""
105-

src/scripts/google.coffee

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Description:
22
# Returns the URL of the first google hit for a query
3-
#
3+
#
44
# Dependencies:
55
# None
66
#
@@ -13,7 +13,12 @@
1313
# Author:
1414
# searls
1515

16+
Path = require("path")
17+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
18+
1619
module.exports = (robot) ->
20+
HubotScripts.deprecate(robot, __filename)
21+
1722
robot.respond /(google)( me)? (.*)/i, (msg) ->
1823
googleMe msg, msg.match[3], (url) ->
1924
msg.send url

src/scripts/isup.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
# Author:
1414
# jmhobbs
1515

16+
Path = require("path")
17+
HubotScripts = require(Path.resolve(__dirname, "..", "hubot-scripts"))
18+
19+
1620
module.exports = (robot) ->
21+
HubotScripts.deprecate(robot, __filename)
22+
1723
robot.respond /is (?:http\:\/\/)?(.*?) (up|down)(\?)?/i, (msg) ->
1824
isUp msg, msg.match[1], (domain) ->
1925
msg.send domain

0 commit comments

Comments
 (0)