Skip to content

Commit

Permalink
Merge branch 'master' into add-ability-to-change-adapters-settings
Browse files Browse the repository at this point in the history
* master:
  Switch to RubyGems Trusted publishing in CI release workflow [ci skip]
  Update CI for rubocop and fix lint issues
  fix: railtie loading to prevent calling methods that have not yet been defined (#38)
  • Loading branch information
Envek committed Oct 1, 2024
2 parents 3ada934 + 7f40203 commit 6c9ee57
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Lint Ruby
on:
push:
branches:
- master
- '**'
tags-ignore:
- 'v*'
paths:
- "gemfiles/*"
- "Gemfile"
Expand All @@ -20,12 +22,15 @@ on:

jobs:
rubocop:
# Skip running tests for local pull requests (use push event instead), run only for foreign ones
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: "3.3"
bundler-cache: true
- name: Lint Ruby code with RuboCop
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release gem to RubyGems
name: Build and release gem

on:
push:
Expand All @@ -8,13 +8,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.3"
- name: "Extract data from tag: version, message, body"
id: tag
run: |
Expand Down Expand Up @@ -75,8 +79,8 @@ jobs:
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
run: |
gem push yabeda-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
- name: Configure RubyGems Credentials
uses: rubygems/configure-rubygems-credentials@main
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
run: |
gem push yabeda-${{ steps.tag.outputs.version }}.gem
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
)
```

### Fixed

- Railtie loading to prevent calling methods that have not yet been defined

## 0.12.0 - 2023-07-28

### Added
Expand Down Expand Up @@ -54,7 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed

- Adapters now should use method `Yabeda.collect!` instead of manual calling of every collector block.
- Adapters now should use method `Yabeda.collect!` instead of manual calling of every collector block.

## 0.9.0 - 2021-05-07

Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ group :development, :test do
gem "pry"
gem "pry-byebug", platform: :mri

gem "rubocop", "~> 1.0"
gem "rubocop-rspec"
gem "rubocop", "~> 1.0", require: false
gem "rubocop-rspec", require: false
end
3 changes: 2 additions & 1 deletion lib/yabeda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require "yabeda/dsl"
require "yabeda/tags"
require "yabeda/errors"
require "yabeda/railtie" if defined?(Rails)

# Extendable framework for collecting and exporting metrics from Ruby apps
module Yabeda
Expand Down Expand Up @@ -149,3 +148,5 @@ def reset!
end
end
end

require "yabeda/railtie" if defined?(Rails)
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
c.syntax = :expect
end

config.filter_run focus: true
config.run_all_when_everything_filtered = true

config.after do
Yabeda.reset! # Undo call to +Yabeda.configure!+
end
Expand Down

0 comments on commit 6c9ee57

Please sign in to comment.