mushikago-sdk 0.3.7 → 0.4.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.
Files changed (117) hide show
  1. data/README.md +45 -1
  2. data/doc/Mushikago.html +3 -3
  3. data/doc/Mushikago/Auth.html +1 -1
  4. data/doc/Mushikago/Auth/Signature.html +2 -2
  5. data/doc/Mushikago/Auth/Signer.html +1 -1
  6. data/doc/Mushikago/Config.html +1 -1
  7. data/doc/Mushikago/Hotaru.html +3 -3
  8. data/doc/Mushikago/Hotaru/ClassifierJudgeRequest.html +307 -0
  9. data/doc/Mushikago/Hotaru/Client.html +3511 -155
  10. data/doc/Mushikago/Hotaru/CollocationCreateRequest.html +375 -0
  11. data/doc/Mushikago/Hotaru/CollocationDeleteRequest.html +307 -0
  12. data/doc/Mushikago/Hotaru/CollocationDownloadRequest.html +307 -0
  13. data/doc/Mushikago/Hotaru/CollocationGetRequest.html +309 -0
  14. data/doc/Mushikago/Hotaru/CollocationListRequest.html +313 -0
  15. data/doc/Mushikago/Hotaru/CollocationWordlistRequest.html +313 -0
  16. data/doc/Mushikago/Hotaru/DictionaryDeleteRequest.html +305 -0
  17. data/doc/Mushikago/Hotaru/DictionaryListRequest.html +309 -0
  18. data/doc/Mushikago/Hotaru/DictionaryPutRequest.html +342 -0
  19. data/doc/Mushikago/Hotaru/DomainCreateRequest.html +313 -0
  20. data/doc/Mushikago/Hotaru/DomainDeleteRequest.html +305 -0
  21. data/doc/Mushikago/Hotaru/DomainInfoRequest.html +307 -0
  22. data/doc/Mushikago/Hotaru/DomainListRequest.html +311 -0
  23. data/doc/Mushikago/Hotaru/TagDeleteRequest.html +307 -0
  24. data/doc/Mushikago/Hotaru/TagListRequest.html +307 -0
  25. data/doc/Mushikago/Hotaru/TagPutRequest.html +307 -0
  26. data/doc/Mushikago/Hotaru/TextDeleteRequest.html +309 -0
  27. data/doc/Mushikago/Hotaru/TextGetRequest.html +307 -0
  28. data/doc/Mushikago/Hotaru/TextListRequest.html +315 -0
  29. data/doc/Mushikago/Hotaru/TextPutRequest.html +311 -0
  30. data/doc/Mushikago/Hotaru/TextTagsetRequest.html +311 -0
  31. data/doc/Mushikago/Hotaru/WordGetRequest.html +307 -0
  32. data/doc/Mushikago/Hotaru/WordListRequest.html +311 -0
  33. data/doc/Mushikago/Http.html +3 -3
  34. data/doc/Mushikago/Http/Client.html +104 -13
  35. data/doc/Mushikago/Http/DeleteRequest.html +240 -0
  36. data/doc/Mushikago/Http/GetRequest.html +240 -0
  37. data/doc/Mushikago/Http/MultipartPostRequest.html +265 -0
  38. data/doc/Mushikago/Http/MultipartPutRequest.html +265 -0
  39. data/doc/Mushikago/Http/MultipartRequest.html +7 -11
  40. data/doc/Mushikago/Http/PostRequest.html +240 -0
  41. data/doc/Mushikago/Http/PutRequest.html +240 -0
  42. data/doc/Mushikago/Http/Request.html +46 -133
  43. data/doc/Mushikago/Http/Response.html +56 -1
  44. data/doc/Mushikago/Mitsubachi.html +3 -3
  45. data/doc/Mushikago/Mitsubachi/Client.html +2 -2
  46. data/doc/Mushikago/Mitsubachi/HttpFetchRequest.html +13 -57
  47. data/doc/Mushikago/Mitsubachi/HttpPushRequest.html +13 -57
  48. data/doc/Mushikago/Mitsubachi/Project.html +1 -1
  49. data/doc/Mushikago/Mitsubachi/ProjectCreateRequest.html +13 -57
  50. data/doc/Mushikago/Mitsubachi/ProjectDeleteRequest.html +13 -57
  51. data/doc/Mushikago/Mitsubachi/ProjectDiscontinueRequest.html +13 -57
  52. data/doc/Mushikago/Mitsubachi/ProjectInfoRequest.html +13 -8
  53. data/doc/Mushikago/Mitsubachi/ProjectListRequest.html +13 -8
  54. data/doc/Mushikago/Mitsubachi/ProjectQueuesRequest.html +13 -8
  55. data/doc/Mushikago/Mitsubachi/ProjectUpdateRequest.html +13 -57
  56. data/doc/Mushikago/Mitsubachi/Projects.html +1 -1
  57. data/doc/Mushikago/Mitsubachi/Resource.html +1 -1
  58. data/doc/Mushikago/Mitsubachi/ResourceDeleteRequest.html +13 -57
  59. data/doc/Mushikago/Mitsubachi/ResourceGetRequest.html +13 -8
  60. data/doc/Mushikago/Mitsubachi/ResourceListRequest.html +13 -8
  61. data/doc/Mushikago/Mitsubachi/ResourceStoreRequest.html +13 -57
  62. data/doc/Mushikago/Mitsubachi/Resources.html +1 -1
  63. data/doc/Mushikago/Mitsubachi/Script.html +1 -1
  64. data/doc/Mushikago/Mitsubachi/ScriptDeleteRequest.html +13 -57
  65. data/doc/Mushikago/Mitsubachi/ScriptDeployRequest.html +13 -57
  66. data/doc/Mushikago/Mitsubachi/ScriptGetRequest.html +13 -8
  67. data/doc/Mushikago/Mitsubachi/ScriptListRequest.html +13 -8
  68. data/doc/Mushikago/Mitsubachi/Scripts.html +1 -1
  69. data/doc/Mushikago/Tombo.html +3 -3
  70. data/doc/Mushikago/Tombo/CaptureRequest.html +13 -57
  71. data/doc/Mushikago/Tombo/CapturesRequest.html +13 -8
  72. data/doc/Mushikago/Tombo/Client.html +2 -2
  73. data/doc/Mushikago/Tombo/DeleteRequest.html +13 -57
  74. data/doc/Mushikago/Tombo/InfoRequest.html +13 -8
  75. data/doc/_index.html +227 -29
  76. data/doc/class_list.html +1 -1
  77. data/doc/file.README.html +51 -2
  78. data/doc/index.html +51 -2
  79. data/doc/method_list.html +728 -256
  80. data/doc/top-level-namespace.html +1 -1
  81. data/lib/mushikago/hotaru.rb +35 -12
  82. data/lib/mushikago/hotaru/classifier_judge_request.rb +16 -0
  83. data/lib/mushikago/hotaru/client.rb +325 -27
  84. data/lib/mushikago/hotaru/collocation_create_request.rb +35 -0
  85. data/lib/mushikago/hotaru/collocation_delete_request.rb +16 -0
  86. data/lib/mushikago/hotaru/collocation_download_request.rb +16 -0
  87. data/lib/mushikago/hotaru/collocation_get_request.rb +18 -0
  88. data/lib/mushikago/hotaru/collocation_list_request.rb +23 -0
  89. data/lib/mushikago/hotaru/collocation_wordlist_request.rb +22 -0
  90. data/lib/mushikago/hotaru/dictionary_delete_request.rb +14 -0
  91. data/lib/mushikago/hotaru/dictionary_list_request.rb +23 -0
  92. data/lib/mushikago/hotaru/dictionary_put_request.rb +26 -0
  93. data/lib/mushikago/hotaru/domain_create_request.rb +23 -0
  94. data/lib/mushikago/hotaru/domain_delete_request.rb +14 -0
  95. data/lib/mushikago/hotaru/domain_info_request.rb +20 -0
  96. data/lib/mushikago/hotaru/domain_list_request.rb +21 -0
  97. data/lib/mushikago/hotaru/tag_delete_request.rb +18 -0
  98. data/lib/mushikago/hotaru/tag_list_request.rb +16 -0
  99. data/lib/mushikago/hotaru/tag_put_request.rb +17 -0
  100. data/lib/mushikago/hotaru/text_delete_request.rb +18 -0
  101. data/lib/mushikago/hotaru/text_get_request.rb +16 -0
  102. data/lib/mushikago/hotaru/text_list_request.rb +25 -0
  103. data/lib/mushikago/hotaru/text_put_request.rb +20 -0
  104. data/lib/mushikago/hotaru/text_tagset_request.rb +20 -0
  105. data/lib/mushikago/hotaru/word_get_request.rb +16 -0
  106. data/lib/mushikago/hotaru/word_list_request.rb +20 -0
  107. data/lib/mushikago/http/client.rb +5 -1
  108. data/lib/mushikago/http/request.rb +5 -0
  109. data/lib/mushikago/http/response.rb +7 -0
  110. data/lib/mushikago/version.rb +1 -1
  111. data/spec/mushikago/auth/signature_spec.rb +1 -2
  112. data/spec/mushikago/http/client_spec.rb +3 -2
  113. data/spec/mushikago/http/request_spec.rb +1 -3
  114. data/spec/mushikago/tombo/client_spec.rb +3 -2
  115. metadata +72 -21
  116. data/lib/mushikago/hotaru/request.rb +0 -32
  117. data/spec/mushikago/tombo/request_spec.rb +0 -23
