Skip to content

Commit

Permalink
0.8.0: Automatic configuration on Rails (moved from yabeda-rails)
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Aug 21, 2020
1 parent f21191d commit 7b578d8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.8.0 - 2020-08-21

### Added

- Added railtie to automatically configure Yabeda on Rails: moved from [yabeda-rails](https://github.com/yabeda-rb/yabeda-rails) gem. [@Envek]

## 0.7.0 - 2020-08-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ And then execute:
Yabeda.configure!
```

_But [yabeda-rails] will do this for you automatically._
_If you're using Ruby on Rails then it will be configured automatically!_
3. Access metric in your app and use it!
Expand Down
1 change: 1 addition & 0 deletions lib/yabeda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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
11 changes: 11 additions & 0 deletions lib/yabeda/railtie.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Yabeda
module Rails
class Railtie < ::Rails::Railtie # :nodoc:
config.after_initialize do
Yabeda.configure! unless Yabeda.already_configured?
end
end
end
end
2 changes: 1 addition & 1 deletion lib/yabeda/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Yabeda
VERSION = "0.7.0"
VERSION = "0.8.0"
end

0 comments on commit 7b578d8

Please sign in to comment.