From 53e48246fa37d1af3ed30de453107a5a457cbf48 Mon Sep 17 00:00:00 2001 From: Luke Pearce Date: Fri, 10 Aug 2012 19:05:30 +0100 Subject: [PATCH 1/2] FIX: api error when using .json in url --- lib/rmeetup/fetcher/base.rb | 6 ++++-- spec/fetchers/base_spec.rb | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/rmeetup/fetcher/base.rb b/lib/rmeetup/fetcher/base.rb index b27a7b9..2c23b81 100644 --- a/lib/rmeetup/fetcher/base.rb +++ b/lib/rmeetup/fetcher/base.rb @@ -57,7 +57,9 @@ def build_url(options) end def base_url - "http://api.meetup.com/#{@type}.json/" + url = "http://api.meetup.com/" + url += "#{@type}/" unless @type.nil? + url end # Create a query string from an options hash @@ -81,4 +83,4 @@ def get_response(url) end end end -end \ No newline at end of file +end diff --git a/spec/fetchers/base_spec.rb b/spec/fetchers/base_spec.rb index de760b0..03805d7 100644 --- a/spec/fetchers/base_spec.rb +++ b/spec/fetchers/base_spec.rb @@ -9,11 +9,11 @@ it 'should build a correct to call.' do @options['search'] = 'ruby search' url = @fetcher.send(:build_url,@options) - url.should eql("http://api.meetup.com/.json/?key=seekret_api_key&search=ruby%20search") + url.should eql("http://api.meetup.com/?key=seekret_api_key&search=ruby%20search") end it 'should generate a correct base url' do - @fetcher.send(:base_url).should eql('http://api.meetup.com/.json/') + @fetcher.send(:base_url).should eql('http://api.meetup.com/') end it 'should uri encode options' do From 4b1fbd537135ddbfbba8201fcdcb1562dfa195de Mon Sep 17 00:00:00 2001 From: Luke Pearce Date: Fri, 10 Aug 2012 19:31:14 +0100 Subject: [PATCH 2/2] NEW: Added gemspec --- rMeetup.gemspec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 rMeetup.gemspec diff --git a/rMeetup.gemspec b/rMeetup.gemspec new file mode 100644 index 0000000..ee97cac --- /dev/null +++ b/rMeetup.gemspec @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +lib = File.expand_path('../lib/', __FILE__) +$:.unshift lib unless $:.include?(lib) + +Gem::Specification.new do |s| + s.name = "rMeetup" + s.version = "1.0.1" + s.platform = Gem::Platform::RUBY + s.authors = ["Jared Pace", "Jason Berlinsky"] + s.email = ["jberlinsky@example.com"] + s.homepage = "https://github.com/Jberlinsky/rmeetup" + s.summary = "A simple Ruby gem, providing access to the Meetup API" + #s.description = "" + + s.required_rubygems_version = ">= 1.3.6" + + s.add_development_dependency "rspec" + + s.files = Dir.glob("lib/**/*") + s.require_path = 'lib' +end