eve_online 0.30.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de82cd73917218128ac8164bd2683ec4e4341fac3f1401dff6149f26d96170dc
4
- data.tar.gz: b1c3295d103a573a5a4bab30b362fb7c4840788172ac08d8935aa124bbdd415f
3
+ metadata.gz: 9d5cfcec3574091f14c3237a875aa19ce135d7724361d6eb69be5e8dc32315ad
4
+ data.tar.gz: 92a33b654c4bab0c2b7670b8506999e6fd6e3f8c487a8be0fdb04c0700d5778f
5
5
  SHA512:
6
- metadata.gz: 14930a20834a63f15951e2626f55a04ff331d9e79801b0c5ebf0ab23b190c8f155b5340ea270961d2dc04c7c3a6f4bf8446c7485419d105344f9f5813582df66
7
- data.tar.gz: 2261d31b7402ab499ffbe9f744673536afadf185795f0376e464e456e950bf33dbf2caaaca34e1a62f189ad52e63b6dd33cd0f1b3a61136fc2f491e8935e71d7
6
+ metadata.gz: 241bcb34d7e48ad19c4d791e1c6d7c681463f9c0001a1a4ffb72cf0e37af512f215306a9609d8ea002e3e05c8a507fd42c2bb258b1fbfca862480e77f76c6b0f
7
+ data.tar.gz: c71f89b871fb488a90400cef6882228c648f54a2969bf85cc494daa9d1596c4b1b356809e80074ff3626b2cba6e5e4f1dc1b2bb68042ca4ab5ea76cb3a29e6e5
@@ -8,7 +8,6 @@ jobs:
8
8
  - checkout
9
9
  - run: rm Gemfile.lock
10
10
  - run: rm .ruby-version
11
- - run: gem install bundler
12
11
  - run: bundle install
13
12
  - run: bundle exec appraisal install || true
14
13
  - run: bundle exec appraisal activesupport_42 rake
@@ -24,7 +23,6 @@ jobs:
24
23
  - checkout
25
24
  - run: rm Gemfile.lock
26
25
  - run: rm .ruby-version
27
- - run: gem install bundler
28
26
  - run: bundle install
29
27
  - run: bundle exec appraisal install || true
30
28
  - run: bundle exec appraisal activesupport_50 rake
@@ -41,7 +39,6 @@ jobs:
41
39
  - checkout
42
40
  - run: rm Gemfile.lock
43
41
  - run: rm .ruby-version
44
- - run: gem install bundler
45
42
  - run: bundle install
46
43
  - run: bundle exec appraisal install || true
47
44
  - run: bundle exec appraisal activesupport_50 rake
@@ -51,14 +48,13 @@ jobs:
51
48
  - run: bundle exec appraisal activesupport_edge rake
52
49
  - run: bundle exec standardrb
53
50
  - run: bundle exec mdl README.md CHANGELOG.md TODO.md
54
- ruby-2.7.0-preview1:
51
+ ruby-2.7.0:
55
52
  docker:
56
- - image: circleci/ruby:2.7.0-preview1
53
+ - image: circleci/ruby:2.7.0
57
54
  steps:
58
55
  - checkout
59
56
  - run: rm Gemfile.lock
60
57
  - run: rm .ruby-version
61
- - run: gem install bundler
62
58
  - run: bundle install
63
59
  - run: bundle exec appraisal install || true
64
60
  - run: bundle exec appraisal activesupport_50 rake
@@ -75,7 +71,6 @@ jobs:
75
71
  - checkout
76
72
  - run: rm Gemfile.lock
77
73
  - run: rm .ruby-version
78
- - run: gem install bundler
79
74
  - run: bundle install
80
75
  - run: bundle exec appraisal install || true
81
76
  - run: bundle exec appraisal activesupport_42 rake JRUBY_OPTS="--debug"
@@ -95,4 +90,4 @@ workflows:
95
90
  - ruby-2.4.9
96
91
  - ruby-2.5.7
97
92
  - ruby-2.6.5
98
- - ruby-2.7.0-preview1
93
+ - ruby-2.7.0
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.0
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.31.0
4
+
5
+ * Add `EveOnline::ESI::Models::MailRecipient`
6
+ * Add `EveOnline::ESI::Models::MailRecipients`
7
+ * Add `EveOnline::ESI::Models::Mail`
8
+ * Add `EveOnline::ESI::CharacterGetMail`
9
+ * Add `EveOnline::ESI::Models::MailLabel`
10
+ * Add `EveOnline::ESI::CharacterMailLabels`
11
+ * Ruby 2.7.0
12
+ * Rename `EveOnline::ESI::UniverseRegion#constellations` to `#constellation_ids`
13
+ * Remove `constellations` from `EveOnline::ESI::UniverseRegion#as_json`
14
+ * Add `EveOnline::ESI::Models::Stargate#destination_stargate_id`
15
+ * Add `EveOnline::ESI::Models::Stargate#destination_system_id`
16
+ * Add `destination_stargate_id` and `destination_system_id` to `EveOnline::ESI::Models::Stargate#as_json`
17
+ * Remove `EveOnline::ESI::Models::StargateDestination`
18
+ * Remove `EveOnline::ESI::UniverseStargate#destination`
19
+ * Add `EveOnline::ESI::UniverseStargate#destination_stargate_id`
20
+ * Add `EveOnline::ESI::UniverseStargate#destination_system_id`
21
+ * Drop datasource support
22
+
3
23
  ## v0.30.0
4
24
 
5
25
  * Add `EveOnline::ESI::Models::OfferRequiredItem`
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eve_online (0.30.0)
4
+ eve_online (0.31.0)
5
5
  activesupport (>= 4.2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.1)
10
+ activesupport (6.0.2.1)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
@@ -32,10 +32,10 @@ GEM
32
32
  colorize (~> 0.7)
33
33
  ruby_parser (>= 3.14.1)
34
34
  hashdiff (1.0.0)
35
- i18n (1.7.0)
35
+ i18n (1.8.2)
36
36
  concurrent-ruby (~> 1.0)
37
37
  jaro_winkler (1.5.4)
38
- json (2.2.0)
38
+ json (2.3.0)
39
39
  kramdown (2.1.0)
40
40
  kramdown-parser-gfm (1.1.0)
41
41
  kramdown (~> 2.0)
@@ -46,45 +46,45 @@ GEM
46
46
  mixlib-config (>= 2.2.1, < 4)
47
47
  method_source (0.9.2)
48
48
  mini_portile2 (2.4.0)
49
- minitest (5.13.0)
50
- mixlib-cli (2.1.1)
51
- mixlib-config (3.0.5)
49
+ minitest (5.14.0)
50
+ mixlib-cli (2.1.5)
51
+ mixlib-config (3.0.6)
52
52
  tomlrb
53
53
  nokogiri (1.10.7)
54
54
  mini_portile2 (~> 2.4.0)
55
55
  parallel (1.19.1)
56
- parser (2.6.5.0)
56
+ parser (2.7.0.2)
57
57
  ast (~> 2.4.0)
58
58
  pry (0.12.2)
59
59
  coderay (~> 1.1.0)
60
60
  method_source (~> 0.9.0)
61
- public_suffix (4.0.1)
61
+ public_suffix (4.0.3)
62
62
  rainbow (3.0.0)
63
63
  rake (13.0.1)
64
64
  rspec (3.9.0)
65
65
  rspec-core (~> 3.9.0)
66
66
  rspec-expectations (~> 3.9.0)
67
67
  rspec-mocks (~> 3.9.0)
68
- rspec-core (3.9.0)
69
- rspec-support (~> 3.9.0)
68
+ rspec-core (3.9.1)
69
+ rspec-support (~> 3.9.1)
70
70
  rspec-expectations (3.9.0)
71
71
  diff-lcs (>= 1.2.0, < 2.0)
72
72
  rspec-support (~> 3.9.0)
73
73
  rspec-its (1.3.0)
74
74
  rspec-core (>= 3.0.0)
75
75
  rspec-expectations (>= 3.0.0)
76
- rspec-mocks (3.9.0)
76
+ rspec-mocks (3.9.1)
77
77
  diff-lcs (>= 1.2.0, < 2.0)
78
78
  rspec-support (~> 3.9.0)
79
- rspec-support (3.9.0)
80
- rubocop (0.75.1)
79
+ rspec-support (3.9.2)
80
+ rubocop (0.77.0)
81
81
  jaro_winkler (~> 1.5.1)
82
82
  parallel (~> 1.10)
83
83
  parser (>= 2.6)
84
84
  rainbow (>= 2.2.2, < 4.0)
85
85
  ruby-progressbar (~> 1.7)
86
86
  unicode-display_width (>= 1.4.0, < 1.7)
87
- rubocop-performance (1.5.1)
87
+ rubocop-performance (1.5.2)
88
88
  rubocop (>= 0.71.0)
89
89
  ruby-progressbar (1.10.1)
90
90
  ruby_parser (3.14.1)
@@ -96,17 +96,17 @@ GEM
96
96
  json (>= 1.8, < 3)
97
97
  simplecov-html (~> 0.10.0)
98
98
  simplecov-html (0.10.2)
99
- standard (0.1.6)
100
- rubocop (~> 0.75.0)
101
- rubocop-performance (~> 1.5.0)
102
- thor (0.20.3)
99
+ standard (0.1.7)
100
+ rubocop (~> 0.77.0)
101
+ rubocop-performance (~> 1.5.1)
102
+ thor (1.0.1)
103
103
  thread_safe (0.3.6)
104
104
  tomlrb (1.2.9)
105
- tzinfo (1.2.5)
105
+ tzinfo (1.2.6)
106
106
  thread_safe (~> 0.1)
107
- unicode-display_width (1.6.0)
107
+ unicode-display_width (1.6.1)
108
108
  vcr (5.0.0)
109
- webmock (3.7.6)
109
+ webmock (3.8.0)
110
110
  addressable (>= 2.3.6)
111
111
  crack (>= 0.3.2)
112
112
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -133,4 +133,4 @@ DEPENDENCIES
133
133
  webmock
134
134
 
135
135
  BUNDLED WITH
136
- 2.1.0.pre.3
136
+ 2.1.2
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eve_online (0.30.0)
4
+ eve_online (0.31.0)
5
5
  activesupport (>= 4.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.1)
11
+ activesupport (6.0.2.1)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
@@ -38,10 +38,10 @@ GEM
38
38
  docile (1.3.2)
39
39
  equalizer (0.0.11)
40
40
  hashdiff (1.0.0)
41
- i18n (1.7.0)
41
+ i18n (1.8.2)
42
42
  concurrent-ruby (~> 1.0)
43
43
  ice_nine (0.11.2)
44
- json (2.2.0)
44
+ json (2.3.0)
45
45
  kramdown (2.1.0)
46
46
  kramdown-parser-gfm (1.1.0)
47
47
  kramdown (~> 2.0)
@@ -53,82 +53,78 @@ GEM
53
53
  memoizable (0.4.2)
54
54
  thread_safe (~> 0.3, >= 0.3.1)
55
55
  mini_portile2 (2.4.0)
56
- minitest (5.13.0)
57
- mixlib-cli (2.1.1)
58
- mixlib-config (3.0.5)
56
+ minitest (5.14.0)
57
+ mixlib-cli (2.1.5)
58
+ mixlib-config (3.0.6)
59
59
  tomlrb
60
- morpher (0.2.6)
60
+ mprelude (0.1.0)
61
61
  abstract_type (~> 0.0.7)
62
62
  adamantium (~> 0.2.0)
63
- anima (~> 0.3.0)
64
- ast (~> 2.2)
65
63
  concord (~> 0.1.5)
66
64
  equalizer (~> 0.0.9)
67
- ice_nine (~> 0.11.0)
65
+ ice_nine (~> 0.11.1)
68
66
  procto (~> 0.0.2)
69
- mutant (0.8.24)
67
+ mutant (0.9.4)
70
68
  abstract_type (~> 0.0.7)
71
69
  adamantium (~> 0.2.0)
72
- anima (~> 0.3.0)
70
+ anima (~> 0.3.1)
73
71
  ast (~> 2.2)
74
72
  concord (~> 0.1.5)
75
73
  diff-lcs (~> 1.3)
76
74
  equalizer (~> 0.0.9)
77
75
  ice_nine (~> 0.11.1)
78
76
  memoizable (~> 0.4.2)
79
- morpher (~> 0.2.6)
80
- parser (~> 2.5.1)
77
+ mprelude (~> 0.1.0)
78
+ parser (~> 2.6.5)
81
79
  procto (~> 0.0.2)
82
- regexp_parser (~> 1.2)
83
- unparser (~> 0.4.2)
84
- mutant-rspec (0.8.24)
85
- mutant (~> 0.8.24)
86
- rspec-core (>= 3.4.0, < 4.0.0)
80
+ unparser (~> 0.4.6)
81
+ mutant-rspec (0.9.4)
82
+ mutant (~> 0.9.4)
83
+ rspec-core (>= 3.8.0, < 4.0.0)
87
84
  nokogiri (1.10.7)
88
85
  mini_portile2 (~> 2.4.0)
89
- parser (2.5.3.0)
86
+ parser (2.6.5.0)
90
87
  ast (~> 2.4.0)
91
88
  procto (0.0.3)
92
- public_suffix (4.0.1)
89
+ public_suffix (4.0.3)
93
90
  rake (13.0.1)
94
- regexp_parser (1.6.0)
95
91
  rspec (3.9.0)
96
92
  rspec-core (~> 3.9.0)
97
93
  rspec-expectations (~> 3.9.0)
