lita-giphy 1.0.2 → 1.0.3

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
2
  SHA1:
3
- metadata.gz: 86ea46c25f687a28644e18f83b67d805a5736ef9
4
- data.tar.gz: b71b10e9deb0fbf27b5963bddf5c10d81bb7d4e3
3
+ metadata.gz: 3b6b7c2e3a99599278bc1ef3c98bdbff3cf7e520
4
+ data.tar.gz: 7f4027445bff0c5c637cd5c76e55f2f23bce7622
5
5
  SHA512:
6
- metadata.gz: 31bb69c1219dd225f27bcba0a8d9167036ec450af36e8e3134b2cf809759a940b4658295358d884e242fe3f1e9424a461bb2755abd09765d6fc44112db101383
7
- data.tar.gz: 250e95f7c4da3d7e3d41afd65761b1c53537d08926a46d2f0abcf2366e8bc8273447032be80421a6635647cfdb364ca06a58ba9fa1bf2b6716c24b0e742f767d
6
+ metadata.gz: af796c81a8f3d9d86a6cad07faeb8c14a676519071519d5056a62126acd0243f9c7cc6ba83bd2936cbd9fffefe59c74514a346b4cf4ed7477d2007a420a17be5
7
+ data.tar.gz: abff1a3b4a3a3f379ea18d0e532e250652f7653354ea92c7950f2f97b15621b7d3ddd25c263fe6c5e134b2bd4b88f6fcefb510be93829b50d883b94da7cea9a4
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lita-giphy (1.0.1)
5
- lita (~> 3.0)
4
+ lita-giphy (1.0.2)
5
+ lita (>= 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -13,9 +13,9 @@ GEM
13
13
  http_router (0.11.1)
14
14
  rack (>= 1.0.0)
15
15
  url_mount (~> 0.2.1)
16
- i18n (0.6.9)
17
- ice_nine (0.11.0)
18
- lita (3.0.2)
16
+ i18n (0.6.11)
17
+ ice_nine (0.11.1)
18
+ lita (4.0.4)
19
19
  bundler (>= 1.3)
20
20
  faraday (>= 0.8.7)
21
21
  http_router (>= 0.11.1)
@@ -24,17 +24,19 @@ GEM
24
24
  multi_json (>= 1.7.7)
25
25
  puma (>= 2.7.1)
26
26
  rack (>= 1.5.2)
27
+ rb-readline (>= 0.5.1)
27
28
  redis-namespace (>= 1.3.0)
28
29
  thor (>= 0.18.1)
29
- multi_json (1.8.4)
30
+ multi_json (1.10.1)
30
31
  multipart-post (2.0.0)
31
- puma (2.7.1)
32
+ puma (2.10.2)
32
33
  rack (>= 1.1, < 2.0)
33
34
  rack (1.5.2)
34
35
  rake (10.1.0)
35
- redis (3.0.7)
36
- redis-namespace (1.4.1)
37
- redis (~> 3.0.4)
36
+ rb-readline (0.5.1)
37
+ redis (3.2.0)
38
+ redis-namespace (1.5.1)
39
+ redis (~> 3.0, >= 3.0.4)
38
40
  rspec (3.0.0.beta2)
39
41
  rspec-core (= 3.0.0.beta2)
40
42
  rspec-expectations (= 3.0.0.beta2)
@@ -47,7 +49,7 @@ GEM
47
49
  rspec-mocks (3.0.0.beta2)
48
50
  rspec-support (= 3.0.0.beta2)
49
51
  rspec-support (3.0.0.beta2)
50
- thor (0.18.1)
52
+ thor (0.19.1)
51
53
  url_mount (0.2.1)
52
54
  rack
53
55
 
data/README.md CHANGED
@@ -16,11 +16,15 @@ gem "lita-giphy"
16
16
  ### Required attributes
17
17
  * `api_key` - Your [Giphy API](https://github.com/giphy/GiphyAPI) key. You can either email the devs for a personal API key, or you can use the default public beta key-- `dc6zaTOxFJmzC`.
18
18
 
19
+ ### Optional attributes
20
+ * `rating` - allows you to set the rating of the gifs that are found
21
+
19
22
  ### Example
20
23
 
21
24
  ``` ruby
22
25
  Lita.configure do |config|
23
26
  config.handlers.giphy.api_key = "dc6zaTOxFJmzC"
27
+ config.handlers.giphy.rating = 'g'
24
28
  end
25
29
  ```
26
30
 
@@ -2,15 +2,16 @@ require 'lita'
2
2
  module Lita
3
3
  module Handlers
4
4
  class Giphy < Handler
5
+
6
+ config :api_key, required: true
7
+ config :rating, default: "pg"
8
+
5
9
  URL = "http://api.giphy.com/v1/gifs/search"
6
10
 
7
11
  route(/(?:giphy|gif|animate)(?:\s+me)?\s+(.+)/i, :giphy, command: true, help: {
8
12
  "giphy QUERY" => "Grabs a gif tagged with QUERY."
9
13
  })
10
14
 
11
- def self.default_config(config)
12
- config.api_key = nil
13
- end
14
15
 
15
16
  def giphy(response)
16
17
  return unless validate(response)
@@ -34,6 +35,7 @@ module Lita
34
35
  process_response(http.get(
35
36
  URL,
36
37
  q: query,
38
+ rating: Lita.config.handlers.giphy.rating,
37
39
  api_key: Lita.config.handlers.giphy.api_key
38
40
  ), query)
39
41
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-giphy"
3
- spec.version = "1.0.2"
3
+ spec.version = "1.0.3"
4
4
  spec.authors = ["Jordan Killpack"]
5
5
  spec.email = ["jordan.killpack@gatech.edu"]
6
6
  spec.description = %q{Giphy gif search handler for Lita}
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Lita::Handlers::Giphy, lita_handler: true do
4
- it { routes_command("giphy swanson dance").to :giphy }
5
- it { routes_command("gif swanson dance").to :giphy }
6
- it { routes_command("animate swanson dance").to :giphy }
4
+ it { is_expected.to route_command("giphy swanson dance").to :giphy }
5
+ it { is_expected.to route_command("gif swanson dance").to :giphy }
6
+ it { is_expected.to route_command("animate swanson dance").to :giphy }
7
7
 
8
8
  it "sets the Giphy API key to nil by default" do
9
9
  expect(Lita.config.handlers.giphy.api_key).to be_nil
@@ -1,2 +1,3 @@
1
1
  require 'lita-giphy'
2
2
  require 'lita/rspec'
3
+ Lita.version_3_compatibility_mode = false
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-giphy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Killpack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2015-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.0.0.beta1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.0.0.beta1
69
69
  description: Giphy gif search handler for Lita
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - Gemfile.lock
79
79
  - README.md
@@ -92,20 +92,21 @@ require_paths:
92
92
  - lib
93
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.0.3
105
+ rubygems_version: 2.4.8
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Giphy gif search handler for Lita
109
109
  test_files:
110
110
  - spec/lita/handlers/giphy_spec.rb
111
111
  - spec/spec_helper.rb
112
+ has_rdoc: