lita-onewheel-wolfram-alpha 0.3.0 → 0.5.2

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
- SHA1:
3
- metadata.gz: e680b12bb1ba0e4de7265bf2eed31c937120d3a2
4
- data.tar.gz: 127bad9eaa91a9785d61efbf54ae3f99e0cfc3b4
2
+ SHA256:
3
+ metadata.gz: 9637dfcf983232a120cdfab50d30382063d3c859cafaddde4c3c7d14dd00c872
4
+ data.tar.gz: ca23d5c031fedfcf3a857b75322fd39f9a973941ad5ace248145348f70b8a76b
5
5
  SHA512:
6
- metadata.gz: a3ba64991afc26a6ed571519cfd7be4ff273d15e65a06699620982fd1c077d75882b55a7e9ed3ad8078d08fb7231daeadc7efbbb8da14d38062586272457608d
7
- data.tar.gz: 22ad5d4af696b59890be8bf0e4efbc580cee9d59b6d1c0551388b802a711a518a6a249fe902ef3eca631be12007cc666c86531df53f233e8ccb3b56442a7b425
6
+ metadata.gz: 06d5ea94e5916e7acef8f1024924b3fc99f20a4dcd72db15cbd8bc2daab90a4dc5fda206dfa2d46ac4f0599ea4046aea9866303ade83db7a55714d655a311017
7
+ data.tar.gz: 1b96c57b39d2312b3233975ad0ef63dc573c9a0c86552a57e3840d0d7a7cd560b8d9178603cba47f2d3674de4b8c2a3e4dfd9f7ee3fd1d4f323b4cbb78059e03
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.4
4
3
  - 2.3.0
4
+ - 2.4.2
5
5
  script: bundle exec rake
6
6
  before_install:
7
7
  - gem update --system
@@ -19,7 +19,8 @@ module Lita
19
19
  post_script = ''
20
20
 
21
21
  if matches = query.match(/\<(.*)\>/)
22
- query.gsub! /\<#{matches[1]}\>/, ''
22
+ Lita.logger.debug "Megamatch: #{matches[1]}"
23
+ query.gsub! /\<.*\>/, ''
23
24
  post_script = " #{matches[1]}"
24
25
  end
25
26
 
@@ -46,7 +47,7 @@ module Lita
46
47
  Lita.logger.debug "lita-onewheel-wolfram-alpha: Pod title: #{pods[1].attribute('title').to_s}"
47
48
 
48
49
  title = pods[1].attribute('title').to_s
49
- if title == 'Plot' # Plot is a graph, grab the image.
50
+ if title == 'Plots' or title == 'Plot' # Plot is a graph, grab the image.
50
51
  pods[1].xpath('//img')[1].attribute('src').to_s
51
52
  else # Plaintext seems to work well for, say, Definition.
52
53
  rid_thee_of_extras pods[1].xpath('//plaintext')[1].child.to_s
@@ -69,7 +70,7 @@ module Lita
69
70
  uri = build_uri query
70
71
  Lita.logger.debug "lita-onewheel-wolfram-alpha: #{uri}"
71
72
  response = RestClient.get(uri)
72
- Lita.logger.debug 'lita-onewheel-wolfram-alpha: ' + response.to_s
73
+ #Lita.logger.debug 'lita-onewheel-wolfram-alpha: ' + response.to_s
73
74
  Nokogiri::XML response.to_s
74
75
  end
75
76
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-wolfram-alpha'
3
- spec.version = '0.3.0'
3
+ spec.version = '0.5.2'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to Wolfram Alpha.}
@@ -15,10 +15,10 @@ Gem::Specification.new do |spec|
15
15
  spec.require_paths = ['lib']
16
16
 
17
17
  spec.add_runtime_dependency 'lita', '~> 4'
18
- spec.add_runtime_dependency 'rest-client', '~> 1'
18
+ spec.add_runtime_dependency 'rest-client', '~> 2'
19
19
  spec.add_runtime_dependency 'nokogiri', '~> 1'
20
20
 
21
- spec.add_development_dependency 'bundler', '~> 1'
21
+ spec.add_development_dependency 'bundler', '~> 2'
22
22
  # spec.add_development_dependency 'pry-byebug', '~> 3.1'
23
23
  spec.add_development_dependency 'rake', '~> 12'
24
24
  spec.add_development_dependency 'rack-test', '~> 0'
@@ -18,6 +18,7 @@ describe Lita::Handlers::OnewheelWolframAlpha, :lita_handler => true do
18
18
  end
19
19
 
20
20
  it { is_expected.to route_command('alpha') }
21
+ it { is_expected.to route_command('quote') }
21
22
 
22
23
  it 'will work' do
23
24
  mock_fixture('pi')
@@ -62,9 +63,15 @@ describe Lita::Handlers::OnewheelWolframAlpha, :lita_handler => true do
62
63
  expect(replies.last).to eq('http://www2.wolframalpha.com/Calculate/MSP/MSP8620hdi8ba18h005cd0000268f85ce36b8h331?MSPStoreType=image/gif&s=15 as a service')
63
64
  end
64
65
 
65
- # it 'will add .0 to a fraction' do
66
- # mock_fixture('onedividedby2')
67
- # send_command 'alpha 1/2'
68
- # expect(replies.last).to eq('0.5')
69
- # end
66
+ it 'will add .0 to a fraction' do
67
+ mock_fixture('oneovertwo')
68
+ send_command 'alpha 1/2'
69
+ expect(replies.last).to eq('0.5')
70
+ end
71
+
72
+ it 'will quote' do
73
+ mock_fixture('quote')
74
+ send_command 'quote amzn'
75
+ expect(replies.last).to eq('x')
76
+ end
70
77
  end
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.3.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-28 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1'
33
+ version: '2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1'
40
+ version: '2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1'
61
+ version: '2'
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: '1'
68
+ version: '2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -180,8 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubyforge_project:
184
- rubygems_version: 2.6.11
183
+ rubygems_version: 3.1.2
185
184
  signing_key:
186
185
  specification_version: 4
187
186
  summary: Summarize THIS!