98
94
  rspec-mocks (~> 3.9.0)
99
- rspec-core (3.9.0)
100
- rspec-support (~> 3.9.0)
95
+ rspec-core (3.9.1)
96
+ rspec-support (~> 3.9.1)
101
97
  rspec-expectations (3.9.0)
102
98
  diff-lcs (>= 1.2.0, < 2.0)
103
99
  rspec-support (~> 3.9.0)
104
100
  rspec-its (1.3.0)
105
101
  rspec-core (>= 3.0.0)
106
102
  rspec-expectations (>= 3.0.0)
107
- rspec-mocks (3.9.0)
103
+ rspec-mocks (3.9.1)
108
104
  diff-lcs (>= 1.2.0, < 2.0)
109
105
  rspec-support (~> 3.9.0)
110
- rspec-support (3.9.0)
106
+ rspec-support (3.9.2)
111
107
  safe_yaml (1.0.5)
112
108
  simplecov (0.17.1)
113
109
  docile (~> 1.1)
114
110
  json (>= 1.8, < 3)
115
111
  simplecov-html (~> 0.10.0)
116
112
  simplecov-html (0.10.2)
117
- thor (0.20.3)
113
+ thor (1.0.1)
118
114
  thread_safe (0.3.6)
119
115
  tomlrb (1.2.9)
120
- tzinfo (1.2.5)
116
+ tzinfo (1.2.6)
121
117
  thread_safe (~> 0.1)
122
- unparser (0.4.2)
118
+ unparser (0.4.7)
123
119
  abstract_type (~> 0.0.7)
124
120
  adamantium (~> 0.2.0)
125
121
  concord (~> 0.1.5)
126
122
  diff-lcs (~> 1.3)
127
123
  equalizer (~> 0.0.9)
128
- parser (>= 2.3.1.2, < 2.6)
124
+ parser (>= 2.6.5)
129
125
  procto (~> 0.0.2)
130
126
  vcr (5.0.0)
131
- webmock (3.7.6)
127
+ webmock (3.8.0)
132
128
  addressable (>= 2.3.6)
133
129
  crack (>= 0.3.2)
134
130
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -153,4 +149,4 @@ DEPENDENCIES
153
149
  webmock
154
150
 
155
151
  BUNDLED WITH
156
- 2.1.0.pre.3
152
+ 2.1.2
data/README.md CHANGED
@@ -51,6 +51,7 @@ gem install eve_online
51
51
  * MRI 2.4
52
52
  * MRI 2.5
53
53
  * MRI 2.6
54
+ * MRI 2.7
54
55
  * JRuby 9.2.9.0
55
56
 
56
57
  ## Supported rails versions
@@ -1466,22 +1467,103 @@ corporation_loyalty_store_offers.etag # => "89211f42fde090e4d22621e9b97d7604ab87
1466
1467
 
1467
1468
  #### Return mail headers
1468
1469
 
1470
+ ```ruby
1471
+ ```
1472
+
1469
1473
  #### Send a new mail
1470
1474
 
1475
+ ```ruby
1476
+ ```
1477
+
1471
1478
  #### Delete a mail
1472
1479
 
1480
+ ```ruby
1481
+ ```
1482
+
1473
1483
  #### Return a mail
1474
1484
 
1485
+ ```ruby
1486
+ options = { character_id: 1_337_512_245, mail_id: 376_045_681, token: "token" }
1487
+
1488
+ character_mail = EveOnline::ESI::CharacterGetMail.new(options)
1489
+
1490
+ character_mail.scope # => "esi-mail.read_mail.v1"
1491
+
1492
+ character_mail.as_json # => {:body=>"<font size=\"12\" color=\"#bfffffff\">moving</font>",
1493
+ # :from_id=>1208274826,
1494
+ # :read=>true,
1495
+ # :subject=>"moving",
1496
+ # :timestamp=>Mon, 10 Jun 2019 07:50:00 UTC +00:00}
1497
+
1498
+ character_mail.body # => "<font size=\"12\" color=\"#bfffffff\">moving</font>"
1499
+ character_mail.from_id # => 1208274826
1500
+ character_mail.read # => true
1501
+ character_mail.subject # => "moving"
1502
+ character_mail.timestamp # => Mon, 10 Jun 2019 07:50:00 UTC +00:00
1503
+
1504
+ character_mail.label_ids # => [4]
1505
+
1506
+ character_mail.recipients.size # => 1
1507
+
1508
+ recipient = character_mail.recipients.first
1509
+
1510
+ recipient.as_json # => {:recipient_id=>98134807,
1511
+ # :recipient_type=>"corporation"}
1512
+
1513
+ recipient.recipient_id # => 98134807
1514
+ recipient.recipient_type # => "corporation"
1515
+
1516
+ character_mail.etag # => "90dba7f7a6e60bfe8527b9f5112b9ca588c8f57d01415717be525a91"
1517
+ ```
1518
+
1475
1519
  #### Update metadata about a mail
1476
1520
 
1521
+ ```ruby
1522
+ ```
1523
+
1477
1524
  #### Get mail labels and unread counts
1478
1525
 
1526
+ ```ruby
1527
+ options = { character_id: 1_337_512_245, token: "token" }
1528
+
1529
+ character_mail_labels = EveOnline::ESI::CharacterMailLabels.new(options)
1530
+
1531
+ character_mail_labels.scope # => "esi-mail.read_mail.v1"
1532
+
1533
+ character_mail_labels.total_unread_count # => 288
1534
+
1535
+ character_mail_labels.labels.size # => 4
1536
+
1537
+ label = character_mail_labels.labels.last
1538
+
1539
+ label.as_json # => {:color=>"#ffffff",
1540
+ # :label_id=>8,
1541
+ # :name=>"[Alliance]",
1542
+ # :unread_count=>227}
1543
+
1544
+ label.color # => "#ffffff"
1545
+ label.label_id # => 8
1546
+ label.name # => "[Alliance]"
1547
+ label.unread_count # => 227
1548
+
1549
+ character_mail_labels.etag # => "265cfe7f2d7df2273342ed75c92b5047af6f76a3807dcc8353b5f379"
1550
+ ```
1551
+
1479
1552
  #### Create a mail label
1480
1553
 
1554
+ ```ruby
1555
+ ```
1556
+
1481
1557
  #### Delete a mail label
1482
1558
 
1559
+ ```ruby
1560
+ ```
1561
+
1483
1562
  #### Return mailing list subscriptions
1484
1563
 
1564
+ ```ruby
1565
+ ```
1566
+
1485
1567
  ### Market
1486
1568
 
1487
1569
  #### List open orders from a character
@@ -2221,23 +2303,24 @@ region = EveOnline::ESI::UniverseRegion.new(options)
2221
2303
 
2222
2304
  region.scope # => nil
2223
2305
 
2224
- region.as_json # => {:constellations=>[20000001,20000002,20000003,...,20000016],
2225
- # :description=>"The Derelik region...",
2306
+ region.as_json # => {:description=>"The Derelik region...",
2226
2307
  # :name=>"Derelik",
2227
2308
  # :region_id=>10000001}
2228
2309
 
2229
- region.constellations # => [20000001,20000002,20000003,...,20000016]
2230
2310
  region.description # => "The Derelik region..."
2231
2311
  region.name # => "Derelik"
2232
2312
  region.region_id # => 10000001
2233
2313
 
2314
+ region.constellation_ids.size # => 16
2315
+ region.constellation_ids.first # => 20000001
2316
+
2234
2317
  region.etag # => "2c8392581d493e06c015ca3d48d4076079bf4c976b1f776742592260"
2235
2318
  ```
2236
2319
 
2237
2320
  #### Get stargate information
2238
2321
 
2239
2322
  ```ruby
2240
- options = { id: 50000056 }
2323
+ options = { id: 50_000_056 }
2241
2324
 
2242
2325
  stargate = EveOnline::ESI::UniverseStargate.new(options)
2243
2326
 
@@ -2246,18 +2329,16 @@ stargate.scope # => nil
2246
2329
  stargate.as_json # => {:name=>"Stargate (Akpivem)",
2247
2330
  # :stargate_id=>50000056,
2248
2331
  # :system_id=>30000001,
2249
- # :type_id=>29624}
2332
+ # :type_id=>29624,
2333
+ # :destination_stargate_id=>50000342,
2334
+ # :destination_system_id=>30000003}
2250
2335
 
2251
2336
  stargate.name # => "Stargate (Akpivem)"
2252
2337
  stargate.stargate_id # => 50000056
2253
2338
  stargate.system_id # => 30000001
2254
2339
  stargate.type_id # => 29624
2255
-
2256
- stargate.destination.as_json # => {:stargate_id=>50000342,
2257
- # :system_id=>30000003}
2258
-
2259
- stargate.destination.stargate_id # => 50000342
2260
- stargate.destination.system_id # => 30000003
2340
+ stargate.destination_stargate_id # => 50000342
2341
+ stargate.destination_system_id # => 30000003
2261
2342
 
2262
2343
  stargate.position.as_json # => {:x=>331516354560.0,
2263
2344
  # :y=>43597455360.0,
