logging-rails-kiriyenko 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +81 -0
- data/lib/logging/rails.rb +0 -18
- data/lib/logging/rails/generators/install_generator.rb +1 -1
- data/version.txt +1 -1
- metadata +6 -7
data/.rvmrc
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
+
# development environment upon cd'ing into the directory
|
5
|
+
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
|
7
|
+
environment_id="ruby-1.8.7-p357@logging_rails"
|
8
|
+
|
9
|
+
#
|
10
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
11
|
+
#
|
12
|
+
# rvmrc_rvm_version="1.10.2" # 1.10.1 seams as a safe start
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
+
# return 1
|
16
|
+
# }
|
17
|
+
#
|
18
|
+
|
19
|
+
#
|
20
|
+
# Uncomment following line if you want options to be set only for given project.
|
21
|
+
#
|
22
|
+
# PROJECT_JRUBY_OPTS=( --1.9 )
|
23
|
+
#
|
24
|
+
# The variable PROJECT_JRUBY_OPTS requires the following to be run in shell:
|
25
|
+
#
|
26
|
+
# chmod +x ${rvm_path}/hooks/after_use_jruby_opts
|
27
|
+
#
|
28
|
+
|
29
|
+
#
|
30
|
+
# First we attempt to load the desired environment directly from the environment
|
31
|
+
# file. This is very fast and efficient compared to running through the entire
|
32
|
+
# CLI and selector. If you want feedback on which environment was used then
|
33
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
34
|
+
#
|
35
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
36
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
37
|
+
then
|
38
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
39
|
+
|
40
|
+
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
|
41
|
+
then
|
42
|
+
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
|
43
|
+
fi
|
44
|
+
else
|
45
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
46
|
+
if ! rvm --create "$environment_id"
|
47
|
+
then
|
48
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
49
|
+
return 1
|
50
|
+
fi
|
51
|
+
fi
|
52
|
+
|
53
|
+
#
|
54
|
+
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
|
55
|
+
# it be automatically loaded. Uncomment the following and adjust the filename if
|
56
|
+
# necessary.
|
57
|
+
#
|
58
|
+
# filename=".gems"
|
59
|
+
# if [[ -s "$filename" ]]
|
60
|
+
# then
|
61
|
+
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
|
62
|
+
# fi
|
63
|
+
|
64
|
+
# If you use bundler, this might be useful to you:
|
65
|
+
# if [[ -s Gemfile ]] && ! command -v bundle >/dev/null
|
66
|
+
# then
|
67
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
68
|
+
# gem install bundler
|
69
|
+
# fi
|
70
|
+
# if [[ -s Gemfile ]] && command -v bundle
|
71
|
+
# then
|
72
|
+
# bundle install
|
73
|
+
# fi
|
74
|
+
|
75
|
+
if [[ $- == *i* ]] # check for interactive shells
|
76
|
+
then
|
77
|
+
echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
|
78
|
+
else
|
79
|
+
echo "Using: $GEM_HOME" # don't use colors in interactive shells
|
80
|
+
fi
|
81
|
+
|
data/lib/logging/rails.rb
CHANGED
@@ -70,21 +70,3 @@ module Logging::Rails
|
|
70
70
|
}
|
71
71
|
|
72
72
|
end # Logging::Rails
|
73
|
-
|
74
|
-
|
75
|
-
# Here we need to remove the Rails LogTailer from the list of middlewares. The
|
76
|
-
# Logging framework is fully capable of sending log events to multiple logging
|
77
|
-
# destinations.
|
78
|
-
#
|
79
|
-
module Rails
|
80
|
-
class Server < ::Rack::Server
|
81
|
-
def middleware_without_log_tailer
|
82
|
-
middlewares = middleware_with_log_tailer['anything']
|
83
|
-
middlewares.delete_if { |middleware| Rails::Rack::LogTailer == middleware.first }
|
84
|
-
Hash.new(middlewares)
|
85
|
-
end
|
86
|
-
alias :middleware_with_log_tailer :middleware
|
87
|
-
alias :middleware :middleware_without_log_tailer
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
@@ -11,7 +11,7 @@ module Logging::Rails
|
|
11
11
|
|
12
12
|
def insert_log_to_destinations
|
13
13
|
comment = "\n # Set the logging destination(s)\n %s\n"
|
14
|
-
insert_into_file 'config/environments/development.rb', comment % 'config.log_to = %w[
|
14
|
+
insert_into_file 'config/environments/development.rb', comment % 'config.log_to = %w[file]', :before => %r/^end\s*$/
|
15
15
|
insert_into_file 'config/environments/production.rb', comment % 'config.log_to = %w[file]', :before => %r/^end\s*$/
|
16
16
|
end
|
17
17
|
end
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logging-rails-kiriyenko
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tim Pease, Dmitriy Kiriyenko
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
19
|
-
default_executable:
|
18
|
+
date: 2012-02-17 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: logging
|
@@ -63,6 +62,7 @@ extra_rdoc_files:
|
|
63
62
|
- lib/logging/rails/generators/USAGE
|
64
63
|
- lib/logging/rails/generators/templates/logging.rb.erb
|
65
64
|
files:
|
65
|
+
- .rvmrc
|
66
66
|
- History.txt
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
@@ -74,7 +74,6 @@ files:
|
|
74
74
|
- lib/logging/rails/mixin.rb
|
75
75
|
- lib/logging/rails/railtie.rb
|
76
76
|
- version.txt
|
77
|
-
has_rdoc: true
|
78
77
|
homepage: http://rubygems.org/gems/logging-rails-kiriyenko
|
79
78
|
licenses: []
|
80
79
|
|
@@ -105,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
104
|
requirements: []
|
106
105
|
|
107
106
|
rubyforge_project: logging-rails-kiriyenko
|
108
|
-
rubygems_version: 1.
|
107
|
+
rubygems_version: 1.8.15
|
109
108
|
signing_key:
|
110
109
|
specification_version: 3
|
111
110
|
summary: A Railtie for for integrating the [Logging](https://github.
|