syslogify 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,8 +20,17 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- As soon as the gem is loaded, output will be diverted. If you wish to delay
24
- diversion, change your Gemfile to:
23
+ As soon as the gem is loaded, output will be diverted if:
24
+
25
+ - `STDOUT` is an interactive terminal; or
26
+ - the environment is `development` or `test`; and
27
+ - the environment varible `FORCE_SYSLOG` is unset.
28
+
29
+ The current environment is determined by looking at, by order of decreasing
30
+ precedence, the `AR_ENV` environment variable, `Rails.env` if available, and the
31
+ `RACK_ENV` environment variable. It defaults to `development`.
32
+
33
+ If you wish to delay diversion, change your Gemfile to:
25
34
 
26
35
  ```ruby
27
36
  gem 'syslogify', require: false
@@ -37,7 +46,6 @@ Syslogify::Forker.instance.start
37
46
  Syslogify::Forker.instance.stop
38
47
  ```
39
48
 
40
-
41
49
  ## Contributing
42
50
 
43
51
  1. Fork it ( https://github.com/mezis/syslogify/fork )
@@ -1,3 +1,3 @@
1
1
  module Syslogify
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/syslogify.rb CHANGED
@@ -1,3 +1,12 @@
1
1
  require 'syslogify/forker'
2
2
 
3
- Syslogify::Forker.instance.start
3
+ begin
4
+ environment = ENV['AR_ENV'] || (defined?(Rails) && Rails.env) || ENV['RACK_ENV'] || 'development'
5
+ if (STDOUT.tty? || environment =~ /development|test/) && !ENV['FORCE_SYSLOG']
6
+ $stderr.puts "syslogify not auto-starting (#{environment})"
7
+ else
8
+ $stderr.puts "syslogify auto-starting (#{environment})"
9
+ Syslogify::Forker.instance.start
10
+ end
11
+ end
12
+
metadata CHANGED
@@ -1,41 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syslogify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Julien Letessier
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
12
+ date: 2015-02-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.7'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.7'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '10.0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '10.0'
41
46
  description: Sends stdout and stderr to syslog..
@@ -45,7 +50,7 @@ executables: []
45
50
  extensions: []
46
51
  extra_rdoc_files: []
47
52
  files:
48
- - ".gitignore"
53
+ - .gitignore
49
54
  - Gemfile
50
55
  - LICENSE.txt
51
56
  - README.md
@@ -57,25 +62,32 @@ files:
57
62
  homepage: https://github.com/mezis/syslogify
58
63
  licenses:
59
64
  - MIT
60
- metadata: {}
61
65
  post_install_message:
62
66
  rdoc_options: []
63
67
  require_paths:
64
68
  - lib
65
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
+ none: false
66
71
  requirements:
67
- - - ">="
72
+ - - ! '>='
68
73
  - !ruby/object:Gem::Version
69
74
  version: '0'
75
+ segments:
76
+ - 0
77
+ hash: 2877256063521893788
70
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
71
80
  requirements:
72
- - - ">="
81
+ - - ! '>='
73
82
  - !ruby/object:Gem::Version
74
83
  version: '0'
84
+ segments:
85
+ - 0
86
+ hash: 2877256063521893788
75
87
  requirements: []
76
88
  rubyforge_project:
77
- rubygems_version: 2.2.2
89
+ rubygems_version: 1.8.23.2
78
90
  signing_key:
79
- specification_version: 4
91
+ specification_version: 3
80
92
  summary: Sends stdout and stderr to syslog.
81
93
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 7ff824b514a7b5f41ea8d6cae842dbb316d47d0a
4
- data.tar.gz: fe71fcb5d549727cd8671d117612fe00469d13a6
5
- SHA512:
6
- metadata.gz: 761199098e7713764ec677c0e83f304c5b7a5a0d05eca888822c54f30459c0c8db962040cbb53b2dea72a294907da72693c52bdb4222de3d62e6759dc1e7a6fd
7
- data.tar.gz: 18b68acc82d09618ea770c653c3510fe8dad89a78ba9c25a555643c4d38333eb0c57ce330ebd4ba8eb0be8666200e2590171e0f4daca6ab00c7fe3372f1864aa