Skip to content

Commit

Permalink
Fixed version flag bug that would cause system to break if it was on
Browse files Browse the repository at this point in the history
it's own.

Also version bump
  • Loading branch information
brntbeer committed Oct 4, 2011
1 parent 463f574 commit 5ab8f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/yelpme.rb
Expand Up @@ -26,15 +26,20 @@ def self.search(*args)
location = {}
location[:location] = args.shift
options = {}
OptionParser.new do |opts|
opts = OptionParser.new do |opts|

opts.on("-r", "--random", "Random result") do |r|
options[:random] = r
end

opts.on("-V", "--version", "Print the version") do |v|
options[:version] = v
puts "Version #{Yelpme::VERSION}"
exit
end
end.parse!



raise ArgumentError, "Location needs a value" if location[:location].nil?
if %w{YELP_CONSUMER_KEY YELP_CONSUMER_SECRET YELP_TOKEN YELP_TOKEN_SECRET}.all?{|word| ENV.include?(word)}
query = Yelp::Base.new(ENV["YELP_CONSUMER_KEY"],ENV["YELP_CONSUMER_SECRET"],ENV["YELP_TOKEN"], ENV["YELP_TOKEN_SECRET"])
Expand Down
2 changes: 1 addition & 1 deletion lib/yelpme/version.rb
@@ -1,3 +1,3 @@
module Yelpme
VERSION = "0.0.4"
VERSION = "0.0.5"
end

0 comments on commit 5ab8f78

Please sign in to comment.