gems 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in gems.gemspec
3
+ platforms :jruby do
4
+ gem 'jruby-openssl', '~> 0.7'
5
+ end
6
+
4
7
  gemspec
data/README.md CHANGED
@@ -4,7 +4,7 @@ Ruby wrapper for the RubyGems.org API.
4
4
 
5
5
  Installation
6
6
  ------------
7
- gem install gems [pending]
7
+ gem install gems
8
8
 
9
9
  Documentation
10
10
  -------------
@@ -25,7 +25,7 @@ module Gems
25
25
  # @example
26
26
  # Gems.search 'cucumber'
27
27
  def search(query, options={})
28
- get("/api/v1/gems/search.json", options.merge(:query => query))
28
+ get("/api/v1/search.json", options.merge(:query => query))
29
29
  end
30
30
 
31
31
  # Returns an array of gem version details
@@ -5,7 +5,13 @@ module Gems
5
5
  private
6
6
 
7
7
  def connection
8
- Faraday.new(:url => 'http://rubygems.org') do |connection|
8
+ options = {
9
+ :headers => {'Accept' => 'application/json'},
10
+ :ssl => {:verify => false},
11
+ :url => 'https://rubygems.org',
12
+ }
13
+
14
+ Faraday.new(options) do |connection|
9
15
  connection.use Faraday::Request::UrlEncoded
10
16
  connection.use Faraday::Response::RaiseError
11
17
  connection.use Faraday::Response::Rashify
@@ -1,3 +1,3 @@
1
1
  module Gems
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -19,12 +19,12 @@ describe Gems::Client do
19
19
 
20
20
  describe "#search" do
21
21
  before do
22
- stub_get("/api/v1/gems/search.json?query=cucumber").to_return(:body => fixture("search.json"))
22
+ stub_get("/api/v1/search.json?query=cucumber").to_return(:body => fixture("search.json"))
23
23
  end
24
24
 
25
25
  it "should return an array of active gems that match the query" do
26
26
  search = @client.search 'cucumber'
27
- a_get("/api/v1/gems/search.json?query=cucumber").should have_been_made
27
+ a_get("/api/v1/search.json?query=cucumber").should have_been_made
28
28
  search.first.name.should == 'cucumber'
29
29
  end
30
30
  end
@@ -7,11 +7,11 @@ require 'rspec'
7
7
  require 'webmock/rspec'
8
8
 
9
9
  def a_get(path)
10
- a_request(:get, 'http://rubygems.org' + path)
10
+ a_request(:get, 'https://rubygems.org' + path)
11
11
  end
12
12
 
13
13
  def stub_get(path)
14
- stub_request(:get, 'http://rubygems.org' + path)
14
+ stub_request(:get, 'https://rubygems.org' + path)
15
15
  end
16
16
 
17
17
  def fixture_path
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gems
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Erik Michaels-Ober
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-29 00:00:00 Z
13
+ date: 2011-05-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ZenTest