grape-client-generator 1.0.2 → 1.0.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 +4 -4
- data/History.txt +4 -0
- data/lib/grape/client-generator/ruby/mustache/api.mustache +12 -2
- data/lib/grape/client-generator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 566aaf7d205d984fe45cca034afaec1220d3f258
|
4
|
+
data.tar.gz: f69e07116315a31d7e380e0ee7cb79d9818fae34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1388c6e637e3360b19f8fccf8eb58d3aed13c730ca39388959e03e0e6d01f5bb0e5ec1fe8ef54696e4165d5c6add0de4149126754f38a24411c3ec30630799d9
|
7
|
+
data.tar.gz: f0687cc8ee2e3fd557092359b6668b83bdee4a0801a2b5aacaff253fd4ad5668651ccf68a576bf8271374770ad2be5c8fb55bc52c710c2f800a2dfe5e2393e95
|
data/History.txt
CHANGED
@@ -80,7 +80,7 @@ module {{namespace}}
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def post(url, params)
|
83
|
-
uri =
|
83
|
+
uri = parse_uri(url)
|
84
84
|
http = Net::HTTP.new(uri.host, uri.port)
|
85
85
|
request = Net::HTTP::Post.new(uri.path)
|
86
86
|
request.body = make_param_string(params)
|
@@ -89,9 +89,19 @@ module {{namespace}}
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def get(url)
|
92
|
-
resp = Net::HTTP.get_response(
|
92
|
+
resp = Net::HTTP.get_response(parse_uri(url))
|
93
93
|
resp.body
|
94
94
|
end
|
95
95
|
|
96
|
+
# hack to handle bug in URI.parse, which doesn't allow subdomains to contain underscores
|
97
|
+
def parse_uri(url = nil)
|
98
|
+
URI.parse(url)
|
99
|
+
rescue URI::InvalidURIError
|
100
|
+
host = url.match(".+\:\/\/([^\/]+)")[1]
|
101
|
+
uri = URI.parse(url.sub(host, 'dummy-host'))
|
102
|
+
uri.instance_variable_set('@host', host)
|
103
|
+
uri
|
104
|
+
end
|
105
|
+
|
96
106
|
end
|
97
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-client-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mustache
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
73
|
+
rubygems_version: 2.1.5
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Automatically generate clients for your Grape APIs.
|