takeout 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +130 -0
- data/lib/takeout/client.rb +8 -4
- data/lib/takeout/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c60e6c0a2597c9408cb008b699eb6041f0b570b
|
4
|
+
data.tar.gz: a307dba4655560c5300245209a579b870d325ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1efad110835409cdbcf6a108b74d54cfab63aefd8aecc44193e3b81681712e4938498871b6b7edbd3557a6349319f0e204d24574e1e4320ab9041dc371eebb62
|
7
|
+
data.tar.gz: c82eb479e740e6645f3672295099f39e73a81079b4f249b7800b1c629663a8e518639baf8179d30135ed73aa7de68fe02db318f142fd899ae3756e419b0d3583
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
takeout (1.0.4)
|
5
|
+
curb (~> 0.8.8)
|
6
|
+
liquid
|
7
|
+
oj
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.3.6)
|
13
|
+
celluloid (0.16.0)
|
14
|
+
timers (~> 4.0.0)
|
15
|
+
codeclimate-test-reporter (0.4.7)
|
16
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
17
|
+
coderay (1.1.0)
|
18
|
+
crack (0.4.2)
|
19
|
+
safe_yaml (~> 1.0.0)
|
20
|
+
curb (0.8.8)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
docile (1.1.5)
|
23
|
+
ffi (1.9.8)
|
24
|
+
formatador (0.2.5)
|
25
|
+
guard (2.12.5)
|
26
|
+
formatador (>= 0.2.4)
|
27
|
+
listen (~> 2.7)
|
28
|
+
lumberjack (~> 1.0)
|
29
|
+
nenv (~> 0.1)
|
30
|
+
notiffany (~> 0.0)
|
31
|
+
pry (>= 0.9.12)
|
32
|
+
shellany (~> 0.0)
|
33
|
+
thor (>= 0.18.1)
|
34
|
+
guard-bundler (2.1.0)
|
35
|
+
bundler (~> 1.0)
|
36
|
+
guard (~> 2.2)
|
37
|
+
guard-compat (~> 1.1)
|
38
|
+
guard-compat (1.2.1)
|
39
|
+
guard-rake (1.0.0)
|
40
|
+
guard
|
41
|
+
rake
|
42
|
+
guard-rspec (4.5.0)
|
43
|
+
guard (~> 2.1)
|
44
|
+
guard-compat (~> 1.1)
|
45
|
+
rspec (>= 2.99.0, < 4.0)
|
46
|
+
guard-yard (2.1.4)
|
47
|
+
guard (>= 1.1.0)
|
48
|
+
yard (>= 0.7.0)
|
49
|
+
hitimes (1.2.2)
|
50
|
+
json (1.8.2)
|
51
|
+
liquid (3.0.6)
|
52
|
+
listen (2.10.0)
|
53
|
+
celluloid (~> 0.16.0)
|
54
|
+
rb-fsevent (>= 0.9.3)
|
55
|
+
rb-inotify (>= 0.9)
|
56
|
+
lumberjack (1.0.9)
|
57
|
+
method_source (0.8.2)
|
58
|
+
nenv (0.2.0)
|
59
|
+
notiffany (0.0.6)
|
60
|
+
nenv (~> 0.1)
|
61
|
+
shellany (~> 0.0)
|
62
|
+
oj (2.14.4)
|
63
|
+
pry (0.10.1)
|
64
|
+
coderay (~> 1.1.0)
|
65
|
+
method_source (~> 0.8.1)
|
66
|
+
slop (~> 3.4)
|
67
|
+
rack (1.6.4)
|
68
|
+
rack-protection (1.5.3)
|
69
|
+
rack
|
70
|
+
rake (10.4.2)
|
71
|
+
rb-fsevent (0.9.4)
|
72
|
+
rb-inotify (0.9.5)
|
73
|
+
ffi (>= 0.5.0)
|
74
|
+
rspec (3.2.0)
|
75
|
+
rspec-core (~> 3.2.0)
|
76
|
+
rspec-expectations (~> 3.2.0)
|
77
|
+
rspec-mocks (~> 3.2.0)
|
78
|
+
rspec-core (3.2.3)
|
79
|
+
rspec-support (~> 3.2.0)
|
80
|
+
rspec-expectations (3.2.1)
|
81
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
+
rspec-support (~> 3.2.0)
|
83
|
+
rspec-mocks (3.2.1)
|
84
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
+
rspec-support (~> 3.2.0)
|
86
|
+
rspec-support (3.2.2)
|
87
|
+
safe_yaml (1.0.4)
|
88
|
+
shellany (0.0.1)
|
89
|
+
simplecov (0.10.0)
|
90
|
+
docile (~> 1.1.0)
|
91
|
+
json (~> 1.8)
|
92
|
+
simplecov-html (~> 0.10.0)
|
93
|
+
simplecov-html (0.10.0)
|
94
|
+
sinatra (1.4.6)
|
95
|
+
rack (~> 1.4)
|
96
|
+
rack-protection (~> 1.4)
|
97
|
+
tilt (>= 1.3, < 3)
|
98
|
+
slop (3.6.0)
|
99
|
+
terminal-notifier-guard (1.6.4)
|
100
|
+
thor (0.19.1)
|
101
|
+
tilt (2.0.1)
|
102
|
+
timers (4.0.1)
|
103
|
+
hitimes
|
104
|
+
webmock (1.20.4)
|
105
|
+
addressable (>= 2.3.6)
|
106
|
+
crack (>= 0.3.2)
|
107
|
+
yard (0.8.7.6)
|
108
|
+
|
109
|
+
PLATFORMS
|
110
|
+
ruby
|
111
|
+
|
112
|
+
DEPENDENCIES
|
113
|
+
bundler (~> 1.6)
|
114
|
+
codeclimate-test-reporter
|
115
|
+
curb (~> 0.8.8)
|
116
|
+
guard (= 2.12.5)
|
117
|
+
guard-bundler
|
118
|
+
guard-rake
|
119
|
+
guard-rspec (= 4.5.0)
|
120
|
+
guard-yard
|
121
|
+
rack (>= 1.6.2)
|
122
|
+
rake
|
123
|
+
rspec
|
124
|
+
sinatra
|
125
|
+
takeout!
|
126
|
+
terminal-notifier-guard
|
127
|
+
webmock
|
128
|
+
|
129
|
+
BUNDLED WITH
|
130
|
+
1.10.6
|
data/lib/takeout/client.rb
CHANGED
@@ -28,6 +28,8 @@ module Takeout
|
|
28
28
|
attr_accessor :uri
|
29
29
|
|
30
30
|
attr_accessor :port
|
31
|
+
|
32
|
+
attr_accessor :endpoint_prefix
|
31
33
|
|
32
34
|
# A constant specifying the kind of event callbacks and if they should or should not raise an error
|
33
35
|
CALLBACKS = {failure: true, missing: true, redirect: false, success: false}
|
@@ -138,14 +140,14 @@ module Takeout
|
|
138
140
|
|
139
141
|
# Generate URL based on if the custom schema exists, and if there is a given object_id
|
140
142
|
request_url = if custom_schema.nil? || (custom_schema && custom_schema.empty?)
|
141
|
-
(options[:object_id] ? url("/#{endpoint_name.to_s}/#{options[:object_id]}") : url("/#{endpoint_name.to_s}"))
|
143
|
+
(options[:object_id] ? url("#{@endpoint_prefix}/#{endpoint_name.to_s}/#{options[:object_id]}") : url("#{@endpoint_prefix}/#{endpoint_name.to_s}"))
|
142
144
|
else
|
143
145
|
url(custom_schema)
|
144
146
|
end
|
145
147
|
|
146
148
|
# Append extension if one is given
|
147
149
|
request_url = append_extension(request_url, options)
|
148
|
-
|
150
|
+
|
149
151
|
return request_url, options
|
150
152
|
end
|
151
153
|
|
@@ -162,14 +164,16 @@ module Takeout
|
|
162
164
|
@debug = options[:debug]
|
163
165
|
@ssl = options[:ssl]
|
164
166
|
@extension = options[:extension]
|
167
|
+
@endpoint_prefix = options[:endpoint_prefix]
|
168
|
+
@port = options[:port]
|
165
169
|
|
166
170
|
# Clean instance variables out of options hash and set that as options instance variable
|
167
|
-
[:uri, :endpoints, :headers, :debug, :ssl, :schemas, :extension].each { |v| options.delete(v) }
|
171
|
+
[:uri, :endpoints, :headers, :debug, :ssl, :schemas, :extension, :endpoint_prefix, :port].each { |v| options.delete(v) }
|
168
172
|
@options = options
|
169
173
|
end
|
170
174
|
|
171
175
|
def url(endpoint=nil)
|
172
|
-
opts = port? ? {host: @uri, path: endpoint, port: port} : {host: @uri, path: endpoint}
|
176
|
+
opts = port? ? {host: @uri, path: endpoint, port: @port} : {host: @uri, path: endpoint}
|
173
177
|
ssl? ? URI::HTTPS.build(opts) : URI::HTTP.build(opts)
|
174
178
|
end
|
175
179
|
|
data/lib/takeout/version.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Lucas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- ".gitignore"
|
147
147
|
- ".rspec"
|
148
148
|
- Gemfile
|
149
|
+
- Gemfile.lock
|
149
150
|
- Guardfile
|
150
151
|
- LICENSE.txt
|
151
152
|
- README.md
|
@@ -183,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
184
|
version: '0'
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.5.1
|
187
188
|
signing_key:
|
188
189
|
specification_version: 4
|
189
190
|
summary: A powerful little tool for generating on-the-fly API clients.
|
@@ -193,4 +194,3 @@ test_files:
|
|
193
194
|
- spec/support/fake_test_api.rb
|
194
195
|
- spec/support/fixtures/post.json
|
195
196
|
- spec/support/fixtures/posts.json
|
196
|
-
has_rdoc:
|