qiita 1.1.0 → 1.1.1
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/CHANGELOG.md +3 -0
- data/lib/qiita/client.rb +7 -6
- data/lib/qiita/version.rb +1 -1
- data/spec/qiita/client_spec.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a07e81a06224f1bfe1b35e2d0f5a0ee5435a28f8
|
4
|
+
data.tar.gz: 9f6e470df28e6af846efa9e66b0b66a651d89f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13ba9b095052b531f9e63280fd28428b9ed720df9a206aa19503b837dc5d077143a03c133f0b03988d9a22843a7ea9af9e910599824b7d3acff334229cb0fab3
|
7
|
+
data.tar.gz: 0ce849d8f87acaea053154afedfff916f946cbad4f4b80508ef8789a032b3c748eb9d01efdd56f3ff7669b56c436d657953a51c844a2e59802d93160544c57f7
|
data/CHANGELOG.md
CHANGED
data/lib/qiita/client.rb
CHANGED
@@ -120,6 +120,10 @@ module Qiita
|
|
120
120
|
|
121
121
|
private
|
122
122
|
|
123
|
+
def base_host
|
124
|
+
@host || DEFAULT_HOST
|
125
|
+
end
|
126
|
+
|
123
127
|
def default_headers
|
124
128
|
headers = DEFAULT_HEADERS.clone
|
125
129
|
headers["Authorization"] = "Bearer #{@access_token}" if @access_token
|
@@ -137,13 +141,10 @@ module Qiita
|
|
137
141
|
end
|
138
142
|
|
139
143
|
def host
|
140
|
-
|
141
|
-
|
142
|
-
@host
|
143
|
-
when @team
|
144
|
-
"#{@team}.#{DEFAULT_HOST}"
|
144
|
+
if @team
|
145
|
+
"#{@team}.#{base_host}"
|
145
146
|
else
|
146
|
-
|
147
|
+
base_host
|
147
148
|
end
|
148
149
|
end
|
149
150
|
|
data/lib/qiita/version.rb
CHANGED
data/spec/qiita/client_spec.rb
CHANGED
@@ -203,6 +203,29 @@ describe Qiita::Client do
|
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
206
|
+
context "with :host and :team options" do
|
207
|
+
before do
|
208
|
+
options[:host] = host
|
209
|
+
options[:team] = team
|
210
|
+
end
|
211
|
+
|
212
|
+
let(:host) do
|
213
|
+
"example.com"
|
214
|
+
end
|
215
|
+
|
216
|
+
let(:team) do
|
217
|
+
"test"
|
218
|
+
end
|
219
|
+
|
220
|
+
let(:requested_host) do
|
221
|
+
[team, host].join(".")
|
222
|
+
end
|
223
|
+
|
224
|
+
it "sends request to configured host including team as subdomain" do
|
225
|
+
should be_a Qiita::Response
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
206
229
|
context "with a Qiita::Client created with :access_token option" do
|
207
230
|
before do
|
208
231
|
options[:access_token] = access_token
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|