docodoco_jp 0.1.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/README.md +1 -0
- data/docodoco_jp.gemspec +2 -8
- data/fixtures/test_apikey.yml +2 -0
- data/lib/docodoco_jp/version.rb +1 -1
- data/lib/docodoco_jp.rb +11 -2
- metadata +19 -6
- data/fixtures/sample_api_key.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c5722306e5c4d5cb73393dd829937c8beafe94
|
4
|
+
data.tar.gz: 4a1b35aa2f151ef3eb7bc1227178ea1c5b7aef03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f61e05da2a465d6f7a4ba50bc9a6cc8a8a5456dd5eecbc363c87a648a7d89b73a6277bfaf32de2004582a2a23c237a243a0f9a2919c94f747d88d6b905c5bbd
|
7
|
+
data.tar.gz: fb3c9e6549d3352ed435cc3c68cc14f736ecaba07b6c687ac2ead15a2a3f75150ce4c882f064fb94d471cc07fc4ea99376960aac43251499c8e91df6eb900f18
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/docodoco_jp.gemspec
CHANGED
@@ -4,6 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'docodoco_jp/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
+
spec.required_ruby_version = '>= 1.9.3'
|
7
8
|
spec.name = "docodoco_jp"
|
8
9
|
spec.version = DocodocoJp::VERSION
|
9
10
|
spec.authors = ["Hiroshi IKEGAMI"]
|
@@ -14,14 +15,6 @@ Gem::Specification.new do |spec|
|
|
14
15
|
spec.homepage = "https://github.com/magicdrive/ruby-docodoco_jp"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
-
# delete this section to allow pushing this gem to any host.
|
19
|
-
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
|
-
else
|
22
|
-
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
-
end
|
24
|
-
|
25
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
19
|
spec.bindir = "exe"
|
27
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -33,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
33
26
|
|
34
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
35
28
|
spec.add_development_dependency "pry"
|
29
|
+
spec.add_development_dependency "rack"
|
36
30
|
spec.add_development_dependency "bundler", "~> 1.0"
|
37
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
38
32
|
end
|
data/lib/docodoco_jp/version.rb
CHANGED
data/lib/docodoco_jp.rb
CHANGED
@@ -13,13 +13,22 @@ require 'rexml/document'
|
|
13
13
|
|
14
14
|
class DocodocoJp
|
15
15
|
|
16
|
-
|
16
|
+
DEFAULT_API_HOST = 'api.docodoco.jp'
|
17
17
|
|
18
18
|
attr_reader :apikey
|
19
19
|
attr_reader :config
|
20
20
|
attr_reader :user_valid
|
21
21
|
|
22
22
|
class << self
|
23
|
+
def api_host=(host)
|
24
|
+
@api_host = host
|
25
|
+
end
|
26
|
+
|
27
|
+
def api_host
|
28
|
+
@api_host = DEFAULT_API_HOST if @api_host.nil?
|
29
|
+
return @api_host
|
30
|
+
end
|
31
|
+
|
23
32
|
def default_config
|
24
33
|
return {
|
25
34
|
ssl: true,
|
@@ -91,7 +100,7 @@ class DocodocoJp
|
|
91
100
|
return @connection ||= ->() {
|
92
101
|
protocol = config[:ssl] ? "https" : "http"
|
93
102
|
options = config[:ssl] ? { ssl: { verify: true } } : {}
|
94
|
-
Faraday.new("#{protocol}://#{
|
103
|
+
Faraday.new("#{protocol}://#{DocodocoJp::api_host}", options) do |builder|
|
95
104
|
builder.request :url_encoded
|
96
105
|
builder.response :logger if config[:faraday_log]
|
97
106
|
builder.adapter :net_http
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docodoco_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi IKEGAMI
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rack
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: bundler
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +141,7 @@ files:
|
|
127
141
|
- bin/setup
|
128
142
|
- docodoco_jp.gemspec
|
129
143
|
- exe/docodoco_jp
|
130
|
-
- fixtures/
|
144
|
+
- fixtures/test_apikey.yml
|
131
145
|
- lib/docodoco_jp.rb
|
132
146
|
- lib/docodoco_jp/api_key_invalid.rb
|
133
147
|
- lib/docodoco_jp/cli.rb
|
@@ -136,8 +150,7 @@ files:
|
|
136
150
|
homepage: https://github.com/magicdrive/ruby-docodoco_jp
|
137
151
|
licenses:
|
138
152
|
- MIT
|
139
|
-
metadata:
|
140
|
-
allowed_push_host: https://rubygems.org
|
153
|
+
metadata: {}
|
141
154
|
post_install_message:
|
142
155
|
rdoc_options: []
|
143
156
|
require_paths:
|
@@ -146,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
159
|
requirements:
|
147
160
|
- - ">="
|
148
161
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
162
|
+
version: 1.9.3
|
150
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
164
|
requirements:
|
152
165
|
- - ">="
|
data/fixtures/sample_api_key.yml
DELETED