From a7632c7046bd6218f20c695ae9fc151a1e07d7ce Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 27 Jan 2023 17:45:26 +0100 Subject: [PATCH 01/10] Bump ruby version to 2.7.7 --- .standard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.standard.yml b/.standard.yml index 927d25601..b7b319f8a 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,4 +1,4 @@ -ruby_version: 2.7.6 +ruby_version: 2.7.7 ignore: - 'lib/eve_online/esi/base.rb': From 9d372a8fc28975edbea185590dfef11c712a5102 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 27 Jan 2023 17:45:47 +0100 Subject: [PATCH 02/10] Cleanup --- .standard.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.standard.yml b/.standard.yml index b7b319f8a..30cbf8660 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,5 +1 @@ ruby_version: 2.7.7 - -ignore: - - 'lib/eve_online/esi/base.rb': - - Lint/DuplicateBranch From 372ae48808d37bcb2c00d14caec69c714799e07c Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 29 Jan 2023 12:55:47 +0100 Subject: [PATCH 03/10] Bump year --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index fcab8824e..1cbd6a5e5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2022 Igor Zubkov +Copyright (c) 2015-2023 Igor Zubkov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From f1ad4325e639abc2ec82dc2c688053286fa33dc1 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 29 Jan 2023 12:57:52 +0100 Subject: [PATCH 04/10] Add caching section to README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index df06650b0..1b0aba06e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ This gem was extracted from [EveMonk](https://evemonk.com). Source code of EveMo * [Usage](#usage) * [Useful links](#useful-links) * [Development](#development) +* [Caching](#caching) * [Contributing](#contributing) * [Author](#author) * [Contributors](#contributors) @@ -3086,6 +3087,10 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +## Caching + +TODO + ## Contributing Issue reports and pull requests are welcome on GitHub at . From 32d35831b18c4a22ba551a55bfe3b19f7269bfa1 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 29 Jan 2023 13:01:40 +0100 Subject: [PATCH 05/10] Fill caching section --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b0aba06e..4a1c5e775 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ This gem was extracted from [EveMonk](https://evemonk.com). Source code of EveMo Add this line to your application's Gemfile: ```ruby -gem 'eve_online' +gem "eve_online" ``` And then execute: @@ -3089,7 +3089,29 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Caching -TODO +If you want to cache API calls (and this is highly recommended by CCP), you +can use [Faraday Http Cache](https://github.com/sourcelevel/faraday-http-cache). + +Add the gem to your Gemfile + +```ruby +gem "faraday-http-cache" +``` + +Next, construct your own Faraday middleware: + +```ruby +stack = Faraday::RackBuilder.new do |builder| + builder.use Faraday::HttpCache, serializer: Marshal, shared_cache: false + builder.use Octokit::Response::RaiseError + builder.adapter Faraday.default_adapter +end +EveOnline::ESI.middleware = stack +``` + +Once configured, the middleware will store responses in cache based on ETag +fingerprint and serve those back up for future `304` responses for the same +resource. See the [project README](https://github.com/sourcelevel/faraday-http-cache) for advanced usage. ## Contributing From 6f92825f2d5180a2fe50f1789ad4b9dffb4f992b Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 29 Jan 2023 13:03:04 +0100 Subject: [PATCH 06/10] Cleanup --- README.md | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 4a1c5e775..93dcbccd9 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ alliance_icon.icon_small # => "https://images.evetech.net/alliances/99005443/log #### Get character assets ```ruby -options = { token: 'token123', character_id: 90_729_314, page: 1 } +options = { token: "token123", character_id: 90_729_314, page: 1 } character_assets = EveOnline::ESI::CharacterAssets.new(options) @@ -172,7 +172,7 @@ asset.type_id # => 1010 #### Get character asset locations ```ruby -options = { token: 'token123', character_id: 1_337_512_245, item_ids: [1_001_215_602_246] } +options = { token: "token123", character_id: 1_337_512_245, item_ids: [1_001_215_602_246] } character_assets_locations = EveOnline::ESI::CharacterAssetsLocations.new(options) @@ -198,7 +198,7 @@ asset_location.position.z # => -971212198300.4812 #### Get character asset names ```ruby -options = { token: 'token123', character_id: 1_337_512_245, item_ids: [1_001_215_602_246] } +options = { token: "token123", character_id: 1_337_512_245, item_ids: [1_001_215_602_246] } character_assets_names = EveOnline::ESI::CharacterAssetsNames.new(options) @@ -218,7 +218,7 @@ asset_name.name # => "HOLE" #### Get corporation assets ```ruby -options = { token: 'token123', corporation_id: 98_134_807, page: 1 } +options = { token: "token123", corporation_id: 98_134_807, page: 1 } corporation_assets = EveOnline::ESI::CorporationAssets.new(options) @@ -256,7 +256,7 @@ asset.type_id # => 1010 #### Get corporation asset locations ```ruby -options = { token: 'token123', corporation_id: 98_134_807, item_ids: [1_001_215_602_246] } +options = { token: "token123", corporation_id: 98_134_807, item_ids: [1_001_215_602_246] } corporation_assets_locations = EveOnline::ESI::CorporationAssetsLocations.new(options) @@ -284,7 +284,7 @@ asset_location.position.z # => -971212198300.4812 #### Get corporation asset names ```ruby -options = { token: 'token123', corporation_id: 98_134_807, item_ids: [1_001_215_602_246] } +options = { token: "token123", corporation_id: 98_134_807, item_ids: [1_001_215_602_246] } corporation_assets_names = EveOnline::ESI::CorporationAssetsNames.new(options) @@ -319,7 +319,7 @@ asset_name.name # => "HOLE" ```ruby # Add `from_event` if you want skip records -options = { token: 'token123', character_id: 90_729_314 } +options = { token: "token123", character_id: 90_729_314 } character_calendar = EveOnline::ESI::CharacterCalendar.new(options) @@ -345,7 +345,7 @@ event.title # => "Moon extraction for 66-PMM - GoldMine-5-" #### Get an event ```ruby -options = { token: 'token123', character_id: 90_729_314, event_id: 1_635_240 } +options = { token: "token123", character_id: 90_729_314, event_id: 1_635_240 } calendar_event = EveOnline::ESI::CharacterCalendarEvent.new(options) @@ -419,7 +419,7 @@ character.title # => nil #### Get blueprints ```ruby -options = { token: 'token123', character_id: 90729314, page: 1 } +options = { token: "token123", character_id: 90729314, page: 1 } character_blueprints = EveOnline::ESI::CharacterBlueprints.new(options) @@ -481,7 +481,7 @@ entry.start_date # => Tue, 10 May 2011 10:23:00 UTC +00:00 #### Get jump fatigue ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_fatigue = EveOnline::ESI::CharacterFatigue.new(options) @@ -503,7 +503,7 @@ character_fatigue.last_update_date # => nil #### Get character notifications ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_notifications = EveOnline::ESI::CharacterNotifications.new(options) @@ -557,7 +557,7 @@ character_portrait.small # => "https://images.evetech.net/Character/1337512245_6 #### Get standings ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_standing = EveOnline::ESI::CharacterStandings.new(options) @@ -587,7 +587,7 @@ standing.standing # => 0.3303719111639991 #### Get clones ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_clones = EveOnline::ESI::CharacterClones.new(options) @@ -620,7 +620,7 @@ character_clones.last_station_change_date # => Tue, 30 Jun 2015 21:51:13 UTC +00 #### Get active implants ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_implants = EveOnline::ESI::CharacterImplants.new(options) @@ -656,7 +656,7 @@ character_implants.implant_ids # => [9899, 9941, 9942, 9943, 9956] #### Get contracts ```ruby -options = { token: 'token123', character_id: 1337512245, page: 1 } +options = { token: "token123", character_id: 1337512245, page: 1 } contracts = EveOnline::ESI::CharacterContracts.new(options) @@ -886,7 +886,7 @@ entry.start_date # => Mon, 03 Jun 2019 00:17:00 UTC +00:00 #### Get corporation blueprints ```ruby -options = { token: 'token123', corporation_id: 98260237, page: 1 } +options = { token: "token123", corporation_id: 98260237, page: 1 } corporation_blueprints = EveOnline::ESI::CorporationBlueprints.new(options) @@ -936,7 +936,7 @@ corporation_blueprints.roles # => ["Director"] #### Get corporation members ```ruby -options = { token: 'token123', corporation_id: 98565696 } +options = { token: "token123", corporation_id: 98565696 } corporation_members = EveOnline::ESI::CorporationMembers.new(options) @@ -1176,7 +1176,7 @@ modifier.operator # => 6 #### List character industry jobs ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_jobs = EveOnline::ESI::CharacterIndustryJobs.new(options) @@ -1244,7 +1244,7 @@ job.successful_runs # => nil #### List corporation industry jobs ```ruby -options = { token: 'token123', corporation_id: 98_146_630 } +options = { token: "token123", corporation_id: 98_146_630 } corporation_jobs = EveOnline::ESI::CorporationIndustryJobs.new(options) @@ -1320,7 +1320,7 @@ corporation_jobs.roles # => ["Factory_Manager"] #### Get a character's recent kills and losses ```ruby -options = { token: 'token123', character_id: 90_729_314 } +options = { token: "token123", character_id: 90_729_314 } character_killmails = EveOnline::ESI::CharacterKillmailsRecent.new(options) @@ -1344,7 +1344,7 @@ killmail.killmail_id # => 81646519 #### Get a corporation's recent kills and losses ```ruby -options = { token: 'token123', corporation_id: 98_146_630 } +options = { token: "token123", corporation_id: 98_146_630 } corporation_killmails = EveOnline::ESI::CorporationKillmailsRecent.new(options) @@ -1382,7 +1382,7 @@ killmail = EveOnline::ESI::Killmail.new(options) #### Get character location ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_location = EveOnline::ESI::CharacterLocation.new(options) @@ -1400,7 +1400,7 @@ character_location.structure_id # => nil #### Get character online ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_online = EveOnline::ESI::CharacterOnline.new(options) @@ -1420,7 +1420,7 @@ character_online.online # => false #### Get current ship ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_ship = EveOnline::ESI::CharacterShip.new(options) @@ -1440,7 +1440,7 @@ character_ship.ship_type_id # => 606 #### Get loyalty points ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_loyalty_points = EveOnline::ESI::CharacterLoyaltyPoints.new(options) @@ -1595,7 +1595,7 @@ label.unread_count # => 227 #### List open orders from a character ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_orders = EveOnline::ESI::CharacterOrders.new(options) @@ -1630,7 +1630,7 @@ order.volume_total #### List open orders from a corporation ```ruby -options = { token: 'token123', corporation_id: 1_000_168, page: 1 } +options = { token: "token123", corporation_id: 1_000_168, page: 1 } corporation_orders = EveOnline::ESI::CorporationOrders.new(options) @@ -1874,7 +1874,7 @@ search.solar_system_ids # => [30000142] #### Get character attributes ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_attributes = EveOnline::ESI::CharacterAttributes.new(options) @@ -1902,7 +1902,7 @@ character_attributes.willpower # => 23 #### Get character's skill queue ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_skill_queue = EveOnline::ESI::CharacterSkillQueue.new(options) @@ -1934,7 +1934,7 @@ skill_queue_entry.training_start_sp # => 7263 #### Get character skills ```ruby -options = { token: 'token123', character_id: 90729314 } +options = { token: "token123", character_id: 90729314 } character_skills = EveOnline::ESI::CharacterSkills.new(options) @@ -2734,7 +2734,7 @@ type_dogma_effect.is_default # => false #### Get a character's wallet balance ```ruby -options = { token: 'token123', character_id: 90_729_314 } +options = { token: "token123", character_id: 90_729_314 } character_wallet = EveOnline::ESI::CharacterWallet.new(options) @@ -2748,7 +2748,7 @@ character_wallet.wallet # => 409488252.49 #### Get character wallet journal ```ruby -options = { token: 'token123', character_id: 90_729_314, page: 1 } +options = { token: "token123", character_id: 90_729_314, page: 1 } character_wallet_journal = EveOnline::ESI::CharacterWalletJournal.new(options) From fc2a6c7f56a8fcb08078cad63b382ccebd64ee28 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Mon, 6 Feb 2023 12:34:36 +0100 Subject: [PATCH 07/10] Format github --- .github/workflows/rspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 75dc92e14..abeeca64d 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -32,5 +32,5 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: bundle exec rspec - - run: bundle exec standardrb + - run: bundle exec standardrb --format github - run: bundle exec fasterer From ac4d5e9b1716d9d2faaef0daa9f947758c56f25a Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 9 Feb 2023 16:19:41 +0100 Subject: [PATCH 08/10] Update GitHub Actions by dependabot --- .github/dependabot.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ff967084d..d27e86d66 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,18 @@ version: 2 updates: -- package-ecosystem: bundler - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 99 - allow: - - dependency-type: direct - - dependency-type: indirect + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 99 + allow: + - dependency-type: "direct" + - dependency-type: "indirect" + assignees: + - "biow0lf" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + assignees: + - "biow0lf" From 9c20af207e74b8861e79f52e5452c2738b25443e Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 9 Feb 2023 16:20:18 +0100 Subject: [PATCH 09/10] Ruby 3.2.1 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 944880fa1..e4604e3af 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.0 +3.2.1 From 8f232756e4762205341f0c1d6b6ac57f03cc0d5b Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Thu, 9 Feb 2023 16:20:33 +0100 Subject: [PATCH 10/10] Update bundler to 2.4.6 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 325579f69..9384511d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,4 +136,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.4.5 + 2.4.6