yell-rails 0.10.0.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +17 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +18 -0
- data/lib/generators/yell/install/templates/config/yell.yml +25 -8
- data/lib/yell/{rails.rb → railtie.rb} +8 -5
- data/lib/yell-rails.rb +5 -0
- data/spec/fixtures/yell.yml +4 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/yell/railtie_spec.rb +36 -0
- data/yell-rails.gemspec +10 -8
- metadata +24 -13
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2011-2012 Rudolf Schmidt
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
**Yell for Rails**
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/rudionrails/yell-rails.png?branch=master)](http://travis-ci.org/rudionrails/yell-rails)
|
4
|
+
|
5
|
+
If you are not yet familiar with **Yell - Your Extensible Logging Library**
|
6
|
+
check out the githup project under https://github.com/rudionrails/yell or jump
|
7
|
+
directly into the Yell wiki at https://github.com/rudionrails/yell/wiki.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
System wide:
|
12
|
+
|
13
|
+
```console
|
14
|
+
gem install yell-rails
|
15
|
+
```
|
16
|
+
|
17
|
+
In your Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem "yell-rails"
|
21
|
+
```
|
22
|
+
|
23
|
+
## Configuration
|
24
|
+
|
25
|
+
Once yell-rails is added to your Gemfile, you can run the generator:
|
26
|
+
|
27
|
+
```console
|
28
|
+
rails generate yell:install
|
29
|
+
```
|
30
|
+
|
31
|
+
## Compatibility
|
32
|
+
|
33
|
+
This gem is written for Rails 3.x. Lower versions are not supported.
|
34
|
+
Pull requests for backwards compatibility are welcome if there is a need.
|
35
|
+
|
36
|
+
## Usage
|
37
|
+
|
38
|
+
This gem replaces your standard Rails logger with Yell. Please refer to the
|
39
|
+
[Yell Wiki](https://github.com/rudionrails/yell/wiki) on how to use and
|
40
|
+
configure this gem.
|
41
|
+
|
42
|
+
|
43
|
+
Copyright © 2011-2012 Rudolf Schmidt, released under the MIT license
|
44
|
+
|
data/Rakefile
CHANGED
@@ -1 +1,19 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
# RSpec
|
4
|
+
begin
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
|
7
|
+
desc "Run specs"
|
8
|
+
RSpec::Core::RakeTask.new do |t|
|
9
|
+
t.rspec_opts = %w(--color --format progress --order random)
|
10
|
+
# t.ruby_opts = %w(-w)
|
11
|
+
end
|
12
|
+
rescue LoadError
|
13
|
+
task :spec do
|
14
|
+
abort "`gem install rspec` in order to run tests"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => :spec
|
19
|
+
|
@@ -1,21 +1,38 @@
|
|
1
|
-
# The following is an example config file for yell.
|
1
|
+
# The following is an example config file for yell with all possible options available.
|
2
|
+
#
|
3
|
+
# To learn about the possible configuration options via a YAML file, read the wiki
|
4
|
+
# on github: https://github.com/rudionrails/yell/wiki/101-configuration-with-yaml
|
2
5
|
|
3
|
-
development:
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
development: &development
|
7
|
+
# Enable colorized log output with the following. It is handy for development
|
8
|
+
# or testing, but should not be turned on for staging or production. Otherwise
|
9
|
+
# you will see those annoying ANSI color codes when on the remote production
|
10
|
+
# machine.
|
11
|
+
:colors: true
|
7
12
|
|
13
|
+
# we use the same settings for test that we defined for development
|
14
|
+
test: *development
|
15
|
+
|
16
|
+
# In production, you should configure yell somewhat more specific. The following
|
17
|
+
# is an example config - change it at your own will.
|
8
18
|
production:
|
9
|
-
#
|
19
|
+
# Set the minimum (global) log level for Yell. If you prefer a different setup
|
20
|
+
# you may comine various log levels, like:
|
21
|
+
# # this will only log between :info and :fatal level
|
22
|
+
# :level: 'gte.info lte.fatal'
|
10
23
|
:level: 'gte.info'
|
11
24
|
|
25
|
+
# Keep a max of 7 files for every adapter per default. You can remove this option
|
26
|
+
# if you wish to keep all files, otherwise, Yell will cleanup any :datefile
|
27
|
+
# after a rollover of 7 times.
|
28
|
+
:keep: 7
|
29
|
+
|
12
30
|
# define multiple adapters: one for notice and one for error messages
|
13
31
|
:adapters:
|
14
32
|
# this adapter writes all messages with a log level of warn or lower
|
15
|
-
# and writes to production.log
|
33
|
+
# and writes to production.log (because this is your Rails.env)
|
16
34
|
- :datefile:
|
17
35
|
:level: 'lte.warn'
|
18
|
-
:filename: 'log/production.log'
|
19
36
|
|
20
37
|
# this adapter writes all messages with a log level of error or higher
|
21
38
|
# and writes to error.log
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'rails'
|
4
|
-
require 'yell'
|
5
|
-
|
6
3
|
module Yell #:nodoc:
|
7
4
|
class Railtie < ::Rails::Railtie
|
5
|
+
railtie_name 'yell-rails'
|
8
6
|
|
9
7
|
initializer 'yell.logger', :group => :all, :before => :initialize_logger do |app|
|
10
8
|
# behave like the standard rails logger and create the log dir
|
@@ -15,9 +13,14 @@ module Yell #:nodoc:
|
|
15
13
|
FileUtils.mkdir_p path
|
16
14
|
end
|
17
15
|
|
18
|
-
#
|
16
|
+
# fetch yell config
|
19
17
|
config_file = Rails.root.join( 'config', 'yell.yml' )
|
20
|
-
|
18
|
+
|
19
|
+
# add to repository
|
20
|
+
Yell['rails'] = config_file.file? ? Yell.load!(config_file) : Yell.new
|
21
|
+
|
22
|
+
# add logger
|
23
|
+
app.config.logger = Yell['rails']
|
21
24
|
end
|
22
25
|
|
23
26
|
# Warn if yell.yml is not present.
|
data/lib/yell-rails.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
|
4
|
+
require 'rails'
|
5
|
+
require 'yell-rails'
|
6
|
+
|
7
|
+
require 'rspec'
|
8
|
+
require 'rr'
|
9
|
+
|
10
|
+
require 'ostruct'
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.mock_framework = :rr
|
14
|
+
|
15
|
+
config.after do
|
16
|
+
Dir[ fixture_path + "/*.log" ].each { |f| File.delete f }
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def fixture_path
|
22
|
+
File.expand_path( "fixtures", File.dirname(__FILE__) )
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Yell::Railtie do
|
4
|
+
let( :app ) { FakeApp.new }
|
5
|
+
let( :railtie ) { Yell::Railtie.send :new }
|
6
|
+
|
7
|
+
it "should have the right railtie name" do
|
8
|
+
Yell::Railtie.railtie_name.should == 'yell-rails'
|
9
|
+
end
|
10
|
+
|
11
|
+
context :initialized do
|
12
|
+
let( :app ) do
|
13
|
+
OpenStruct.new(
|
14
|
+
:config => OpenStruct.new( :paths => {'log' => [path]} )
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
let( :path ) { 'path/to/config' }
|
19
|
+
let( :file ) { mock }
|
20
|
+
|
21
|
+
before do
|
22
|
+
mock( ::File ).exist?( File.dirname(path) ) { true } # do not create log directory
|
23
|
+
|
24
|
+
mock( Rails.root ).join('config', 'yell.yml') { file } # mock config file
|
25
|
+
mock( file ).file? { false } # do not load the config file
|
26
|
+
|
27
|
+
railtie.run_initializers(:all, app )
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should add :rails to the Yell::Repository" do
|
31
|
+
Yell['rails'].should be_kind_of Yell::Logger
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
data/yell-rails.gemspec
CHANGED
@@ -3,20 +3,22 @@ $:.unshift File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "yell-rails"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.13.2"
|
7
7
|
s.authors = ["Rudolf Schmidt"]
|
8
8
|
|
9
9
|
s.homepage = "http://rudionrails.github.com/yell"
|
10
|
-
s.summary = %q{
|
11
|
-
s.description = %q{Yell
|
10
|
+
s.summary = %q{Yell - Your Extensible Logging Library for Rails}
|
11
|
+
s.description = %q{Yell - Your Extensible Logging Library. Define multiple adapters, various log level combinations or message formatting options like you've never done before}
|
12
12
|
|
13
13
|
s.rubyforge_project = "yell"
|
14
14
|
|
15
|
-
s.files = `git ls-files`.split(
|
16
|
-
s.
|
17
|
-
s.
|
15
|
+
s.files = `git ls-files`.split($\)
|
16
|
+
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
18
|
+
|
18
19
|
s.require_paths = ["lib"]
|
19
20
|
|
20
|
-
s.add_runtime_dependency "
|
21
|
-
s.add_runtime_dependency "
|
21
|
+
s.add_runtime_dependency "yell", ">= 0.13.2"
|
22
|
+
s.add_runtime_dependency "rails", ">= 3.0.0"
|
22
23
|
end
|
24
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yell-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,16 +9,16 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: yell
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.13.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,15 +26,15 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 0.13.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: rails
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 3.0.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,19 +42,27 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
46
|
-
description: Yell
|
45
|
+
version: 3.0.0
|
46
|
+
description: Yell - Your Extensible Logging Library. Define multiple adapters, various
|
47
|
+
log level combinations or message formatting options like you've never done before
|
47
48
|
email:
|
48
49
|
executables: []
|
49
50
|
extensions: []
|
50
51
|
extra_rdoc_files: []
|
51
52
|
files:
|
52
53
|
- .gitignore
|
54
|
+
- .travis.yml
|
53
55
|
- Gemfile
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
54
58
|
- Rakefile
|
55
59
|
- lib/generators/yell/install/install_generator.rb
|
56
60
|
- lib/generators/yell/install/templates/config/yell.yml
|
57
|
-
- lib/yell
|
61
|
+
- lib/yell-rails.rb
|
62
|
+
- lib/yell/railtie.rb
|
63
|
+
- spec/fixtures/yell.yml
|
64
|
+
- spec/spec_helper.rb
|
65
|
+
- spec/yell/railtie_spec.rb
|
58
66
|
- yell-rails.gemspec
|
59
67
|
homepage: http://rudionrails.github.com/yell
|
60
68
|
licenses: []
|
@@ -76,8 +84,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
84
|
version: '0'
|
77
85
|
requirements: []
|
78
86
|
rubyforge_project: yell
|
79
|
-
rubygems_version: 1.8.
|
87
|
+
rubygems_version: 1.8.24
|
80
88
|
signing_key:
|
81
89
|
specification_version: 3
|
82
|
-
summary:
|
83
|
-
test_files:
|
90
|
+
summary: Yell - Your Extensible Logging Library for Rails
|
91
|
+
test_files:
|
92
|
+
- spec/fixtures/yell.yml
|
93
|
+
- spec/spec_helper.rb
|
94
|
+
- spec/yell/railtie_spec.rb
|