From ce103dad5af0780ca09bf57b15a9b66971c0ac1a Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 27 Jun 2025 08:16:48 -0400 Subject: [PATCH] Get specs running again, but they still fail (#86) * Get specs running again, but they still fail on Ruby 3.4 * Add Ruby 3.4 to test matrix * Remove bundler from dev dependencies --- .github/workflows/ci.yml | 4 ++-- .travis.yml | 6 ------ README.md | 5 ++--- Rakefile | 4 ++++ bin/console | 0 grape_logging.gemspec | 7 ++----- lib/grape_logging/middleware/request_logger.rb | 2 +- 7 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 .travis.yml mode change 100644 => 100755 bin/console diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9ec785..460787a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Grape Logging CI +name: CI on: push: branches: [master] @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ["3.0", "3.1", "3.2", "3.3"] + ruby-version: ["3.0", "3.1", "3.2", "3.3", "3.4"] steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b620a5f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: ruby -rvm: - - 2.3.1 -cache: bundler -script: - - bundle exec rspec \ No newline at end of file diff --git a/README.md b/README.md index 324c47a..3bd1194 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # grape_logging -[![Code Climate](https://codeclimate.com/github/aserafin/grape_logging/badges/gpa.svg)](https://codeclimate.com/github/aserafin/grape_logging) -[![Build Status](https://travis-ci.org/aserafin/grape_logging.svg?branch=master)](https://travis-ci.org/aserafin/grape_logging) +[![CI](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml/badge.svg)](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml) ## Installation @@ -19,7 +18,7 @@ Or install it yourself as: ## Basic Usage -In your api file (somewhere on the top), insert grape logging middleware before grape error middleware. This is important due to the behaviour of `lib/grape/middleware/error.rb`, which manipulates the status of the response when there is an error. +In your api file (somewhere on the top), insert grape logging middleware before grape error middleware. This is important due to the behaviour of `lib/grape/middleware/error.rb`, which manipulates the status of the response when there is an error. ```ruby require 'grape_logging' diff --git a/Rakefile b/Rakefile index 33eb07c..4c774a2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,2 +1,6 @@ require 'bundler/gem_tasks' +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new(:spec) + +task default: :spec diff --git a/bin/console b/bin/console old mode 100644 new mode 100755 diff --git a/grape_logging.gemspec b/grape_logging.gemspec index ebe4cf4..6afc5a9 100644 --- a/grape_logging.gemspec +++ b/grape_logging.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'grape_logging/version' @@ -19,11 +18,9 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'grape' + spec.add_dependency 'grape', '< 2.4.0' spec.add_dependency 'rack' - spec.add_development_dependency 'bundler', '~> 1.8' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rake', '~> 13.3' spec.add_development_dependency 'rspec', '~> 3.5' - spec.add_development_dependency 'pry-byebug', '~> 3.4.2' end diff --git a/lib/grape_logging/middleware/request_logger.rb b/lib/grape_logging/middleware/request_logger.rb index a401ab1..92a9e4f 100644 --- a/lib/grape_logging/middleware/request_logger.rb +++ b/lib/grape_logging/middleware/request_logger.rb @@ -1,4 +1,4 @@ -require 'grape/middleware/base' +require 'grape' module GrapeLogging module Middleware