lita-livenation 0.0.8 → 0.0.9

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: 6f48987260fc04e51179296c0ade410fac56d8c4
4
- data.tar.gz: 2c169842ab17453831ecc45d90bce64bef07e7a6
3
+ metadata.gz: d0be5cce95a59869b4cf3cd4b3e0f229470993eb
4
+ data.tar.gz: 545635822d0eb378c7de84673a73740bf905827e
5
5
  SHA512:
6
- metadata.gz: f5e4e6b190271b71169da428fd30788677ce14fae493638d9c209f1131cd32fdd87d62ced9f4777b6df17f0ab064b5c40ead2f01ce53839f7768d540bd746bcf
7
- data.tar.gz: c18a7684d33030338fcb39d18a1caefcdaa284157ddb9a2827bea300220696cc4a7bd4d4b479889ad3634090699b9b2cee7e495aba4d2acc68bcbd5adb29b4d9
6
+ metadata.gz: 343cdde80f372c8de880a6ded8a1c4e719892e1d92e14c53c335dc407f5cf33de7ce7dd2f9c7528b4137adce5cdc2a6f99e422a0d113e1477fd8badb27f62e6d
7
+ data.tar.gz: ede840f8bac1115fe60f1872a212d0e1f66e96cdf16db0f5e4c3dd25fa2933f306a358c3bc4844e34d205325ac7066f1ed9eaf8ab906d453b4f33708e92b7397
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lita-livenation (0.0.8)
4
+ lita-livenation (0.0.9)
5
5
  i18n
6
6
  lita (>= 2.7)
7
7
  octokit
8
+ yelp
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
@@ -14,6 +15,8 @@ GEM
14
15
  diff-lcs (1.2.5)
15
16
  faraday (0.9.0)
16
17
  multipart-post (>= 1.2, < 3)
18
+ faraday_middleware (0.9.1)
19
+ faraday (>= 0.7.4, < 0.10)
17
20
  http_router (0.11.1)
18
21
  rack (>= 1.0.0)
19
22
  url_mount (~> 0.2.1)
@@ -63,10 +66,15 @@ GEM
63
66
  sawyer (0.5.5)
64
67
  addressable (~> 2.3.5)
65
68
  faraday (~> 0.8, < 0.10)
69
+ simple_oauth (0.2.0)
66
70
  slop (3.4.6)
67
71
  thor (0.19.1)
68
72
  url_mount (0.2.1)
69
73
  rack
74
+ yelp (2.0.3)
75
+ faraday (~> 0.8, >= 0.8.0)
76
+ faraday_middleware (~> 0.8, >= 0.8.0)
77
+ simple_oauth (~> 0.2, >= 0.2.0)
70
78
 
71
79
  PLATFORMS
72
80
  ruby
@@ -0,0 +1,36 @@
1
+ require 'yelp'
2
+
3
+ class LunchFinder
4
+
5
+ def initialize(terms, local=true)
6
+ @term = terms.join(",")
7
+ radius = local ? 1609.34 : 20000
8
+ @search_terms = {
9
+ term: @term,
10
+ category_filter: 'restaurants',
11
+ radius_filter: radius
12
+ }
13
+ @locale = { lang: 'en' }
14
+ end
15
+
16
+ def search
17
+ coordinates = { latitude: 34.101905, longitude: -118.344547 }
18
+ response = Yelp.client.search_by_coordinates(coordinates, @search_terms, @locale)
19
+
20
+ results = []
21
+
22
+ response.businesses.each do |business|
23
+ results << "#{business.name} - #{business.distance} meters away - #{business.rating} Stars"
24
+ end
25
+
26
+ results
27
+ end
28
+
29
+ def self.search(terms, local=false)
30
+ if terms.nil? || terms == ''
31
+ terms = 'food'
32
+ end
33
+ terms = terms.split if terms.kind_of? String
34
+ new(terms).search
35
+ end
36
+ end
@@ -12,8 +12,14 @@ module Lita
12
12
  end
13
13
 
14
14
  def lunch(response)
