yell-rails 0.5.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/lib/generators/yell/install/install_generator.rb +12 -0
- data/lib/generators/yell/install/templates/config/yell.yml +15 -0
- data/lib/yell/rails.rb +37 -0
- data/yell-rails.gemspec +3 -5
- metadata +31 -10
- data/lib/yell-rails.rb +0 -25
- data/lib/yell/rails/version.rb +0 -6
data/Gemfile
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
development:
|
2
|
+
adapters:
|
3
|
+
- :file:
|
4
|
+
:filename: 'log/development.log'
|
5
|
+
|
6
|
+
producton:
|
7
|
+
:level: 'gte.info'
|
8
|
+
:adapters:
|
9
|
+
- :datefile:
|
10
|
+
:level: 'lte.warn'
|
11
|
+
:filename: 'log/production.log'
|
12
|
+
- :datefile:
|
13
|
+
:level: 'gte.error'
|
14
|
+
:filename: 'log/error.log'
|
15
|
+
|
data/lib/yell/rails.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Yell #:nodoc:
|
4
|
+
class Railtie < ::Rails::Railtie
|
5
|
+
|
6
|
+
initializer 'yell.logger', :group => :all, :before => :initialize_logger do |app|
|
7
|
+
# behave like the standard rails logger and create the log dir
|
8
|
+
filename = app.config.paths["log"].first
|
9
|
+
path = File.dirname(filename)
|
10
|
+
|
11
|
+
unless File.exist? path
|
12
|
+
FileUtils.mkdir_p path
|
13
|
+
end
|
14
|
+
|
15
|
+
# init Yell
|
16
|
+
config_file = Rails.root.join( 'config', 'yell.yml' )
|
17
|
+
app.config.logger = config_file.file? ? Yell.load!(config_file) : Yell.new
|
18
|
+
end
|
19
|
+
|
20
|
+
# Warn if yell.yml is not present.
|
21
|
+
initializer "yell.warnings" do |app|
|
22
|
+
app.config.after_initialize do
|
23
|
+
unless Rails.root.join( "config", "yell.yml" ).file?
|
24
|
+
puts <<-EOS
|
25
|
+
|
26
|
+
** Yell config not found - initialized with default options **
|
27
|
+
Create a config file at 'config/yell.yml' or generate one:
|
28
|
+
rails generate yell:install
|
29
|
+
|
30
|
+
EOS
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
data/yell-rails.gemspec
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.unshift File.expand_path("../lib", __FILE__)
|
3
|
-
require "yell/rails/version"
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
5
|
s.name = "yell-rails"
|
7
|
-
s.version =
|
6
|
+
s.version = "0.10.0"
|
8
7
|
s.authors = ["Rudolf Schmidt"]
|
9
8
|
|
10
9
|
s.homepage = "http://rudionrails.github.com/yell"
|
@@ -18,7 +17,6 @@ Gem::Specification.new do |s|
|
|
18
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
18
|
s.require_paths = ["lib"]
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
s.add_runtime_dependency "yell", "~> 0.5"
|
20
|
+
s.add_runtime_dependency "rails", ">= 3"
|
21
|
+
s.add_runtime_dependency "yell", ">= 0.10"
|
24
22
|
end
|
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.10.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,19 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3'
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: yell
|
16
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
17
33
|
none: false
|
18
34
|
requirements:
|
19
|
-
- -
|
35
|
+
- - ! '>='
|
20
36
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
37
|
+
version: '0.10'
|
22
38
|
type: :runtime
|
23
39
|
prerelease: false
|
24
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0.10'
|
25
46
|
description: Yell for Rails
|
26
47
|
email:
|
27
48
|
executables: []
|
@@ -31,8 +52,9 @@ files:
|
|
31
52
|
- .gitignore
|
32
53
|
- Gemfile
|
33
54
|
- Rakefile
|
34
|
-
- lib/yell
|
35
|
-
- lib/yell/
|
55
|
+
- lib/generators/yell/install/install_generator.rb
|
56
|
+
- lib/generators/yell/install/templates/config/yell.yml
|
57
|
+
- lib/yell/rails.rb
|
36
58
|
- yell-rails.gemspec
|
37
59
|
homepage: http://rudionrails.github.com/yell
|
38
60
|
licenses: []
|
@@ -54,9 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
76
|
version: '0'
|
55
77
|
requirements: []
|
56
78
|
rubyforge_project: yell
|
57
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.23
|
58
80
|
signing_key:
|
59
81
|
specification_version: 3
|
60
82
|
summary: yell-rails
|
61
83
|
test_files: []
|
62
|
-
has_rdoc:
|
data/lib/yell-rails.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'yell'
|
2
|
-
|
3
|
-
module Yell
|
4
|
-
module Rails
|
5
|
-
|
6
|
-
class Railtie < ::Rails::Railtie
|
7
|
-
|
8
|
-
initializer 'yell.logger', :grop => :all, :before => :initialize_logger do |app|
|
9
|
-
# behave like the standard rails logger and create the log dir
|
10
|
-
path = app.config.paths["log"].first
|
11
|
-
unless File.exist? File.dirname path
|
12
|
-
FileUtils.mkdir_p File.dirname path
|
13
|
-
end
|
14
|
-
|
15
|
-
# init Yell
|
16
|
-
app.config.logger = Yell.new( path,
|
17
|
-
:colorize => app.config.colorize_logging,
|
18
|
-
:level => app.config.log_level
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|