@@ -0,0 +1,16 @@
1
+ # -*- coding : utf-8 -*-
2
+ module Mushikago
3
+ module Hotaru
4
+ class WordGetRequest < Mushikago::Http::GetRequest
5
+ def path; '/1/hotaru/word/get' end
6
+ request_parameter :domain_name
7
+ request_parameter :word
8
+
9
+ def initialize domain_name, word, options={}
10
+ super(options)
11
+ self.domain_name = domain_name
12
+ self.word = word
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,20 @@
1
+ # -*- coding : utf-8 -*-
2
+ module Mushikago
3
+ module Hotaru
4
+ class WordListRequest < Mushikago::Http::GetRequest
5
+ def path; '/1/hotaru/word/list' end
6
+ request_parameter :domain_name
7
+ request_parameter :limit do |v| v.to_i.to_s end
8
+ request_parameter :offset do |v| v.to_i.to_s end
9
+ request_parameter :filter
10
+
11
+ def initialize domain_name, options={}
12
+ super(options)
13
+ self.domain_name = domain_name
14
+ self.limit = options[:limit] if options.has_key?(:limit)
15
+ self.offset = options[:offset] if options.has_key?(:offset)
16
+ self.filter = options[:filter] if options.has_key?(:filter)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'net/http'
3
+ require 'net/https'
3
4
  require 'json'
4
5
  module Mushikago
5
6
  module Http
@@ -32,7 +33,10 @@ module Mushikago
32
33
  request.add_signature!(signer)
33
34
 
34
35
  # send request
35
- Net::HTTP.start(request.host, request.port, :use_ssl => use_ssl) do |http|
36
+ session = Net::HTTP.new(request.host, request.port)
37
+ session.use_ssl = use_ssl
38
+ session.verify_mode = OpenSSL::SSL::VERIFY_NONE if use_ssl
39
+ session.start do |http|
36
40
  http_request = request.to_http_request
37
41
  http_response = http.request(http_request)
38
42
  return Mushikago::Http::Response.new(JSON.parse(http_response.body))
@@ -81,6 +81,11 @@ module Mushikago
81
81
  Net::HTTP::Post.new(request_path)
82
82
  end
83
83
 
84
+ private
85
+ def new_http_put_request(request_path)
86
+ Net::HTTP::Put.new(request_path)
87
+ end
88
+
84
89
  private
85
90
  def new_http_delete_request(request_path)
86
91
  Net::HTTP::Delete.new(request_path)
@@ -49,6 +49,13 @@ module Mushikago
49
49
  def []= key, value
50
50
  response[key] = value
51
51
  end
52
+
53
+ def to_s
54
+ {
55
+ '@meta' => meta,
56
+ '@response' => response
57
+ }.to_json
58
+ end
52
59
  end
53
60
  end
54
61
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Mushikago
3
3
  # Mushikago SDK for Ruby のバージョン
4
- VERSION = '0.3.7'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -1,14 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- class TestRequest < Mushikago::Http::Request
4
+ class TestRequest < Mushikago::Http::GetRequest
5
5
  include Mushikago::Auth::Signature
6
6
  end
7
7
 
8
8
  describe Mushikago::Auth::Signature do
9
9
  before do
10
10
  @request = TestRequest.new
11
- @request.http_method = 'GET'
12
11
  @request.host = 'mushikago.org'
13
12
  @request.path = '/1/someapi.json'
14
13
  @request['api_key'] = 'api_key'
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- class TestRequest < Mushikago::Http::Request
4
+ class TestRequest < Mushikago::Http::GetRequest
5
5
  include Mushikago::Auth::Signature
6
6
  end
7
7
 
@@ -33,7 +33,8 @@ describe Mushikago::Http::Client do
33
33
  before :all do
34
34
  request = TestRequest.new
35
35
  request.host = 'api.mushikago.org'
36
- request.path = '/1/tombo/info'
36
+ request.port = 443
37
+ request.path = '/1/health/check'
37
38
  client = Mushikago::Http::Client.new
38
39
  @response = client.send_request(request)
39
40
  end
@@ -20,7 +20,6 @@ describe Mushikago::Http::Request do
20
20
 
21
21
  subject{ @request }
22
22
 
23
- it{ should respond_to(:http_method) }
24
23
  it{ should respond_to(:host, :host=) }
25
24
  it{ should respond_to(:port, :port=) }
26
25
  it{ should respond_to(:path, :path=) }
@@ -29,9 +28,8 @@ describe Mushikago::Http::Request do
29
28
  it{ should respond_to(:[]=) }
30
29
  it{ should respond_to(:[]) }
31
30
 
32
- its(:http_method){ should == 'GET' }
33
31
  its(:host){ should == 'tombo.ap-northeast-1.mushikago.org' }
34
- its('port.to_i'){ should == 80 }
32
+ its(:port){ should be_nil }
35
33
  its(:path){ should == '/1/list.json' }
36
34
  its(:headers){ should be_a_kind_of(Hash) }
37
35
  it 'header["hoge"] should "fuga"' do subject.headers['hoge'].should == 'fuga' end
@@ -5,7 +5,8 @@ describe Mushikago::Tombo::Client do
5
5
  before :all do
6
6
  @client = Mushikago::Tombo::Client.new(
7
7
  :api_key => ENV['MUSHIKAGO_API_KEY'],
8
- :secret_key => ENV['MUSHIKAGO_SECRET_KEY']
8
+ :secret_key => ENV['MUSHIKAGO_SECRET_KEY'],
9
+ :use_ssl => false
9
10
  )
10
11
  end
11
12
 
@@ -45,7 +46,7 @@ describe Mushikago::Tombo::Client do
45
46
  }
46
47
  }
47
48
  create_http_mock(response.to_json)
48
- @response = @client.capture('http://www.tombo.ne.jp/', :thumbnail=>1)
49
+ @response = @client.capture('http://api.mushikago.org/', :thumbnail=>1)
49
50
  end
50
51
 
51
52
  subject{ @response }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mushikago-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-14 00:00:00.000000000Z
12
+ date: 2012-02-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &5026580 !ruby/object:Gem::Requirement
16
+ requirement: &4772320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *5026580
24
+ version_requirements: *4772320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mime-types
27
- requirement: &5025320 !ruby/object:Gem::Requirement
27
+ requirement: &4769980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *5025320
35
+ version_requirements: *4769980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &5023960 !ruby/object:Gem::Requirement
38
+ requirement: &4765880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *5023960
46
+ version_requirements: *4765880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: maruku
49
- requirement: &5020940 !ruby/object:Gem::Requirement
49
+ requirement: &4763700 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *5020940
57
+ version_requirements: *4763700
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: yard
60
- requirement: &5020020 !ruby/object:Gem::Requirement
60
+ requirement: &4761760 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *5020020
68
+ version_requirements: *4761760
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &5017980 !ruby/object:Gem::Requirement
71
+ requirement: &4761020 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 2.6.0
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *5017980
79
+ version_requirements: *4761020
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: ZenTest
82
- requirement: &5016460 !ruby/object:Gem::Requirement
82
+ requirement: &4754460 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *5016460
90
+ version_requirements: *4754460
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundler
93
- requirement: &5015400 !ruby/object:Gem::Requirement
93
+ requirement: &4750100 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *5015400
101
+ version_requirements: *4750100
102
102
  description: A SDK for Mushikago Web Service.
103
103
  email:
104
104
  - t.matsuoka@miningbrownie.co.jp
@@ -110,7 +110,30 @@ files:
110
110
  - lib/mushikago.rb
111
111
  - lib/mushikago/tombo.rb
112
112
  - lib/mushikago/hotaru.rb
113
- - lib/mushikago/hotaru/request.rb
113
+ - lib/mushikago/hotaru/dictionary_list_request.rb
114
+ - lib/mushikago/hotaru/text_get_request.rb
115
+ - lib/mushikago/hotaru/collocation_download_request.rb
116
+ - lib/mushikago/hotaru/domain_delete_request.rb
117
+ - lib/mushikago/hotaru/word_list_request.rb
118
+ - lib/mushikago/hotaru/collocation_create_request.rb
119
+ - lib/mushikago/hotaru/collocation_get_request.rb
120
+ - lib/mushikago/hotaru/text_delete_request.rb
121
+ - lib/mushikago/hotaru/text_list_request.rb
122
+ - lib/mushikago/hotaru/tag_put_request.rb
123
+ - lib/mushikago/hotaru/tag_delete_request.rb
124
+ - lib/mushikago/hotaru/word_get_request.rb
125
+ - lib/mushikago/hotaru/text_tagset_request.rb
126
+ - lib/mushikago/hotaru/collocation_wordlist_request.rb
127
+ - lib/mushikago/hotaru/tag_list_request.rb
128
+ - lib/mushikago/hotaru/collocation_list_request.rb
129
+ - lib/mushikago/hotaru/domain_create_request.rb
130
+ - lib/mushikago/hotaru/classifier_judge_request.rb
131
+ - lib/mushikago/hotaru/collocation_delete_request.rb
132
+ - lib/mushikago/hotaru/dictionary_delete_request.rb
133
+ - lib/mushikago/hotaru/text_put_request.rb
134
+ - lib/mushikago/hotaru/dictionary_put_request.rb
135
+ - lib/mushikago/hotaru/domain_info_request.rb
136
+ - lib/mushikago/hotaru/domain_list_request.rb
114
137
  - lib/mushikago/hotaru/client.rb
115
138
  - lib/mushikago/auth/signer.rb
116
139
  - lib/mushikago/auth/signature.rb
@@ -175,7 +198,13 @@ files:
175
198
  - doc/Mushikago/Auth.html
176
199
  - doc/Mushikago/Http.html
177
200
  - doc/Mushikago/Tombo.html
201
+ - doc/Mushikago/Http/GetRequest.html
202
+ - doc/Mushikago/Http/MultipartPutRequest.html
178
203
  - doc/Mushikago/Http/Request.html
204
+ - doc/Mushikago/Http/PostRequest.html
205
+ - doc/Mushikago/Http/DeleteRequest.html
206
+ - doc/Mushikago/Http/PutRequest.html
207
+ - doc/Mushikago/Http/MultipartPostRequest.html
179
208
  - doc/Mushikago/Http/MultipartRequest.html
180
209
  - doc/Mushikago/Http/Client.html
181
210
  - doc/Mushikago/Http/Response.html
@@ -207,7 +236,31 @@ files:
207
236
  - doc/Mushikago/Mitsubachi/ScriptDeployRequest.html
208
237
  - doc/Mushikago/Mitsubachi.html
209
238
  - doc/Mushikago/Config.html
239
+ - doc/Mushikago/Hotaru/TextDeleteRequest.html
240
+ - doc/Mushikago/Hotaru/TextPutRequest.html
241
+ - doc/Mushikago/Hotaru/DomainCreateRequest.html
242
+ - doc/Mushikago/Hotaru/DomainInfoRequest.html
243
+ - doc/Mushikago/Hotaru/CollocationListRequest.html
244
+ - doc/Mushikago/Hotaru/TagDeleteRequest.html
245
+ - doc/Mushikago/Hotaru/DictionaryListRequest.html
246
+ - doc/Mushikago/Hotaru/DictionaryPutRequest.html
247
+ - doc/Mushikago/Hotaru/TextTagsetRequest.html
210
248
  - doc/Mushikago/Hotaru/Request.html