@@ -2853,19 +2934,9 @@ races.write_timeout = 120
2853
2934
  races.write_timeout # => 120
2854
2935
  ```
2855
2936
 
2856
- ## Datasource
2857
-
2858
- Default datasource is `tranquility`. If you want to change it, for e.g., to `singularity`, add `datasource: 'singularity'` to default hash with options:
2859
-
2860
- ```ruby
2861
- options = { datasource: 'singularity' }
2862
-
2863
- races = EveOnline::ESI::UniverseRaces.new(options)
2864
- ```
2865
-
2866
2937
  ## Languages support
2867
2938
 
2868
- Default language is `en-us`. Supported languages: `de`, `en-us`, `fr`, `ja`, `ru`, `zh`.
2939
+ Default language is `en-us`. Supported languages: `de`, `en-us`, `fr`, `ja`, `ru`, `zh`, `ko`.
2869
2940
 
2870
2941
  If you want change it, for e.g., to `de`, add `language: 'de'` to default hash with options:
2871
2942
 
@@ -69,6 +69,16 @@ require "eve_online/esi/character_ship"
69
69
  require "eve_online/esi/character_loyalty_points"
70
70
  require "eve_online/esi/corporation_loyalty_store_offers"
71
71
 
72
+ # require "eve_online/esi/character_mail_headers"
73
+ # require "eve_online/esi/character_new_mail"
74
+ # require "eve_online/esi/character_delete_mail"
75
+ require "eve_online/esi/character_get_mail"
76
+ # require "eve_online/esi/character_update_mail"
77
+ require "eve_online/esi/character_mail_labels"
78
+ # require "eve_online/esi/character_new_mail_label"
79
+ # require "eve_online/esi/character_delete_mail_label"
80
+ # require "eve_online/esi/character_mail_lists"
81
+
72
82
  require "eve_online/esi/character_orders"
73
83
  require "eve_online/esi/corporation_orders"
74
84
  require "eve_online/esi/market_history"
@@ -166,6 +176,12 @@ require "eve_online/esi/models/alliance_icon"
166
176
  require "eve_online/esi/models/offer_required_item"
167
177
  require "eve_online/esi/models/offer_required_items"
168
178
 
179
+ # require "eve_online/esi/models/mail_header"
180
+ require "eve_online/esi/models/mail_recipient"
181
+ require "eve_online/esi/models/mail_recipients"
182
+ require "eve_online/esi/models/mail"
183
+ require "eve_online/esi/models/mail_label"
184
+
169
185
  require "eve_online/esi/models/dogma_attribute"
170
186
  require "eve_online/esi/models/dogma_attributes"
171
187
  require "eve_online/esi/models/dogma_attribute_short"
@@ -192,7 +208,6 @@ require "eve_online/esi/models/asteroid_belt"
192
208
  require "eve_online/esi/models/moon"
193
209
  require "eve_online/esi/models/system_jump"
194
210
  require "eve_online/esi/models/system_kill"
195
- require "eve_online/esi/models/stargate_destination"
196
211
  require "eve_online/esi/models/stargate"
197
212
  require "eve_online/esi/models/star"
198
213
  require "eve_online/esi/models/station"
@@ -11,7 +11,7 @@ module EveOnline
11
11
  API_HOST = "esi.evetech.net"
12
12
 
13
13
  attr_reader :token, :parser, :_read_timeout, :_open_timeout, :_etag,
14
- :datasource, :language
14
+ :language
15
15
 
16
16
  if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
17
17
  attr_reader :_write_timeout
@@ -26,7 +26,6 @@ module EveOnline
26
26
  @_write_timeout = options.fetch(:write_timeout, 60)
27
27
  end
28
28
  @_etag = options.fetch(:etag, nil)
29
- @datasource = options.fetch(:datasource, "tranquility")
30
29
  @language = options.fetch(:language, "en-us")
31
30
  end
32
31
 
@@ -122,9 +121,11 @@ module EveOnline
122
121
  end
123
122
 
124
123
  def uri
125
- @uri ||= URI::HTTPS.build(host: API_HOST,
126
- path: path,
127
- query: query.to_query)
124
+ @uri ||= begin
125
+ params = {host: API_HOST, path: path}
126
+ params[:query] = query.to_query if query.presence
127
+ URI::HTTPS.build(params)
128
+ end
128
129
  end
129
130
 
130
131
  def additional_query_params
@@ -132,7 +133,7 @@ module EveOnline
132
133
  end
133
134
 
134
135
  def base_query_params
135
- [:datasource]
136
+ []
136
137
  end
137
138
 
138
139
  def path
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "forwardable"
4
+
5
+ module EveOnline
6
+ module ESI
7
+ class CharacterGetMail < Base
8
+ extend Forwardable
9
+
10
+ API_PATH = "/v1/characters/%<character_id>s/mail/%<mail_id>s/"
11
+
12
+ attr_reader :character_id, :mail_id
13
+
14
+ def initialize(options)
15
+ super
16
+
17
+ @character_id = options.fetch(:character_id)
18
+ @mail_id = options.fetch(:mail_id)
19
+ end
20
+
21
+ def_delegators :model, :as_json, :body, :from_id, :read, :subject,
22
+ :timestamp, :label_ids, :recipients
23
+
24
+ def model
25
+ @model ||= Models::Mail.new(response)
26
+ end
27
+
28
+ def scope
29
+ "esi-mail.read_mail.v1"
30
+ end
31
+
32
+ def path
33
+ format(API_PATH, character_id: character_id, mail_id: mail_id)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ class CharacterMailLabels < Base
6
+ API_PATH = "/v3/characters/%<character_id>s/mail/labels/"
7
+
8
+ attr_reader :character_id
9
+
10
+ def initialize(options)
11
+ super
12
+
13
+ @character_id = options.fetch(:character_id)
14
+ end
15
+
16
+ def labels
17
+ @labels ||=
18
+ begin
19
+ output = []
20
+ response.fetch("labels").each do |label|
21
+ output << Models::MailLabel.new(label)
22
+ end
23
+ output
24
+ end
25
+ end
26
+
27
+ def total_unread_count
28
+ response["total_unread_count"]
29
+ end
30
+
31
+ def scope
32
+ "esi-mail.read_mail.v1"
33
+ end
34
+
35
+ def path
36
+ format(API_PATH, character_id: character_id)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class Mail < Base
7
+ def as_json
8
+ {
9
+ body: body,
10
+ from_id: from_id,
11
+ read: read,
12
+ subject: subject,
13
+ timestamp: timestamp,
14
+ }
15
+ end
16
+
17
+ def body
18
+ options["body"]
19
+ end
20
+
21
+ def from_id
22
+ options["from"]
23
+ end
24
+
25
+ def read
26
+ options["read"]
27
+ end
28
+
29
+ def subject
30
+ options["subject"]
31
+ end
32
+
33
+ def timestamp
34
+ timestamp = options["timestamp"]
35
+
36
+ parse_datetime_with_timezone(timestamp) if timestamp
37
+ end
38
+
39
+ def label_ids
40
+ options["labels"]
41
+ end
42
+
43
+ def recipients
44
+ @recipients ||= MailRecipients.new(options["recipients"]).mail_recipients
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class MailLabel < Base
7
+ def as_json
8
+ {
9
+ color: color,
10
+ label_id: label_id,
11
+ name: name,
12
+ unread_count: unread_count,
13
+ }
14
+ end
15
+
16
+ def color
17
+ options["color"]
18
+ end
19
+
20
+ def label_id
21
+ options["label_id"]
22
+ end
23
+
24
+ def name
25
+ options["name"]
26
+ end
27
+
28
+ def unread_count
29
+ options["unread_count"]
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class MailRecipient < Base
7
+ def as_json
8
+ {
9
+ recipient_id: recipient_id,
10
+ recipient_type: recipient_type,
11
+ }
12
+ end
13
+
14
+ def recipient_id
15
+ options["recipient_id"]
16
+ end
17
+
18
+ def recipient_type
19
+ options["recipient_type"]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EveOnline
4
+ module ESI
5
+ module Models
6
+ class MailRecipients < Base
7
+ def mail_recipients
8
+ output = []
9
+
10
+ return output unless options.is_a?(Array)
11
+
12
+ options.each do |mail_recipient|
13
+ output << MailRecipient.new(mail_recipient)
14
+ end
15
+
16
+ output
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -6,17 +6,12 @@ module EveOnline
6
6
  class Region < Base
7
7
  def as_json
8
8
  {
9
- constellations: constellations, # TODO: rename constellations -> constellation_ids and remove from as_json
10
9
  description: description,
11
10
  name: name,
12
11
  region_id: region_id,
13
12
  }
14
13
  end
15
14
 
16
- def constellations
17
- options["constellations"]
18
- end
19
-
20
15
  def description
21
16
  options["description"]
22
17
  end
@@ -28,6 +23,10 @@ module EveOnline
28
23
  def region_id
29
24
  options["region_id"]
30
25
  end
26
+
27
+ def constellation_ids
28
+ options["constellations"]
29
+ end
31
30
  end
32
31
  end
33
32
  end
@@ -10,6 +10,8 @@ module EveOnline
10
10
  stargate_id: stargate_id,
11
11
  system_id: system_id,
12
12
  type_id: type_id,
13
+ destination_stargate_id: destination_stargate_id,
14
+ destination_system_id: destination_system_id,
13
15
  }
14
16
  end
15
17
 
@@ -29,8 +31,12 @@ module EveOnline
29
31
  options["type_id"]
30
32
  end
31
33
 
32
- def destination
33
- @destination ||= StargateDestination.new(options["destination"])
34
+ def destination_stargate_id
35
+ options.dig("destination", "stargate_id")
36
+ end
37
+
38
+ def destination_system_id
39
+ options.dig("destination", "system_id")
34
40
  end
35
41
 
36
42
  def position
@@ -17,8 +17,8 @@ module EveOnline
17
17
  @id = options.fetch(:id)
18
18
  end
19
19
 
20
- def_delegators :model, :as_json, :constellations, :description, :name,
21
- :region_id
20
+ def_delegators :model, :as_json, :description, :name,
21
+ :region_id, :constellation_ids
22
22
 
23
23
  def model
24
24
  @model ||= Models::Region.new(response)
@@ -18,7 +18,7 @@ module EveOnline
18
18
  end
19
19
 
20
20
  def_delegators :model, :as_json, :name, :stargate_id, :system_id,
21
- :type_id, :destination, :position
21
+ :type_id, :destination_stargate_id, :destination_system_id, :position
22
22
 
23
23
  def model
24
24
  @model ||= Models::Stargate.new(response)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EveOnline
4
- VERSION = "0.30.0"
4
+ VERSION = "0.31.0"
5
5
  end
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.30.0
4
+ version: 0.31.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: 2019-12-06 00:00:00.000000000 Z
11
+ date: 2020-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,11 +192,13 @@ files:
192
192
  - lib/eve_online/esi/character_clones.rb
193
193
  - lib/eve_online/esi/character_corporation_history.rb
194
194
  - lib/eve_online/esi/character_fatigue.rb
195
+ - lib/eve_online/esi/character_get_mail.rb
195
196
  - lib/eve_online/esi/character_implants.rb
196
197
  - lib/eve_online/esi/character_industry_jobs.rb
197
198
  - lib/eve_online/esi/character_killmails_recent.rb
198
199
  - lib/eve_online/esi/character_location.rb
199
200
  - lib/eve_online/esi/character_loyalty_points.rb
201
+ - lib/eve_online/esi/character_mail_labels.rb
200
202
  - lib/eve_online/esi/character_notifications.rb
201
203
  - lib/eve_online/esi/character_online.rb
202
204
  - lib/eve_online/esi/character_orders.rb
@@ -275,6 +277,10 @@ files:
275
277
  - lib/eve_online/esi/models/killmail_short.rb
276
278
  - lib/eve_online/esi/models/loyalty_point.rb
277
279
  - lib/eve_online/esi/models/loyalty_store_offer.rb
280
+ - lib/eve_online/esi/models/mail.rb
281
+ - lib/eve_online/esi/models/mail_label.rb
282
+ - lib/eve_online/esi/models/mail_recipient.rb
283
+ - lib/eve_online/esi/models/mail_recipients.rb
278
284
  - lib/eve_online/esi/models/market_group.rb
279
285
  - lib/eve_online/esi/models/market_history.rb
280
286
  - lib/eve_online/esi/models/moon.rb
@@ -294,7 +300,6 @@ files:
294
300
  - lib/eve_online/esi/models/standing.rb
295
301
  - lib/eve_online/esi/models/star.rb
296
302
  - lib/eve_online/esi/models/stargate.rb
297
- - lib/eve_online/esi/models/stargate_destination.rb
298
303
  - lib/eve_online/esi/models/station.rb
299
304
  - lib/eve_online/esi/models/system.rb
300
305
  - lib/eve_online/esi/models/system_jump.rb
@@ -370,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
375
  - !ruby/object:Gem::Version
371
376
  version: '0'
372
377
  requirements: []
373
- rubygems_version: 3.0.6
378
+ rubygems_version: 3.1.2
374
379
  signing_key:
375
380
  specification_version: 4
376
381
  summary: EveOnline ESI API.
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EveOnline
4
- module ESI
5
- module Models
6
- class StargateDestination < Base
7
- def as_json
8
- {
9
- stargate_id: stargate_id,
10
- system_id: system_id,
11
- }
12
- end
13
-
14
- def stargate_id
15
- options["stargate_id"]
16
- end
17
-
18
- def system_id
19
- options["system_id"]
20
- end
21
- end
22
- end
23
- end
24
- end