-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31b7001
commit 5d4041e
Showing
7 changed files
with
49 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
# encoding: utf-8 | |||
|
|||
require 'yell' | |||
|
|||
require File.dirname(__FILE__) + '/yell/railtie' if defined?(Rails) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,42 +1,4 @@ | |||
# The following is an example config file for yell with all possible options available. | test: | ||
# | |||
# To learn about the possible configuration options via a YAML file, read the wiki | |||
# on github: https://github.com/rudionrails/yell/wiki/101-configuration-with-yaml | |||
|
|||
development: &development | |||
# Enable colorized log output with the following. It is handy for development | |||
# or testing, but should not be turned on for staging or production. Otherwise | |||
# you will see those annoying ANSI color codes when on the remote production | |||
# machine. | |||
:colors: true | |||
|
|||
# we use the same settings for test that we defined for development | |||
test: *development | |||
|
|||
# In production, you should configure yell somewhat more specific. The following | |||
# is an example config - change it at your own will. | |||
production: | |||
# Set the minimum (global) log level for Yell. If you prefer a different setup | |||
# you may comine various log levels, like: | |||
# # this will only log between :info and :fatal level | |||
# :level: 'gte.info lte.fatal' | |||
:level: 'gte.info' | |||
|
|||
# Keep a max of 7 files for every adapter per default. You can leave this option | |||
# if you wish to keep all files, otherwise, Yell will cleanup any :datefile | |||
# after a rollover of 7 times. | |||
:keep: 7 | |||
|
|||
# define multiple adapters: one for notice and one for error messages | |||
:adapters: | :adapters: | ||
# this adapter writes all messages with a log level of warn or lower | - :stdout: | ||
# and writes to production.log (because this is your Rails.env) | |||
- :datefile: | |||
:level: 'lte.warn' | |||
|
|||
# this adapter writes all messages with a log level of error or higher | |||
# and writes to error.log | |||
- :datefile: | |||
:level: 'gte.error' | |||
:filename: 'log/error.log' | |||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,27 +1,36 @@ | |||
require 'spec_helper' | require 'spec_helper' | ||
|
|
||
# Yell Rails applicatio class | |||
module Yell | |||
class Application < Rails::Application | |||
end | |||
end | |||
|
|||
describe Yell::Railtie do | describe Yell::Railtie do | ||
let( :file ) { File.join(fixture_path, 'yell.yml') } | let( :app ) { FakeApp.new } | ||
|
let( :railtie ) { Yell::Railtie.send :new } | ||
before do | |||
mock( Rails.root ).join('config', 'yell.yml') { config_file } | |||
|
|||
Yell::Application.initialize! | |||
end | |||
|
|
||
it "should have the right railtie name" do | it "should have the right railtie name" do | ||
Yell::Railtie.railtie_name.should == 'yell-rails' | Yell::Railtie.railtie_name.should == 'yell-rails' | ||
end | end | ||
|
|
||
# it "should set the rails logger for the Yell::Repository" do | context :initialized do | ||
# Rails.logger.should == Yell['rails'] | let( :app ) do | ||
# end | OpenStruct.new( | ||
:config => OpenStruct.new( :paths => {'log' => [path]} ) | |||
) | |||
end | |||
|
|||
let( :path ) { 'path/to/config' } | |||
let( :file ) { mock } | |||
|
|||
before do | |||
mock( ::File ).exist?( File.dirname(path) ) { true } # do not create log directory | |||
|
|||
mock( Rails.root ).join('config', 'yell.yml') { file } # mock config file | |||
mock( file ).file? { false } # do not load the config file | |||
|
|||
railtie.run_initializers(:all, app ) | |||
end | |||
|
|||
it "should add :rails to the Yell::Repository" do | |||
Yell['rails'].should be_kind_of Yell::Logger | |||
end | |||
end | |||
|
|
||
end | end | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters