qiita 1.0.7 → 1.1.0
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/README.md +1 -0
- data/doc/client.md +4 -0
- data/lib/qiita/arguments.rb +5 -0
- data/lib/qiita/client.rb +14 -2
- data/lib/qiita/commands/request.rb +1 -0
- data/lib/qiita/version.rb +1 -1
- 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: 08a53dd50aa4de2458e4402a963e6fd3ba09443a
|
4
|
+
data.tar.gz: b819b9c447eda41b1a3d6087572ba6777d446f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83f9b97799f869b6f54d5da5404d8746e31680cb0c5aecbc8e52425c0ddc9bb98bd842a8ca72f81d8c2e4ae94673d51945cf2394b72963cb413d04b5f243406a
|
7
|
+
data.tar.gz: 822077c30bcf3146e8427ba2cb9832290cb5bf12869a3f3335a93899032f34e7b83b38b0224f0f62827714d72f7e1592c01b23bc1776265006febe4b5e0570fe
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/doc/client.md
CHANGED
@@ -4,6 +4,7 @@ Creates a new instance of `Qiita::Client` class.
|
|
4
4
|
|
5
5
|
* `access_token` - (String) Access token issued to authenticate and authorize user.
|
6
6
|
* `host` - (String) Hostname where this client accesses to.
|
7
|
+
* `ssl` - (Boolean) Use SSL verification. (default: true)
|
7
8
|
* `team` - (String) Team name to be used as subdomain.
|
8
9
|
|
9
10
|
```rb
|
@@ -90,6 +91,9 @@ client.connection.response :logger
|
|
90
91
|
### Qiita::Client#list_items(params = nil, headers = nil)
|
91
92
|
投稿の一覧を返します。
|
92
93
|
|
94
|
+
### Qiita::Client#list_authenticated_user_items(params = nil, headers = nil)
|
95
|
+
認証中のユーザの投稿の一覧を返します。
|
96
|
+
|
93
97
|
### Qiita::Client#create_item(params = nil, headers = nil)
|
94
98
|
新たに投稿を作成します。
|
95
99
|
|
data/lib/qiita/arguments.rb
CHANGED
@@ -28,6 +28,10 @@ module Qiita
|
|
28
28
|
slop_options["host"]
|
29
29
|
end
|
30
30
|
|
31
|
+
def ssl
|
32
|
+
!slop_options["no-ssl-verification"]
|
33
|
+
end
|
34
|
+
|
31
35
|
def method_name
|
32
36
|
ARGV[0]
|
33
37
|
end
|
@@ -131,6 +135,7 @@ module Qiita
|
|
131
135
|
on "h", "help", "Display help message"
|
132
136
|
on "header", "Show response header"
|
133
137
|
on "no-body", "Hide response body"
|
138
|
+
on "no-ssl-verification", "Ignore SSL verification"
|
134
139
|
on "t", "team=", "Team name to be used as subdomain"
|
135
140
|
end
|
136
141
|
end
|
data/lib/qiita/client.rb
CHANGED
@@ -26,6 +26,7 @@ module Qiita
|
|
26
26
|
#
|
27
27
|
# * `access_token` - (String) Access token issued to authenticate and authorize user.
|
28
28
|
# * `host` - (String) Hostname where this client accesses to.
|
29
|
+
# * `ssl` - (Boolean) Use SSL verification. (default: true)
|
29
30
|
# * `team` - (String) Team name to be used as subdomain.
|
30
31
|
#
|
31
32
|
# ```rb
|
@@ -35,9 +36,10 @@ module Qiita
|
|
35
36
|
# Qiita::Client.new(team: "my-team-name")
|
36
37
|
# ```
|
37
38
|
#
|
38
|
-
def initialize(access_token: nil, host: nil, team: nil)
|
39
|
+
def initialize(access_token: nil, host: nil, ssl: true, team: nil)
|
39
40
|
@access_token = access_token
|
40
41
|
@host = host
|
42
|
+
@ssl = ssl
|
41
43
|
@team = team
|
42
44
|
end
|
43
45
|
|
@@ -109,7 +111,7 @@ module Qiita
|
|
109
111
|
# ```
|
110
112
|
#
|
111
113
|
def connection
|
112
|
-
@connection ||= Faraday.new(
|
114
|
+
@connection ||= Faraday.new(faraday_client_options) do |connection|
|
113
115
|
connection.request :json
|
114
116
|
connection.response :json
|
115
117
|
connection.adapter Faraday.default_adapter
|
@@ -124,6 +126,16 @@ module Qiita
|
|
124
126
|
headers
|
125
127
|
end
|
126
128
|
|
129
|
+
def faraday_client_options
|
130
|
+
{
|
131
|
+
headers: default_headers,
|
132
|
+
ssl: {
|
133
|
+
verify: @ssl,
|
134
|
+
},
|
135
|
+
url: url_prefix,
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
127
139
|
def host
|
128
140
|
case
|
129
141
|
when @host
|
data/lib/qiita/version.rb
CHANGED
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.0
|
4
|
+
version: 1.1.0
|
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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|