lita-onewheel-images 0.5.0 → 0.6.4

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
  SHA256:
3
- metadata.gz: c22c9e5cf9d40eafb476f9e9751bfbd861c0cca587326d15dc8db03a476f9b78
4
- data.tar.gz: 854de29ee5107a1a2c731ead49e1ab23cd63cd6fa6c7ebb792a9f897801997a0
3
+ metadata.gz: a25699c4a39b28ffd814c9465d0ac417416bc9657d2b2ccf11a44aa2c466009b
4
+ data.tar.gz: 579ba37ed0c03737c3b18e1b57b108fdc656baa190318f5b46473cd1be97348d
5
5
  SHA512:
6
- metadata.gz: 2d4418130177af63bb6ded832a372a8b5ad7b2af652940f06af8e3d4f3136a20f1852930a5dd68d6c3255c9b5fc8194df4bac6465f6ac36283a7b232bcf783d8
7
- data.tar.gz: 93eae3dc4118d5c5c998e54cac94d1809fb1bf2302f4078138f643c6f700fce844fead8b03b18ccd04010fdbdc4fba4bf8299625591e94c0045dc2ce956328d5
6
+ metadata.gz: b96a773f3e2bb3442ae6a6ffa37e1bdf77a38451933e7ed6623f2fcad8dc5eb9446fc4711281c4056f00b3a849d685dc38b834d101119658a2d1553180265c21
7
+ data.tar.gz: 26f3659858fc835120236f0ef2add647e568c060dac784e10c1203820a2b71d935b5b0ac4721d74d76c4eba0faa81f7b2a93c7436e1ae559fd26b87417b2f004
@@ -11,8 +11,11 @@ module Lita
11
11
 
12
12
  route /^image\s+(.*)$/i, :image, command: true
13
13
  route /^img\s+(.*)$/i, :image, command: true
14
+ route /^jpg\s+(.*)$/i, :image, command: true
15
+ route /^png\s+(.*)$/i, :image, command: true
14
16
  route /^giphy\s+(.*)$/i, :giphy, command: true
15
17
  route /^gif\s+(.*)$/i, :giphy, command: true
18
+ route /^git\s+(.*)$/i, :giphy, command: true
16
19
 
17
20
  def image(response)
18
21
  query = response.matches[0][0]
@@ -34,9 +37,11 @@ module Lita
34
37
  end
35
38
 
36
39
  query = 'giphy ' + response.matches[0][0]
40
+ Lita.logger.debug("Query: #{query}")
37
41
  result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search, image = true)
38
42
 
39
43
  if result
44
+ # Lita.logger.debug("items: #{result['items']}")
40
45
  result['items'].each do |r|
41
46
  if r['mime'] == 'image/gif'
42
47
  if r['link'][/200_s.gif$/]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-images'
3
- spec.version = '0.5.0'
3
+ spec.version = '0.6.4'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = 'An implementation of Google Custom Search Engine for image searches in chat.'
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.add_runtime_dependency 'onewheel-google', '~> 1'
19
19
 
20
20
  spec.add_development_dependency 'bundler', '~> 2'
21
- spec.add_development_dependency 'rake', '~> 11'
21
+ spec.add_development_dependency 'rake', '>= 12.3.3'
22
22
  spec.add_development_dependency 'rack-test', '~> 0'
23
23
  spec.add_development_dependency 'rspec', '~> 3'
24
24
  spec.add_development_dependency 'simplecov', '~> 0'
@@ -17,6 +17,8 @@ describe Lita::Handlers::OnewheelImages, lita_handler: true do
17
17
 
18
18
  it { is_expected.to route_command('image something') }
19
19
  it { is_expected.to route_command('giphy something') }
20
+ it { is_expected.to route_command('gif something') }
21
+ it { is_expected.to route_command('git something') }
20
22
 
21
23
  it 'does neat imagey things' do
22
24
  mock_it_up('mock_result')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-images
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2020-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '11'
61
+ version: 12.3.3
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
- version: '11'
68
+ version: 12.3.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack-test
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.0.3
167
+ rubygems_version: 3.1.2
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: CSE Details to follow