lita-onewheel-freds-sound-of-music 0.0.1 → 0.0.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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91a01321671edca204a317004fbba9e3eae912ac
|
4
|
+
data.tar.gz: 15a70b0a0216ce68e62baa958bf705792bb4aa63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c49353ab20088bce2355d49700959847cb11778ea47f1186c077758d37d79c48e0b83a5e7c66532d8f8b26f854cd994085297b6732cc3c7d0c0dbfdc3ad8f885
|
7
|
+
data.tar.gz: f2321a2e8c4ed450f10ec992f93cd64521ce5dcbad0c4325f3e217af68096ee68ea78b654e80a2b34b1f9124e351f2abb0574c3958e460ac29396af06b8e02cb
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -7,6 +7,7 @@ module Lita
|
|
7
7
|
route(/^freds\s+(.*)/i, :freds_search, command: true, help: 'freds whatevs')
|
8
8
|
|
9
9
|
def freds_search(response)
|
10
|
+
search_term = response.matches[0][0]
|
10
11
|
doc = RestClient.get 'http://www.fredsoundofmusic.com/specials/pre-owned-components.html'
|
11
12
|
noko_doc = Nokogiri::HTML doc
|
12
13
|
tables = noko_doc.css('#rt-main table')
|
@@ -40,7 +41,13 @@ module Lita
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
break if record[:brand].empty? and record[:model].empty?
|
43
|
-
|
44
|
+
|
45
|
+
if record[:brand].match(/#{search_term}/i) or
|
46
|
+
record[:model].match(/#{search_term}/i) or
|
47
|
+
record[:description].match(/#{search_term}/i)
|
48
|
+
|
49
|
+
records.push record
|
50
|
+
end
|
44
51
|
end
|
45
52
|
format_output(response, records)
|
46
53
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-freds-sound-of-music'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.2'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = %q{Lita interface to Fred's sound of music used listings.}
|
@@ -5,5 +5,22 @@ describe Lita::Handlers::OnewheelFredsSoundOfMusic, lita_handler: true do
|
|
5
5
|
mock_fixture('freds')
|
6
6
|
send_command 'freds '
|
7
7
|
expect(replies.last).to eq('Yamaha CT-1010 was $385.00, now $299.95')
|
8
|
+
expect(replies.length).to eq(176)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'will search for an item' do
|
12
|
+
mock_fixture('freds')
|
13
|
+
send_command 'freds mx130'
|
14
|
+
expect(replies.length).to eq(1)
|
15
|
+
expect(replies.last).to eq('Mcintosh MX130 was $4800.00, now $999.95')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'will search for an item by brand' do
|
19
|
+
mock_fixture('freds')
|
20
|
+
send_command 'freds mci'
|
21
|
+
expect(replies.length).to eq(3)
|
22
|
+
expect(replies[0]).to eq('Mcintosh MX130 was $4800.00, now $999.95')
|
23
|
+
expect(replies[1]).to eq('Mcintosh MC502 was $1200.00, now $895.00')
|
24
|
+
expect(replies.last).to eq('Mcintosh MR80 was $2499.00, now $1295.00')
|
8
25
|
end
|
9
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-freds-sound-of-music
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
@@ -144,6 +144,7 @@ extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
146
|
- ".gitignore"
|
147
|
+
- ".travis.yml"
|
147
148
|
- Gemfile
|
148
149
|
- Gemfile.lock
|
149
150
|
- README.md
|