From 20c48cbf6cccaa8ee4a7678f766cb8e9a9ad1c70 Mon Sep 17 00:00:00 2001 From: LuukvH Date: Wed, 1 Mar 2023 15:14:45 +0100 Subject: [PATCH] chore: Remove Gemfile from ruby gems (#2) * chore: Remove Gemfile.lock from gem * chore: Remove deprecated ruby version --- .github/workflows/reviewdog.yml | 5 +-- .gitignore | 2 ++ Gemfile.lock | 50 --------------------------- appsignal-sourcemap.gemspec | 8 +++-- lib/appsignal/sourcemap/supervisor.rb | 12 +++---- lib/appsignal/sourcemap/uploader.rb | 10 +++--- lib/appsignal/sourcemap/version.rb | 2 +- 7 files changed, 20 insertions(+), 69 deletions(-) create mode 100644 .gitignore delete mode 100644 Gemfile.lock diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 52731d4..b03ac6f 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -6,8 +6,9 @@ jobs: fail-fast: false matrix: ruby: - - 2.7 - - 3.0 + - 3.1 + - 3.2 + - 3.3 runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0ace2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore Gemfile.lock for ruby gems +Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index bd3055a..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,50 +0,0 @@ -PATH - remote: . - specs: - appsignal-sourcemap (1.0.0.develop) - appsignal (~> 3.0) - parallel (~> 1.0) - -GEM - remote: https://rubygems.org/ - specs: - appsignal (3.0.11) - rack - ast (2.4.2) - parallel (1.20.1) - parser (3.0.2.0) - ast (~> 2.4.1) - rack (2.2.3) - rainbow (3.0.0) - regexp_parser (2.1.1) - rexml (3.2.5) - rubocop (1.18.4) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.8.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.8.0) - parser (>= 3.0.1.1) - rubocop-performance (1.11.4) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - standard (1.1.6) - rubocop (= 1.18.4) - rubocop-performance (= 1.11.4) - unicode-display_width (2.0.0) - -PLATFORMS - x86_64-darwin-20 - x86_64-linux - -DEPENDENCIES - appsignal-sourcemap! - standard - -BUNDLED WITH - 2.2.24 diff --git a/appsignal-sourcemap.gemspec b/appsignal-sourcemap.gemspec index 67f2e6e..4bca877 100644 --- a/appsignal-sourcemap.gemspec +++ b/appsignal-sourcemap.gemspec @@ -9,19 +9,21 @@ require "appsignal/sourcemap/version" Gem::Specification.new do |spec| spec.name = "appsignal-sourcemap" spec.version = Appsignal::Sourcemap::VERSION - spec.authors = ["Stef Schenkelaars"] - spec.email = ["stef.schenkelaars@gmail.com"] + spec.authors = ["Drieam"] + spec.email = ["dev@drieam.com"] spec.homepage = "https://github.com/drieam/appsignal-sourcemap" spec.summary = "Upload private sourcemaps to appsignal" spec.metadata["allowed_push_host"] = "https://rubygems.pkg.github.com/Drieam" - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.1" spec.files = Dir["lib/**/*", "README.md"] + spec.add_dependency "rails", ">= 6.1", "< 8.0" spec.add_dependency "appsignal", "~> 3.0" spec.add_dependency "parallel", "~> 1.0" spec.add_development_dependency "standard" + spec.metadata["rubygems_mfa_required"] = "true" end diff --git a/lib/appsignal/sourcemap/supervisor.rb b/lib/appsignal/sourcemap/supervisor.rb index f9330e5..c186da8 100644 --- a/lib/appsignal/sourcemap/supervisor.rb +++ b/lib/appsignal/sourcemap/supervisor.rb @@ -15,27 +15,25 @@ def self.start def start return if invalid_preconditions - Appsignal.logger.info("Starting sourcemaps upload") + Rails.logger.info("Starting sourcemaps upload") Parallel.each(source_map_paths, in_threads: PARALLEL_THREADS) do |source_map_path| Uploader.upload(source_map_path) end - Appsignal.logger.info("Finished sourcemaps upload") + Rails.logger.info("Finished sourcemaps upload") end private def invalid_preconditions unless Appsignal.config.valid? - return Appsignal.logger.error("Skipping sourcemaps upload since Appsignal config is invalid") + return Rails.logger.error("Skipping sourcemaps upload since Appsignal config is invalid") end if asset_host.blank? - return Appsignal.logger.error("Skipping sourcemaps upload since Rails asset_host is not set") - end - if source_map_paths.empty? - return Appsignal.logger.info("Skipping sourcemaps upload since no javascript maps are found") + return Rails.logger.error("Skipping sourcemaps upload since Rails asset_host is not set") end + return Rails.logger.info("Skipping sourcemaps upload since no javascript maps are found") if source_map_paths.empty? false end diff --git a/lib/appsignal/sourcemap/uploader.rb b/lib/appsignal/sourcemap/uploader.rb index 113aeb8..76c1d7d 100644 --- a/lib/appsignal/sourcemap/uploader.rb +++ b/lib/appsignal/sourcemap/uploader.rb @@ -13,24 +13,22 @@ def initialize(sourcemap_path) @sourcemap_path = sourcemap_path end - def upload # rubocop:disable Metrics/AbcSize - Appsignal.logger.debug "Starting sourcemap upload '#{@sourcemap_path}' with parameters: #{request_form_data}" + def upload + Rails.logger.debug("Starting sourcemap upload '#{@sourcemap_path}' with parameters: #{request_form_data}") response = Net::HTTP.start(UPLOAD_URI.hostname, UPLOAD_URI.port, use_ssl: true) do |http| http.request(request) end if response.is_a?(Net::HTTPSuccess) - Appsignal.logger.debug("Finished sourcemap upload '#{@sourcemap_path}'") + Rails.logger.debug("Finished sourcemap upload '#{@sourcemap_path}'") File.delete(sourcemap_full_path) return end - Appsignal.logger.error <<~MESSAGE + Rails.logger.error <<~MESSAGE Uploading sourcemap #{@sourcemap_path} failed with message '#{response.message}'. - Response: #{response.body} - MESSAGE end diff --git a/lib/appsignal/sourcemap/version.rb b/lib/appsignal/sourcemap/version.rb index 67aac89..ea2392b 100644 --- a/lib/appsignal/sourcemap/version.rb +++ b/lib/appsignal/sourcemap/version.rb @@ -2,6 +2,6 @@ module Appsignal module Sourcemap - VERSION = "1.0.0.develop" + VERSION = "1.1.1.develop" end end