lita-onewheel-amazon-product 0.0.0 → 0.0.1

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: fa6d18fe862294c39ae2df5efc32ef7c60446e41
4
- data.tar.gz: fe23bd2f833a2d50957900d07900b784dec799c5
3
+ metadata.gz: 745ef691540e1d6c6c88a5a124980682724ce0ff
4
+ data.tar.gz: bf411f99208a0867e54cab85d27dd7fcce58618a
5
5
  SHA512:
6
- metadata.gz: 9394f66ee5377142cd990651ca9f62159125f078e5bcee63eb6e1147bff197a734e23aebc5ff844babab4bd22f6c5b020b3725d1269ad82eca712f4bc2b1b1ee
7
- data.tar.gz: 2f741ddf2776755c14fa4660c87b3813b17e6644134cd881ca6c96802d726cd8984635ecb7609621d2c2b9bfb55fcde6b4b85d783189185aee324df4c7fcd69c
6
+ metadata.gz: e9844fcd16a3d47f02cf182edd8564689a7e93292c4b754479175f6283dcc4f0caaee901699bbe029361f6e81c71f3af1b747b7167961d8c927b5bbe84c161d9
7
+ data.tar.gz: 7815f6e4a4a9f221bfec75aefe73384f75235ad3bc548bf5c43efd2e03996e7adb2e5f0f51882a604e3ac0e54404141de65cb093ba46b56d50dc1c904076993b
@@ -16,7 +16,7 @@ module Lita
16
16
  noko_doc.xpath('//meta').each do |meta|
17
17
  attrs = meta.attributes
18
18
  if attrs['name'].to_s == 'description'
19
- description = attrs['content'].to_s
19
+ description = process_description attrs['content'].to_s
20
20
  end
21
21
  end
22
22
 
@@ -27,6 +27,11 @@ module Lita
27
27
  end
28
28
  end
29
29
 
30
+ def process_description(desc)
31
+ desc.sub! /^Amazon.com: /, ''
32
+ desc.sub! /:.*$/, ''
33
+ end
34
+
30
35
  Lita.register_handler(self)
31
36
  end
32
37
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-amazon-product'
3
- spec.version = '0.0.0'
3
+ spec.version = '0.0.1'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to post information about amazon products.}
@@ -9,6 +9,6 @@ describe Lita::Handlers::OnewheelAmazonProduct, lita_handler: true do
9
9
  it 'puts the amazon product info on the response' do
10
10
  mock_fixture('sample')
11
11
  send_message ('http://www.amazon.com/Plugable-Micro-B-Ethernet-Raspberry-AX88772A/dp/B00RM3KXAU/')
12
- expect(replies.last).to eq('$13.95 Amazon.com: Plugable USB 2.0 OTG Micro-B to 10/100 Fast Ethernet Adapter for Windows Tablets & Raspberry Pi Zero (ASIX AX88772A chipset): Computers & Accessories')
12
+ expect(replies.last).to eq('$13.95 Plugable USB 2.0 OTG Micro-B to 10/100 Fast Ethernet Adapter for Windows Tablets & Raspberry Pi Zero (ASIX AX88772A chipset)')
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-amazon-product
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita