eve_online 0.34.0 → 0.35.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/.deepsource.toml +5 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +5 -5
- data/Gemfile.mutant.lock +3 -3
- data/README.md +94 -3
- data/lib/eve_online.rb +4 -0
- data/lib/eve_online/esi/models/public_contract.rb +98 -0
- data/lib/eve_online/esi/models/public_contract_item.rb +59 -0
- data/lib/eve_online/esi/public_contract.rb +40 -0
- data/lib/eve_online/esi/public_contracts.rb +40 -0
- data/lib/eve_online/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b14b54b7da3429b1bd0c1b6e975195aaba4d24e0272a5c38d4e7a9aa5b0de42
|
4
|
+
data.tar.gz: 5c39f9345325b3bf9a9764ffbe49704b96fc43c1325e9a06e2ffbadbcd8f9fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c723bba7c7f720c5a8f7f78c9f3f6a02ac2559d3ac58fa0f5a89bcafaf7c111edd23ade1c51fe01b8b5bd53e40a31315902a6f35ee7940113691d81c4624b5
|
7
|
+
data.tar.gz: 34376fdfe262ab51ab60550e725a19fbe1eb4458db64f91e3660ccc76f4cd39aa391b46ac002fda5923cc65751ea1750a2a53e71075cca13d2555da03bea14af
|
data/.deepsource.toml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.35.0
|
4
|
+
|
5
|
+
* Add `EveOnline::ESI::PublicContracts`
|
6
|
+
* Add `EveOnline::ESI::Models::PublicContract`
|
7
|
+
* Add `EveOnline::ESI::Models::PublicContractItem`
|
8
|
+
* Add `EveOnline::ESI::PublicContract`
|
9
|
+
|
3
10
|
## v0.34.0
|
4
11
|
|
5
12
|
* Rename `EveOnline::ESI::Models::Race#alliance_id` to `#faction_id`. [Fix esi issue 812](https://github.com/esi/esi-issues/issues/812).
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eve_online (0.
|
4
|
+
eve_online (0.35.0)
|
5
5
|
activesupport (>= 5.2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.0.3.
|
10
|
+
activesupport (6.0.3.2)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
bundler
|
20
20
|
rake
|
21
21
|
thor (>= 0.14.0)
|
22
|
-
ast (2.4.
|
22
|
+
ast (2.4.1)
|
23
23
|
awesome_print (1.8.0)
|
24
24
|
coderay (1.1.3)
|
25
25
|
colorize (0.8.1)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
tomlrb
|
52
52
|
nokogiri (1.10.9)
|
53
53
|
mini_portile2 (~> 2.4.0)
|
54
|
-
parallel (1.19.
|
54
|
+
parallel (1.19.2)
|
55
55
|
parser (2.7.1.3)
|
56
56
|
ast (~> 2.4.0)
|
57
57
|
pry (0.13.1)
|
@@ -95,7 +95,7 @@ GEM
|
|
95
95
|
ruby_parser (3.14.2)
|
96
96
|
sexp_processor (~> 4.9)
|
97
97
|
safe_yaml (1.0.5)
|
98
|
-
sexp_processor (4.
|
98
|
+
sexp_processor (4.15.0)
|
99
99
|
simplecov (0.18.5)
|
100
100
|
docile (~> 1.1)
|
101
101
|
simplecov-html (~> 0.11)
|
data/Gemfile.mutant.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eve_online (0.
|
4
|
+
eve_online (0.35.0)
|
5
5
|
activesupport (>= 5.2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
abstract_type (0.0.7)
|
11
|
-
activesupport (6.0.3.
|
11
|
+
activesupport (6.0.3.2)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 0.7, < 2)
|
14
14
|
minitest (~> 5.1)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
bundler
|
28
28
|
rake
|
29
29
|
thor (>= 0.14.0)
|
30
|
-
ast (2.4.
|
30
|
+
ast (2.4.1)
|
31
31
|
concord (0.1.5)
|
32
32
|
adamantium (~> 0.2.0)
|
33
33
|
equalizer (~> 0.0.9)
|
data/README.md
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
[](https://circleci.com/gh/evemonk/eve_online)
|
4
4
|
[](https://badge.fury.io/rb/eve_online)
|
5
5
|
[](https://rubygems.org/gems/eve_online)
|
6
|
-
[](https://snyk.io/test/github/evemonk/eve_online)
|
7
7
|
[](https://hakiri.io/github/evemonk/eve_online/master)
|
8
|
+
[](https://deepsource.io/gh/evemonk/eve_online/?ref=repository-badge)
|
8
9
|
|
9
10
|
This gem implement Ruby API for EveOnline MMORPG (ESI).
|
10
11
|
|
@@ -763,8 +764,98 @@ contracts.etag # => "6e18566a8f786f08aba678262360d0c74a783f9923aa43f8043133e4"
|
|
763
764
|
|
764
765
|
#### Get public contracts
|
765
766
|
|
767
|
+
```ruby
|
768
|
+
options = { region_id: 10_000_043, page: 1 }
|
769
|
+
|
770
|
+
contracts = EveOnline::ESI::PublicContracts.new(options)
|
771
|
+
|
772
|
+
contracts.scope # => nil
|
773
|
+
|
774
|
+
contracts.page # => 1
|
775
|
+
|
776
|
+
contracts.total_pages # => 4
|
777
|
+
|
778
|
+
contracts.contracts.size # => 1000
|
779
|
+
|
780
|
+
contract = contracts.contracts.first
|
781
|
+
|
782
|
+
contract.as_json # => {:buyout=>nil,
|
783
|
+
# :collateral=>0.0,
|
784
|
+
# :contract_id=>157834735,
|
785
|
+
# :date_expired=>Wed, 17 Jun 2020 21:36:41 UTC +00:00,
|
786
|
+
# :date_issued=>Wed, 20 May 2020 21:36:41 UTC +00:00,
|
787
|
+
# :days_to_complete=>0,
|
788
|
+
# :end_location_id=>60008494,
|
789
|
+
# :for_corporation=>true,
|
790
|
+
# :issuer_corporation_id=>897372069,
|
791
|
+
# :issuer_id=>1314102096,
|
792
|
+
# :price=>1250000000.0,
|
793
|
+
# :reward=>0.0,
|
794
|
+
# :start_location_id=>60008494,
|
795
|
+
# :title=>"Apostle Me10/Te16 Complete Bpc 10 Pack",
|
796
|
+
# :type=>"item_exchange",
|
797
|
+
# :volume=>100.0}
|
798
|
+
|
799
|
+
contract.buyout # => nil
|
800
|
+
contract.collateral # => 0.0
|
801
|
+
contract.contract_id # => 157834735
|
802
|
+
contract.date_expired # => Wed, 17 Jun 2020 21:36:41 UTC +00:00
|
803
|
+
contract.date_issued # => Wed, 20 May 2020 21:36:41 UTC +00:00
|
804
|
+
contract.days_to_complete # => 0
|
805
|
+
contract.end_location_id # => 60008494
|
806
|
+
contract.for_corporation # => true
|
807
|
+
contract.issuer_corporation_id # => 897372069
|
808
|
+
contract.issuer_id # => 1314102096
|
809
|
+
contract.price # => 1250000000.0
|
810
|
+
contract.reward # => 0.0
|
811
|
+
contract.start_location_id # => 60008494
|
812
|
+
contract.title # => "Apostle Me10/Te16 Complete Bpc 10 Pack"
|
813
|
+
contract.type # => "item_exchange"
|
814
|
+
contract.volume # => 100.0
|
815
|
+
|
816
|
+
contracts.etag # => "3f7fdf9a69e35bb35d619b6cb5043a2766d11ca6306a8b5af369ce6e"
|
817
|
+
```
|
818
|
+
|
766
819
|
#### Get public contract bids
|
767
820
|
|
821
|
+
```ruby
|
822
|
+
options = { contract_id: 157_872_948, page: 1 }
|
823
|
+
|
824
|
+
contract = EveOnline::ESI::PublicContract.new(options)
|
825
|
+
|
826
|
+
contract.scope # => nil
|
827
|
+
|
828
|
+
contract.page # => 1
|
829
|
+
|
830
|
+
contract.total_pages # => 1
|
831
|
+
|
832
|
+
contract.items.size # => 1
|
833
|
+
|
834
|
+
item = contract.items.first
|
835
|
+
|
836
|
+
item.as_json # => {:is_blueprint_copy=>true,
|
837
|
+
# :is_included=>true,
|
838
|
+
# :item_id=>1029552558074,
|
839
|
+
# :material_efficiency=>10,
|
840
|
+
# :quantity=>1,
|
841
|
+
# :record_id=>3210378611,
|
842
|
+
# :runs=>400,
|
843
|
+
# :time_efficiency=>20,
|
844
|
+
# :type_id=>29040}
|
845
|
+
|
846
|
+
item.is_blueprint_copy # => true
|
847
|
+
item.is_included # => true
|
848
|
+
item.item_id # => 1029552558074
|
849
|
+
item.material_efficiency # => 10
|
850
|
+
item.quantity # => 1
|
851
|
+
item.record_id # => 3210378611
|
852
|
+
item.runs # => 400
|
853
|
+
item.time_efficiency # => 20
|
854
|
+
item.type_id # => 29040
|
855
|
+
|
856
|
+
contract.etag # => "d458c3f56c114882a9ecfe1aaf173837310b15b6e7cef86a019e700f"
|
857
|
+
```
|
858
|
+
|
768
859
|
#### Get public contract items
|
769
860
|
|
770
861
|
#### Get corporation contracts
|
@@ -2298,12 +2389,12 @@ races.races.size # => 4
|
|
2298
2389
|
|
2299
2390
|
race = races.races.first
|
2300
2391
|
|
2301
|
-
race.as_json # => {:
|
2392
|
+
race.as_json # => {:faction_id=>500002,
|
2302
2393
|
# :description=>"Once a thriving tribal civilization, the Minmatar...",
|
2303
2394
|
# :name=>"Minmatar",
|
2304
2395
|
# :race_id=>2}
|
2305
2396
|
|
2306
|
-
race.
|
2397
|
+
race.faction_id # => 500002
|
2307
2398
|
race.description # => "Once a thriving tribal civilization, the Minmatar..."
|
2308
2399
|
race.name # => "Minmatar"
|
2309
2400
|
race.race_id # => 2
|
data/lib/eve_online.rb
CHANGED
@@ -46,6 +46,8 @@ require "eve_online/esi/character_clones"
|
|
46
46
|
require "eve_online/esi/character_implants"
|
47
47
|
|
48
48
|
require "eve_online/esi/character_contracts"
|
49
|
+
require "eve_online/esi/public_contracts"
|
50
|
+
require "eve_online/esi/public_contract"
|
49
51
|
|
50
52
|
require "eve_online/esi/corporation"
|
51
53
|
require "eve_online/esi/corporation_alliance_history"
|
@@ -155,6 +157,8 @@ require "eve_online/esi/models/character_ship"
|
|
155
157
|
require "eve_online/esi/models/blueprint"
|
156
158
|
require "eve_online/esi/models/standing"
|
157
159
|
require "eve_online/esi/models/contract"
|
160
|
+
require "eve_online/esi/models/public_contract"
|
161
|
+
require "eve_online/esi/models/public_contract_item"
|
158
162
|
require "eve_online/esi/models/fatigue"
|
159
163
|
require "eve_online/esi/models/notification"
|
160
164
|
require "eve_online/esi/models/event"
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EveOnline
|
4
|
+
module ESI
|
5
|
+
module Models
|
6
|
+
class PublicContract < Base
|
7
|
+
def as_json
|
8
|
+
{
|
9
|
+
buyout: buyout,
|
10
|
+
collateral: collateral,
|
11
|
+
contract_id: contract_id,
|
12
|
+
date_expired: date_expired,
|
13
|
+
date_issued: date_issued,
|
14
|
+
days_to_complete: days_to_complete,
|
15
|
+
end_location_id: end_location_id,
|
16
|
+
for_corporation: for_corporation,
|
17
|
+
issuer_corporation_id: issuer_corporation_id,
|
18
|
+
issuer_id: issuer_id,
|
19
|
+
price: price,
|
20
|
+
reward: reward,
|
21
|
+
start_location_id: start_location_id,
|
22
|
+
title: title,
|
23
|
+
type: type,
|
24
|
+
volume: volume
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def buyout
|
29
|
+
options["buyout"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def collateral
|
33
|
+
options["collateral"]
|
34
|
+
end
|
35
|
+
|
36
|
+
def contract_id
|
37
|
+
options["contract_id"]
|
38
|
+
end
|
39
|
+
|
40
|
+
def date_expired
|
41
|
+
date_expired = options["date_expired"]
|
42
|
+
|
43
|
+
parse_datetime_with_timezone(date_expired) if date_expired
|
44
|
+
end
|
45
|
+
|
46
|
+
def date_issued
|
47
|
+
date_issued = options["date_issued"]
|
48
|
+
|
49
|
+
parse_datetime_with_timezone(date_issued) if date_issued
|
50
|
+
end
|
51
|
+
|
52
|
+
def days_to_complete
|
53
|
+
options["days_to_complete"]
|
54
|
+
end
|
55
|
+
|
56
|
+
def end_location_id
|
57
|
+
options["end_location_id"]
|
58
|
+
end
|
59
|
+
|
60
|
+
def for_corporation
|
61
|
+
options["for_corporation"]
|
62
|
+
end
|
63
|
+
|
64
|
+
def issuer_corporation_id
|
65
|
+
options["issuer_corporation_id"]
|
66
|
+
end
|
67
|
+
|
68
|
+
def issuer_id
|
69
|
+
options["issuer_id"]
|
70
|
+
end
|
71
|
+
|
72
|
+
def price
|
73
|
+
options["price"]
|
74
|
+
end
|
75
|
+
|
76
|
+
def reward
|
77
|
+
options["reward"]
|
78
|
+
end
|
79
|
+
|
80
|
+
def start_location_id
|
81
|
+
options["start_location_id"]
|
82
|
+
end
|
83
|
+
|
84
|
+
def title
|
85
|
+
options["title"]
|
86
|
+
end
|
87
|
+
|
88
|
+
def type
|
89
|
+
options["type"]
|
90
|
+
end
|
91
|
+
|
92
|
+
def volume
|
93
|
+
options["volume"]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EveOnline
|
4
|
+
module ESI
|
5
|
+
module Models
|
6
|
+
class PublicContractItem < Base
|
7
|
+
def as_json
|
8
|
+
{
|
9
|
+
is_blueprint_copy: is_blueprint_copy,
|
10
|
+
is_included: is_included,
|
11
|
+
item_id: item_id,
|
12
|
+
material_efficiency: material_efficiency,
|
13
|
+
quantity: quantity,
|
14
|
+
record_id: record_id,
|
15
|
+
runs: runs,
|
16
|
+
time_efficiency: time_efficiency,
|
17
|
+
type_id: type_id
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def is_blueprint_copy
|
22
|
+
options["is_blueprint_copy"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def is_included
|
26
|
+
options["is_included"]
|
27
|
+
end
|
28
|
+
|
29
|
+
def item_id
|
30
|
+
options["item_id"]
|
31
|
+
end
|
32
|
+
|
33
|
+
def material_efficiency
|
34
|
+
options["material_efficiency"]
|
35
|
+
end
|
36
|
+
|
37
|
+
def quantity
|
38
|
+
options["quantity"]
|
39
|
+
end
|
40
|
+
|
41
|
+
def record_id
|
42
|
+
options["record_id"]
|
43
|
+
end
|
44
|
+
|
45
|
+
def runs
|
46
|
+
options["runs"]
|
47
|
+
end
|
48
|
+
|
49
|
+
def time_efficiency
|
50
|
+
options["time_efficiency"]
|
51
|
+
end
|
52
|
+
|
53
|
+
def type_id
|
54
|
+
options["type_id"]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EveOnline
|
4
|
+
module ESI
|
5
|
+
class PublicContract < Base
|
6
|
+
API_PATH = "/v1/contracts/public/items/%<contract_id>s/"
|
7
|
+
|
8
|
+
attr_reader :contract_id, :page
|
9
|
+
|
10
|
+
def initialize(options)
|
11
|
+
super
|
12
|
+
|
13
|
+
@contract_id = options.fetch(:contract_id)
|
14
|
+
@page = options.fetch(:page, 1)
|
15
|
+
end
|
16
|
+
|
17
|
+
def items
|
18
|
+
@items ||=
|
19
|
+
begin
|
20
|
+
output = []
|
21
|
+
response.each do |item|
|
22
|
+
output << Models::PublicContractItem.new(item)
|
23
|
+
end
|
24
|
+
output
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def scope
|
29
|
+
end
|
30
|
+
|
31
|
+
def additional_query_params
|
32
|
+
[:page]
|
33
|
+
end
|
34
|
+
|
35
|
+
def path
|
36
|
+
format(API_PATH, contract_id: contract_id)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EveOnline
|
4
|
+
module ESI
|
5
|
+
class PublicContracts < Base
|
6
|
+
API_PATH = "/v1/contracts/public/%<region_id>s/"
|
7
|
+
|
8
|
+
attr_reader :region_id, :page
|
9
|
+
|
10
|
+
def initialize(options)
|
11
|
+
super
|
12
|
+
|
13
|
+
@region_id = options.fetch(:region_id)
|
14
|
+
@page = options.fetch(:page, 1)
|
15
|
+
end
|
16
|
+
|
17
|
+
def contracts
|
18
|
+
@contracts ||=
|
19
|
+
begin
|
20
|
+
output = []
|
21
|
+
response.each do |contract|
|
22
|
+
output << Models::PublicContract.new(contract)
|
23
|
+
end
|
24
|
+
output
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def scope
|
29
|
+
end
|
30
|
+
|
31
|
+
def additional_query_params
|
32
|
+
[:page]
|
33
|
+
end
|
34
|
+
|
35
|
+
def path
|
36
|
+
format(API_PATH, region_id: region_id)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/eve_online/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eve_online
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.35.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Zubkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -158,6 +158,7 @@ extensions: []
|
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
160
|
- ".circleci/config.yml"
|
161
|
+
- ".deepsource.toml"
|
161
162
|
- ".github/FUNDING.yml"
|
162
163
|
- ".gitignore"
|
163
164
|
- ".mdlrc"
|
@@ -296,6 +297,8 @@ files:
|
|
296
297
|
- lib/eve_online/esi/models/planet_short.rb
|
297
298
|
- lib/eve_online/esi/models/planets.rb
|
298
299
|
- lib/eve_online/esi/models/position.rb
|
300
|
+
- lib/eve_online/esi/models/public_contract.rb
|
301
|
+
- lib/eve_online/esi/models/public_contract_item.rb
|
299
302
|
- lib/eve_online/esi/models/race.rb
|
300
303
|
- lib/eve_online/esi/models/region.rb
|
301
304
|
- lib/eve_online/esi/models/server_status.rb
|
@@ -312,6 +315,8 @@ files:
|
|
312
315
|
- lib/eve_online/esi/models/wallet_journal.rb
|
313
316
|
- lib/eve_online/esi/models/wallet_transaction.rb
|
314
317
|
- lib/eve_online/esi/models/war.rb
|
318
|
+
- lib/eve_online/esi/public_contract.rb
|
319
|
+
- lib/eve_online/esi/public_contracts.rb
|
315
320
|
- lib/eve_online/esi/server_status.rb
|
316
321
|
- lib/eve_online/esi/universe_ancestries.rb
|
317
322
|
- lib/eve_online/esi/universe_asteroid_belt.rb
|