15
- lunch_spots = ['Shin Ya', "Hoy's Wok", 'Fresh n Easy', 'Baja Fresh', "Zankou's Chicken", 'Mendocino Farms', 'Chipotle', 'Jersey Mike\'s', 'In N Out', 'El Compadre', 'Te\'kila', 'Veggie Grill', '25 Degrees', 'Loteria', 'Subway', 'Buffalo Wild Wings', 'Hooters', 'El Pollo Loco', 'Le Mandarette']
16
- response.reply "You should eat at #{lunch_spots.sample} today."
15
+ local = !!(response.args[2] == "local")
16
+
17
+ lunch_spots = LunchFinder.search(response.args[1], local)
18
+ # lunch_spots = ['Shin Ya', "Hoy's Wok", 'Fresh n Easy', 'Baja Fresh', "Zankou's Chicken", 'Mendocino Farms', 'Chipotle', 'Jersey Mike\'s', 'In N Out', 'El Compadre', 'Te\'kila', 'Veggie Grill', '25 Degrees', 'Loteria', 'Subway', 'Buffalo Wild Wings', 'Hooters', 'El Pollo Loco', 'Le Mandarette']
19
+ response.reply "Here's a list of #{local ? 'local' : 'non-local'} places to eat."
20
+ lunch_spots.each do |spot|
21
+ response.reply spot
22
+ end
17
23
  end
18
24
 
19
25
  def github_readme(response)
@@ -1,3 +1,12 @@
1
1
  require 'lita/handlers/livenation'
2
2
  require 'lita/behaviors/github'
3
+ require 'lita/behaviors/lunch_finder'
3
4
  require 'octokit'
5
+ require 'yelp'
6
+
7
+ Yelp.client.configure do |config|
8
+ config.consumer_key = ENV['YELP_CONSUMER_KEY'] || 'o7CT3TSHy2RaArFziNBdGw'
9
+ config.consumer_secret = ENV['YELP_CONSUMER_SECRET'] || 'Pz6cVfBg5NAQEpvxt7oucgh0IpQ'
10
+ config.token = ENV['YELP_TOKEN'] || 'CLByhGioLt-hCorzjJ2AsR_HU5rHzIww'
11
+ config.token_secret = ENV['YELP_TOKEN_SECRET'] || 'jOKX1vPwGPWVf-uKJn5I-eX07QM'
12
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-livenation"
3
- spec.version = "0.0.8"
3
+ spec.version = "0.0.9"
4
4
  spec.authors = ["Peter Tran"]
5
5
  spec.email = ["peter@livenationlabs.com"]
6
6
  spec.description = %q{Plugin for Lita that responds to standup with a zoom link.}
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.add_runtime_dependency "i18n"
18
18
  spec.add_runtime_dependency "lita", ">= 2.7"
19
19
  spec.add_runtime_dependency "octokit"
20
+ spec.add_runtime_dependency "yelp"
20
21
 
21
22
  spec.add_development_dependency "bundler"
22
23
  spec.add_development_dependency "rake"
@@ -1,10 +1,17 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Lita::Handlers::Livenation, lita_handler: true do
4
- describe '#pull_requests' do
4
+ # describe '#pull_requests' do
5
5
 
6
- it 'returns all available pull requests from github' do
7
- send_command 'github readme proc/spirit'
6
+ # it 'returns all available pull requests from github' do
7
+ # send_command 'github readme proc/spirit'
8
+ # expect(replies).to_not be_empty
9
+ # end
10
+ # end
11
+
12
+ describe '#lunch' do
13
+ it 'does nothing' do
14
+ send_command 'lunch burgers local'
8
15
  expect(replies).to_not be_empty
9
16
  end
10
17
  end
metadata CHANGED
@@ -1,111 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-livenation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Tran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
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
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: lita
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.7'
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
40
  version: '2.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: yelp
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - '>='
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - '>='
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '>='
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: 3.0.0.beta2
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - '>='
108
+ - - ">="
95
109
  - !ruby/object:Gem::Version
96
110
  version: 3.0.0.beta2
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: pry
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - '>='
122
+ - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  description: Plugin for Lita that responds to standup with a zoom link.
@@ -122,6 +136,7 @@ files:
122
136
  - Rakefile
123
137
  - lib/lita-livenation.rb
124
138
  - lib/lita/behaviors/github.rb
139
+ - lib/lita/behaviors/lunch_finder.rb
125
140
  - lib/lita/handlers/livenation.rb
126
141
  - lita-livenation.gemspec
127
142
  - spec/behaviors/github_spec.rb
@@ -139,12 +154,12 @@ require_paths:
139
154
  - lib
140
155
  required_ruby_version: !ruby/object:Gem::Requirement
141
156
  requirements:
142
- - - '>='
157
+ - - ">="
143
158
  - !ruby/object:Gem::Version
144
159
  version: '0'
145
160
  required_rubygems_version: !ruby/object:Gem::Requirement
146
161
  requirements:
147
- - - '>='
162
+ - - ">="
148
163
  - !ruby/object:Gem::Version
149
164
  version: '0'
150
165
  requirements: []