lita-nashdev-resources 1.0.0 → 1.0.1

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: 5dd11bdd05560fad6d6b454a0b16ed36b1e05cc3
4
- data.tar.gz: d9dc1305312b96e34db90ba3f6b08cfcb8b255c5
3
+ metadata.gz: fcb3e9fe9eea5b5bdd32e73cae22a8ce848abf8d
4
+ data.tar.gz: 5ea7b46a6d04b4c72f507fb035643bfbfeb427ba
5
5
  SHA512:
6
- metadata.gz: 0c6f06a34ba6673dd2f476a6439902443160189a403d4d526eb348323f2542fba6e6b8c54891587914b801f62a4ef5f811e7c6e6ecb0b3f404451f5d1e9bc00d
7
- data.tar.gz: eae5af9948e34fb0021e5034630008ee281482ceb24d2b0d4cfa5d60eeef97b461c8ffc5291d2cd575a8175382a49a5384a4e2ca464d7e03585df0531d658354
6
+ metadata.gz: 1ee1394c4562f3752b01b53f04bf712da43be00e1a9dad7f54beeb8f8eceb4114e6c79cbef732f1854cc942a153f379d92761f05e91b7139bad30725b83dff2a
7
+ data.tar.gz: a5d87f301b993136f3b79de62d314f862adb2b3ab483ce83ba9d2f3931d3c18a925613a689c1b23ec46a1956ed9c12b5b3c1b45838f3f6edd20386f50d52e605
data/README.md CHANGED
@@ -16,6 +16,13 @@ gem "lita-nashdev-resources"
16
16
 
17
17
  Requires a `RESOURCE_ISSUE_TOKEN` config var to POST to issue to repo
18
18
 
19
+ example in `lita_config.rb` :
20
+ ```ruby
21
+ Lita.configure do |config|
22
+ config.handlers.nashdev_resources.issue_token = ENV['RESOURCE_ISSUE_TOKEN']
23
+ end
24
+ ```
25
+
19
26
  ## Usage
20
27
 
21
28
  ```
@@ -2,12 +2,15 @@ module Lita
2
2
  module Handlers
3
3
  class NashdevResources < Handler
4
4
  ISSUE_URL = URI.parse('https://api.github.com/repos/maxbeizer/nashdev-resources/issues').freeze
5
+ config :issue_token
5
6
 
6
7
  route(/resource(?: me)?\s+(.*)/, :handle_resource_request, command: true, help: {
7
8
  'resource me <link>' => 'creates an issue on the nashdev resources repo'
8
9
  })
9
10
 
10
11
  def handle_resource_request(response)
12
+ response.reply('You must set the RESOURCE_ISSUE_TOKEN in your lita_config.') unless !!config.issue_token
13
+
11
14
  resources = response.args.delete_if { |arg| arg == 'me' }
12
15
  data = build_json_for_request(response.user, resources)
13
16
  res = request_and_return_response(data)
@@ -26,7 +29,7 @@ module Lita
26
29
  'Content-Type' => 'application/json',
27
30
  'User-Agent' => 'maxbeizer',
28
31
  'Accept' => 'application/vnd.github.v3+json',
29
- 'Authorization' => "token #{ENV[RESOURCE_ISSUE_TOKEN]}"
32
+ 'Authorization' => "token #{config.issue_token}"
30
33
  })
31
34
  req.body = data
32
35
  https.request(req)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-nashdev-resources"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.0.1"
4
4
  spec.authors = ["max beizer"]
5
5
  spec.email = ["max.beizer@gmail.com"]
6
6
  spec.description = "A lita bot to suggest resources for NashDev resources"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-nashdev-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - max beizer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita