takeout 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40f6ac479b705e18b5a3bfe835f7246573ee3047
4
- data.tar.gz: 28b76878cd8de120cdae8de967a6d7016242c2d3
3
+ metadata.gz: 2031cb01ff9f1e947b56c0425e139c1844d9c900
4
+ data.tar.gz: 40cc086b045ed2774bf546636d3bc30afdedef2c
5
5
  SHA512:
6
- metadata.gz: 80ef2d524ba29db29b2743492b463e9f1b1f853afed7157f1c34bdb6c9296cd8484af1eb2bc4dfc600ba10eb410fc4ff6d8e91d9eeb3cf783efca930a305350b
7
- data.tar.gz: 806bb933cd151d8803972727531d520fb7442bdd7ce74aed6d8cda7918b66e922ddc62db590e41ed351bbce611f7475cdba0a41cd1f08a11cd3e3f68b6dc0be8
6
+ metadata.gz: ac33508401257dedea5dd3c577bd9d94e2c6c87d4341e90a24fb9b6b46ee746ac461d986d1066add3cfe274e63fc6b6a5914d5d66d5ff3bfae35a6203eade998
7
+ data.tar.gz: 6090c18d3bebfe54cfcc689a881d1814aa12d3a8dd3ead6ef40a6c454697b3def7ebc22c9a29aaa295f8f235fefc3f9415ef3ec4e34cda5eed75bbb5f995bc76
data/README.md CHANGED
@@ -1,11 +1,17 @@
1
1
  # Takeout
2
- [![Gem Version](https://badge.fury.io/rb/takeout.svg)](http://badge.fury.io/rb/takeout) [![Code Climate](https://codeclimate.com/github/kylegrantlucas/takeout/badges/gpa.svg)](https://codeclimate.com/github/kylegrantlucas/takeout) [![Test Coverage](https://codeclimate.com/github/kylegrantlucas/takeout/badges/coverage.svg)](https://codeclimate.com/github/kylegrantlucas/takeout/coverage) [![Circle CI](https://circleci.com/gh/kylegrantlucas/takeout/tree/master.svg?style=shield)](https://circleci.com/gh/kylegrantlucas/takeout/tree/master) [![Inline docs](http://inch-ci.org/github/kylegrantlucas/takeout.svg?branch=master&style=shields)](http://inch-ci.org/github/kylegrantlucas/takeout)
2
+ [![Gem Version](https://badge.fury.io/rb/takeout.svg)](http://badge.fury.io/rb/takeout)
3
+ [![Code Climate](https://codeclimate.com/github/kylegrantlucas/takeout/badges/gpa.svg)](https://codeclimate.com/github/kylegrantlucas/takeout)
4
+ [![Test Coverage](https://codeclimate.com/github/kylegrantlucas/takeout/badges/coverage.svg)](https://codeclimate.com/github/kylegrantlucas/takeout/coverage)
5
+ [![Circle CI](https://circleci.com/gh/kylegrantlucas/takeout/tree/master.svg?style=shield)](https://circleci.com/gh/kylegrantlucas/takeout/tree/master)
6
+ [![Inline docs](http://inch-ci.org/github/kylegrantlucas/takeout.svg?branch=master&style=shields)](http://inch-ci.org/github/kylegrantlucas/takeout)
7
+ [![Join the chat at https://gitter.im/kylegrantlucas/takeout](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kylegrantlucas/takeout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
+ [![Analytics](https://ga-beacon.appspot.com/UA-62799576-1/kylegrantlucas/takeout?pixel)](https://github.com/igrigorik/ga-beacon)
3
9
 
4
10
  A powerful little tool for generating on-the-fly API clients.
5
11
 
6
12
  ## Requirements
7
13
 
8
- All versions of MRI 1.9.3+ and up are supported, currently un supported on JRuby, MRI 1.8-1.9.2, and Rubinus.
14
+ All versions of MRI 1.9.3+ and up are supported (and tested via CircleCI), the gem is currently unsupported on JRuby, MRI 1.8-1.9.2, and Rubinus.
9
15
  Support of these platforms is a future goal for the project.
10
16
 
11
17
  ## Installation
@@ -57,7 +63,7 @@ Results are returned as parsed ruby objects:
57
63
  #### Extensions
58
64
 
59
65
  You have the ability to specify an extension that gets tacked on, if you need it.
60
- You may do this in either the call or in teh client instantiation, however the call will always override the clients extension if there is a confilct.
66
+ You may do this in either the call or in the client instantiation, however the call will always override the clients extension if there is a conflict.
61
67
 
62
68
  client = Takeout::Client.new do |client|
63
69
  client.uri = 'testing.com'
@@ -91,7 +97,7 @@ As you can see in the above example I use ```{{endpoint}}``` as one of the templ
91
97
 
92
98
  #### SSL Support
93
99
 
94
- SSL is also supported, and it very easy to flip on.
100
+ SSL is also supported, and is very easy to flip on.
95
101
 
96
102
  You can either specify ssl when instantiating the object:
97
103
 
data/circle.yml CHANGED
@@ -1,3 +1,9 @@
1
+ notify:
2
+ webhooks:
3
+ # A list of hook hashes, containing the url field
4
+ # gitter hook
5
+ - url: https://webhooks.gitter.im/e/482b7426af309c0a6099
6
+
1
7
  dependencies:
2
8
  override:
3
9
  - >
@@ -30,6 +30,8 @@ module Takeout
30
30
  # @return [Hash] the hash containing the endpoints by request type to generate methods for
31
31
  attr_reader :endpoints
32
32
 
33
+ attr_accessor :port
34
+
33
35
  # A constant specifying the kind of event callbacks to raise errors for
34
36
  FAILURES = [:failure, :missing, :redirect]
35
37
 
@@ -59,6 +61,12 @@ module Takeout
59
61
  return @ssl
60
62
  end
61
63
 
64
+ # Check if a port is specified.
65
+ # @return [Boolean] Returns true if a port is enabled, false if nil.
66
+ def port?
67
+ return !port.nil?
68
+ end
69
+
62
70
  # Sets the instance variable and then generates the dynamic methods by calling #generate_enpoint_methods
63
71
  # @param [Hash] value A hash specifying the custom per-endpoint schema templates
64
72
  def endpoints=(value)
@@ -200,7 +208,8 @@ module Takeout
200
208
  end
201
209
 
202
210
  def url(endpoint=nil)
203
- ssl? ? URI::HTTPS.build(host: @uri, path: endpoint) : URI::HTTP.build(host: @uri, path: endpoint)
211
+ opts = port? ? {host: @uri, path: endpoint, port: port} : {host: @uri, path: endpoint}
212
+ ssl? ? URI::HTTPS.build(opts) : URI::HTTP.build(opts)
204
213
  end
205
214
  end
206
215
  end
@@ -1,3 +1,3 @@
1
1
  module Takeout
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -10,6 +10,10 @@ describe Takeout::Client do
10
10
  :put_posts, :put_fake_failure, :put_fake_missing, :put_fake_redirect,
11
11
  :delete_posts, :delete_fake_failure, :delete_fake_missing, :delete_fake_redirect])
12
12
  end
13
+
14
+ it 'yeilds when block is given' do
15
+ expect { |b| Takeout::Client.new(&b) }.to yield_with_args (Takeout::Client)
16
+ end
13
17
  end
14
18
 
15
19
  context 'ssl' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takeout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Lucas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-10 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler