haruna 0.0.2 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - 2.0.0
6
+
7
+ script: bundle exec rspec spec
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Haruna
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/haruna.png)](http://badge.fury.io/rb/haruna)
4
+ [![Build Status](https://travis-ci.org/kakipo/haruna.png?branch=master)](https://travis-ci.org/kakipo/haruna)
5
+
3
6
  A Ruby interface to the 艦これ API.
4
7
 
5
8
  ## Installation
@@ -37,7 +40,7 @@ client.req_hokyu_charge(kind, ship_id_arr)
37
40
  | ------------- | -------------- | ------------------------------------------ | ---------- |
38
41
  | token | Your API token | "835d2a8f2ca5fea2463248cc6910af96880fc29e" | |
39
42
  | end_point | API endpoint | "http://125.6.189.215" | |
40
- | ship_id | Ship's id | 35 | 1 |
43
+ | ship_id | Ship's id | 35 | > 0 |
41
44
  | deck_id | Deck's id | 3 | 1 ~ 4 |
42
45
  | kind | Refill mode - 1: fuel, 2: bullets, 3: fuel + bullets | 3 | 1 ~ 3 |
43
46
 
@@ -71,6 +74,7 @@ client.user_agent = "Foo Bar"
71
74
 
72
75
  This software library ("gem") is provided by kakipo "as is" and "with all faults." kakipo makes no representations or warranties of any kind concerning the safety, suitability, inaccuracies, typographical errors, or other harmful components of this gem. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this gem is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and kakipo will not be liable for any damages you may suffer in connection with using, modifying, or distributing this gem.
73
76
 
77
+ Put simply, it's your responsibility to use this gem.
74
78
  Plus, please read and respect [the official terms of use](http://www.dmm.co.jp/rule/=/category=onlinegame_service/).
75
79
 
76
80
  ## Contributing
data/lib/haruna/api.rb CHANGED
@@ -8,7 +8,7 @@ module Haruna
8
8
  proxy: nil,
9
9
  api_ver: 1,
10
10
  user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36',
11
- referer: '/kcs/port.swf?version=1.5.5', # 'http://125.6.189.215/kcs/port.swf?version=1.5.5'
11
+ referer: '/kcs/port.swf?version=1.5.6',
12
12
  accept_enc: 'gzip,deflate,sdch',
13
13
  accept_lang: 'ja,en-US;q=0.8,en;q=0.6',
14
14
  content_type: 'application/x-www-form-urlencoded'
@@ -1,3 +1,3 @@
1
1
  module Haruna
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.2.1"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -18,13 +18,13 @@ def create_stub_connection
18
18
  "svdata={\"api_result\":1,\"api_result_msg\":\"\\u6210\\u529f\",\"api_data\":{\"api_complatetime\":1387604467275,\"api_complatetime_str\":\"2013-12-21 14:41:07\"}}" ]} # BOM: \xEF\xBB\xBF
19
19
 
20
20
  stub.post('/kcsapi/api_req_mission/result') {[ 200, resp_headers,
21
- "svdata={\"api_result\":1,\"api_result_msg\":\"\\u6210\\u529f\",\"api_data\":{\"api_ship_id\":[-1,54,78,71,50],\"api_clear_result\":1,\"api_get_exp\":20,\"api_member_lv\":28,\"api_member_exp\":40216,\"api_get_ship_exp\":[22,15,15,15],\"api_get_exp_lvup\":[[2157,2800],[1730,2100],[2230,2800],[1555,2100]],\"api_maparea_name\":\"\\u93ae\\u5b88\\u5e9c\\u6d77\\u57df\",\"api_detail\":\"\\u5916\\u6d77\\u307e\\u3067\\u8db3\\u3092\\u5ef6\\u3070\\u3057\\u3001\\u8266\\u968a\\u306e\\u7df4\\u5ea6\\u3092\\u9ad8\\u3081\\u3088\\u3046\\uff01\",\"api_quest_name\":\"\\u9577\\u8ddd\\u96e2\\u7df4\\u7fd2\\u822a\\u6d77\",\"api_quest_level\":1,\"api_get_material\":[0,100,30,0],\"api_useitem_flag\":[1,0],\"api_get_item1\":{\"api_useitem_id\":-1,\"api_useitem_name\":null,\"api_useitem_count\":1}}}" ]}
21
+ "" ]}
22
22
 
23
23
  stub.post('/kcsapi/api_req_hokyu/charge') {[ 200, resp_headers,
24
24
  "svdata={\"api_result\":1,\"api_result_msg\":\"\\u6210\\u529f\",\"api_data\":{\"api_ship\":[{\"api_id\":54,\"api_fuel\":15,\"api_bull\":15,\"api_onslot\":[0,0,0,0,0]},{\"api_id\":78,\"api_fuel\":15,\"api_bull\":15,\"api_onslot\":[0,0,0,0,0]},{\"api_id\":71,\"api_fuel\":15,\"api_bull\":15,\"api_onslot\":[0,0,0,0,0]},{\"api_id\":50,\"api_fuel\":15,\"api_bull\":15,\"api_onslot\":[0,0,0,0,0]}],\"api_material\":[2938,5864,4151,3933],\"api_use_bou\":0}}" ]}
25
25
 
26
26
  stub.post('/kcsapi/api_get_member/deck_port') {[ 200, resp_headers,
27
- "svdata={\"api_result\":1,\"api_result_msg\":\"\\u6210\\u529f\",\"api_data\":[{\"api_member_id\":15010331,\"api_id\":1,\"api_name\":\"First\",\"api_name_id\":\"\",\"api_mission\":[0,0,0,0],\"api_flagship\":\"0\",\"api_ship\":[109,156,177,31,194,30]},{\"api_member_id\":15010331,\"api_id\":2,\"api_name\":\"Second\",\"api_name_id\":\"\",\"api_mission\":[1,5,1387598754473,0],\"api_flagship\":\"0\",\"api_ship\":[15,66,57,83,-1,-1]},{\"api_member_id\":15010331,\"api_id\":3,\"api_name\":\"Third\",\"api_name_id\":\"\",\"api_mission\":[1,2,1387595310643,0],\"api_flagship\":\"0\",\"api_ship\":[54,78,71,50,-1,-1]}]}" ]}
27
+ "svdata={\"api_result\":1,\"api_result_msg\":\"\\u6210\\u529f\",\"api_data\":[{\"api_member_id\":15010331,\"api_id\":1,\"api_name\":\"First\",\"api_name_id\":\"\",\"api_mission\":[0,0,0,0],\"api_flagship\":\"0\",\"api_ship\":[177,227,276,31,30,109]},{\"api_member_id\":15010331,\"api_id\":2,\"api_name\":\"Second\",\"api_name_id\":\"\",\"api_mission\":[0,0,0,0],\"api_flagship\":\"0\",\"api_ship\":[150,66,57,83,-1,-1]},{\"api_member_id\":15010331,\"api_id\":3,\"api_name\":\"Third\",\"api_name_id\":\"\",\"api_mission\":[2,9,1387822430036,0],\"api_flagship\":\"0\",\"api_ship\":[54,78,71,193,-1,-1]},{\"api_member_id\":15010331,\"api_id\":4,\"api_name\":\"Fourth\",\"api_name_id\":\"\",\"api_mission\":[2,12,1387840275830,0],\"api_flagship\":\"0\",\"api_ship\":[50,82,210,164,-1,-1]}]}" ]}
28
28
 
29
29
  end
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haruna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-21 00:00:00.000000000 Z
12
+ date: 2013-12-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -101,6 +101,7 @@ files:
101
101
  - .gitignore
102
102
  - .rspec
103
103
  - .ruby-version
104
+ - .travis.yml
104
105
  - Gemfile
105
106
  - LICENSE.txt
106
107
  - README.md