jsbin-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ script: "rake"
3
+ rvm:
4
+ - 1.9.3
5
+ - jruby-19mode # JRuby in 1.9 mode
@@ -1,4 +1,11 @@
1
- 23 May 2013
1
+ 29 May 2013
2
+ -----------
3
+ Version bump to 0.1.1 to fix SSL issue
4
+
5
+ 27 May 2013
2
6
  -----------
7
+ First release of version 0.1.0, along with Travis CI for build tests
3
8
 
9
+ 23 May 2013
10
+ -----------
4
11
  Gem created
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  jsbin-client
2
2
  ============
3
3
 
4
+ [![Build Status](https://travis-ci.org/mattheworiordan/jsbin-client.png)](https://travis-ci.org/mattheworiordan/jsbin-client)
5
+
4
6
  jsbin-client is a simple Ruby client for JSBin [http://jsbin.com/](http://jsbin.com/). It provides basic CRUD methods to retrieve a bin, create a bin, and create a revision for an existing bin.
5
7
 
6
8
  The library supports anonymous or token authentication if required by the server.
@@ -20,7 +20,7 @@ class JsBinClient
20
20
 
21
21
  private
22
22
  def end_point
23
- "#{@options.ssl? ? 'https' : 'http'}://#{@options.host}:#{@options.port}/#{API_PREFIX}"
23
+ "#{@options.ssl ? 'https' : 'http'}://#{@options.host}:#{@options.port}/#{API_PREFIX}"
24
24
  end
25
25
 
26
26
  def headers
@@ -1,3 +1,3 @@
1
1
  class JsBinClient
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -9,19 +9,26 @@ describe 'JsBinClient::Rest' do
9
9
 
10
10
  context 'should use the options' do
11
11
  before { stub_request(:get, url).to_return(status: 200, body: '{"response":"valid"}') }
12
- after { a_request(:get, url).with(:headers => {'authorization' => 'token 3'}).should have_been_made.once }
13
12
 
14
13
  specify do
15
14
  subject.get(bin_id)['response'].should == 'valid'
15
+ a_request(:get, url).with(:headers => {'authorization' => 'token 3'}).should have_been_made.once
16
16
  end
17
17
 
18
- it 'over SSL' do
19
- options.ssl = true
20
- subject.get(bin_id)['response'].should == 'valid'
18
+ context 'over SSL' do
19
+ before { stub_request(:get, url).to_return(status: 200, body: '{"response":"valid"}') }
20
+ let(:options) { OpenStruct.new({ host: 'host', port: 443, ssl: true, api_key: '5' }) }
21
+ let(:url) { "https://host:443/api/#{bin_id}" }
22
+
23
+ specify do
24
+ subject.get(bin_id)['response'].should == 'valid'
25
+ a_request(:get, url).with(:headers => {'authorization' => 'token 5'}).should have_been_made.once
26
+ end
21
27
  end
22
28
 
23
29
  it 'and return indifferent JSON' do
24
30
  subject.get(bin_id)[:response].should == 'valid'
31
+ a_request(:get, url).with(:headers => {'authorization' => 'token 3'}).should have_been_made.once
25
32
  end
26
33
  end
27
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsbin-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2013-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -69,6 +69,7 @@ extra_rdoc_files: []
69
69
  files:
70
70
  - .gitignore
71
71
  - .rspec
72
+ - .travis.yml
72
73
  - CHANGELOG.md
73
74
  - Gemfile
74
75
  - LICENSE
@@ -97,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
98
  version: '0'
98
99
  segments:
99
100
  - 0
100
- hash: -3100341442518055608
101
+ hash: 1155552177039950201
101
102
  required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  none: false
103
104
  requirements:
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  version: '0'
107
108
  segments:
108
109
  - 0
109
- hash: -3100341442518055608
110
+ hash: 1155552177039950201
110
111
  requirements: []
111
112
  rubyforge_project: jsbin-client
112
113
  rubygems_version: 1.8.24