lita-onewheel-wolfram-alpha 0.4.0 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/onewheel_wolfram_alpha.rb +5 -9
- data/lita-onewheel-wolfram-alpha.gemspec +3 -3
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39f9ce818f4ee1d047b8779cf218289a881e7da00ee887c283fa46453f26e3ae
|
4
|
+
data.tar.gz: e4a25a33166b7845a6046d6c0ecbecd2d064bdb16fa6d715030f930a5c81143f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc947ba6f36a1e179b34f3e03bba8490869adc21bdbdcbe54042a1778dbf7b538867279a2d130d637419cfccd9f200549f78bef8fb8c7061047e1aa18e41ce7b
|
7
|
+
data.tar.gz: fc58603cc347bbe9a6186ab5fe48cfe15ea88c414c13186fed2fa733d42d9250fc6b6e98f4549c44f93b804687b23d783380af3b02cea869f113543f78d6f71c
|
@@ -8,12 +8,6 @@ module Lita
|
|
8
8
|
config :api_uri
|
9
9
|
|
10
10
|
route(/^alpha\s*(.*)/i, :handle_wolfram_query, command: true)
|
11
|
-
route(/^quote\s*(.*)/i, :handle_wolfram_quote, command: true)
|
12
|
-
|
13
|
-
def handle_wolfram_quote(response)
|
14
|
-
response.matches[0][0] = "quote #{response.matches[0][0]}"
|
15
|
-
handle_wolfram_query(response)
|
16
|
-
end
|
17
11
|
|
18
12
|
def handle_wolfram_query(response)
|
19
13
|
unless config.app_id and config.api_uri
|
@@ -25,12 +19,14 @@ module Lita
|
|
25
19
|
post_script = ''
|
26
20
|
|
27
21
|
if matches = query.match(/\<(.*)\>/)
|
28
|
-
|
22
|
+
Lita.logger.debug "Megamatch: #{matches[1]}"
|
23
|
+
query.gsub! /\<.*\>/, ''
|
29
24
|
post_script = " #{matches[1]}"
|
30
25
|
end
|
31
26
|
|
32
27
|
# fraction hack
|
33
28
|
if query.match /\// and !query.match /\./
|
29
|
+
query.sub! /\s+$/, ''
|
34
30
|
query += ".0"
|
35
31
|
end
|
36
32
|
|
@@ -52,7 +48,7 @@ module Lita
|
|
52
48
|
Lita.logger.debug "lita-onewheel-wolfram-alpha: Pod title: #{pods[1].attribute('title').to_s}"
|
53
49
|
|
54
50
|
title = pods[1].attribute('title').to_s
|
55
|
-
if title == 'Plot' # Plot is a graph, grab the image.
|
51
|
+
if title == 'Plots' or title == 'Plot' # Plot is a graph, grab the image.
|
56
52
|
pods[1].xpath('//img')[1].attribute('src').to_s
|
57
53
|
else # Plaintext seems to work well for, say, Definition.
|
58
54
|
rid_thee_of_extras pods[1].xpath('//plaintext')[1].child.to_s
|
@@ -75,7 +71,7 @@ module Lita
|
|
75
71
|
uri = build_uri query
|
76
72
|
Lita.logger.debug "lita-onewheel-wolfram-alpha: #{uri}"
|
77
73
|
response = RestClient.get(uri)
|
78
|
-
Lita.logger.debug 'lita-onewheel-wolfram-alpha: ' + response.to_s
|
74
|
+
#Lita.logger.debug 'lita-onewheel-wolfram-alpha: ' + response.to_s
|
79
75
|
Nokogiri::XML response.to_s
|
80
76
|
end
|
81
77
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-wolfram-alpha'
|
3
|
-
spec.version = '0.
|
3
|
+
spec.version = '0.5.3'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = %q{Lita interface to Wolfram Alpha.}
|
@@ -14,13 +14,13 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
|
-
spec.add_runtime_dependency 'lita', '~> 4'
|
17
|
+
spec.add_runtime_dependency 'lita', '~> 4.4'
|
18
18
|
spec.add_runtime_dependency 'rest-client', '~> 2'
|
19
19
|
spec.add_runtime_dependency 'nokogiri', '~> 1'
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 2'
|
22
22
|
# spec.add_development_dependency 'pry-byebug', '~> 3.1'
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
23
|
+
spec.add_development_dependency 'rake', '~> 13'
|
24
24
|
spec.add_development_dependency 'rack-test', '~> 0'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3'
|
26
26
|
spec.add_development_dependency 'simplecov', '~> 0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-wolfram-alpha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '4'
|
19
|
+
version: '4.4'
|
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
|
-
version: '4'
|
26
|
+
version: '4.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rest-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '13'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '13'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ licenses:
|
|
165
165
|
- MIT
|
166
166
|
metadata:
|
167
167
|
lita_plugin_type: handler
|
168
|
-
post_install_message:
|
168
|
+
post_install_message:
|
169
169
|
rdoc_options: []
|
170
170
|
require_paths:
|
171
171
|
- lib
|
@@ -180,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
-
signing_key:
|
183
|
+
rubygems_version: 3.1.2
|
184
|
+
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: Summarize THIS!
|
187
187
|
test_files:
|