249
+ - doc/Mushikago/Hotaru/CollocationWordlistRequest.html
250
+ - doc/Mushikago/Hotaru/CollocationDownloadRequest.html
251
+ - doc/Mushikago/Hotaru/CollocationGetRequest.html
252
+ - doc/Mushikago/Hotaru/DomainListRequest.html
253
+ - doc/Mushikago/Hotaru/CollocationCreateRequest.html
254
+ - doc/Mushikago/Hotaru/TextGetRequest.html
255
+ - doc/Mushikago/Hotaru/WordGetRequest.html
256
+ - doc/Mushikago/Hotaru/TextListRequest.html
257
+ - doc/Mushikago/Hotaru/ClassifierJudgeRequest.html
258
+ - doc/Mushikago/Hotaru/DomainDeleteRequest.html
259
+ - doc/Mushikago/Hotaru/DictionaryDeleteRequest.html
260
+ - doc/Mushikago/Hotaru/TagPutRequest.html
261
+ - doc/Mushikago/Hotaru/CollocationDeleteRequest.html
262
+ - doc/Mushikago/Hotaru/TagListRequest.html
263
+ - doc/Mushikago/Hotaru/WordListRequest.html
211
264
  - doc/Mushikago/Hotaru/Client.html
212
265
  - doc/Mushikago/Auth/Signer.html
213
266
  - doc/Mushikago/Auth/Signature.html
@@ -228,7 +281,6 @@ files:
228
281
  - spec/mushikago/auth/signer_spec.rb
229
282
  - spec/mushikago/auth/signature_spec.rb
230
283
  - spec/mushikago/tombo/client_spec.rb
231
- - spec/mushikago/tombo/request_spec.rb
232
284
  - spec/mushikago/tombo/delete_request_spec.rb
233
285
  - spec/mushikago/tombo/captures_request_spec.rb
234
286
  - spec/mushikago/tombo/info_request_spec.rb
@@ -266,7 +318,6 @@ test_files:
266
318
  - spec/mushikago/auth/signer_spec.rb
267
319
  - spec/mushikago/auth/signature_spec.rb
268
320
  - spec/mushikago/tombo/client_spec.rb
269
- - spec/mushikago/tombo/request_spec.rb
270
321
  - spec/mushikago/tombo/delete_request_spec.rb
271
322
  - spec/mushikago/tombo/captures_request_spec.rb
272
323
  - spec/mushikago/tombo/info_request_spec.rb
@@ -1,32 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- module Mushikago
3
- module Hotaru
4
- # Hotaruのリクエストを表す抽象クラス
5
- class Request < Mushikago::Http::Request
6
- include Mushikago::Auth::Signature
7
-
8
- # @param [Hash] options オプション
9
- # @option options [String] :endpoint('hotaru.mushikago.org') Hotaruのエンドポイント
10
- def initialize options={}
11
- super()
12
- endpoint = options[:endpoint] || Mushikago.config.hotaru_endpoint
13
- host, port = endpoint.split(':')
14
- @host = host
15
- @port = port if port
16
- @path = "/#{api_version}/#{method_name}"
17
- end
18
-
19
- # @private
20
- private
21
- def api_version
22
- 1
23
- end
24
-
25
- # @private
26
- private
27
- def method_name
28
- ''
29
- end
30
- end
31
- end
32
- end
@@ -1,23 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'spec_helper'
3
-
4
- describe Mushikago::Tombo::Request do
5
- before :all do
6
- @request = Mushikago::Tombo::Request.new
7
- end
8
-
9
- subject{ @request }
10
-
11
- its(:host){ should == Mushikago.config.endpoint }
12
-
13
- context 'construct with options' do
14
- before :all do
15
- @request = Mushikago::Tombo::Request.new(:endpoint => 'localhost:18080')
16
- end
17
-
18
- subject{ @request }
19
-
20
- its(:host){ should == 'localhost' }
21
- its('port.to_i'){ should == 18080 }
22
- end
23
- end