proselytism 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -10
- data/lib/proselytism/engine.rb +1 -1
- data/lib/proselytism/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -30,33 +30,33 @@ And then execute:
|
|
30
30
|
|
31
31
|
$ bundle
|
32
32
|
|
33
|
-
|
33
|
+
##Configuration
|
34
34
|
|
35
35
|
- With a YAML config file:
|
36
36
|
|
37
|
-
```
|
38
|
-
|
39
|
-
```
|
37
|
+
```
|
38
|
+
rails g proselytism:config
|
39
|
+
```
|
40
40
|
|
41
|
-
As
|
41
|
+
As a Rails engine, Proselytism automatically load /config/proselytism.yml (if the file exists) and set its config params depending on the current rails env.
|
42
42
|
|
43
43
|
- With an initializer (optional for Rails App) :
|
44
44
|
|
45
45
|
You can override the configuration file params by adding a custom initializer to /config/initializers .
|
46
46
|
By default Proselytism will log in a separate log file, if you want to use the rails logger
|
47
47
|
|
48
|
-
```ruby
|
48
|
+
```ruby
|
49
49
|
#/config/initializers/proselytism.rb
|
50
50
|
Proselytism.config do |config|
|
51
51
|
config.logger = Rails.logger
|
52
52
|
end
|
53
|
-
```
|
53
|
+
```
|
54
54
|
|
55
55
|
To generate a full config initializer:
|
56
56
|
|
57
|
-
```
|
58
|
-
|
59
|
-
```
|
57
|
+
```
|
58
|
+
rails g proselytism:initializer
|
59
|
+
```
|
60
60
|
|
61
61
|
## Usage
|
62
62
|
|
data/lib/proselytism/engine.rb
CHANGED
@@ -18,7 +18,7 @@ module Proselytism
|
|
18
18
|
ActiveSupport.on_load :after_initialize do |app|
|
19
19
|
Proselytism.config.log_level ||= Rails.logger.level
|
20
20
|
Proselytism.config.log_path ||= File.join(Rails.root, 'log', "proselytism.log")
|
21
|
-
Proselytism.config.logger ||= Proselytism::
|
21
|
+
Proselytism.config.logger ||= Proselytism::Logger.new Proselytism.config.log_path, Proselytism.config.log_level
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
data/lib/proselytism/version.rb
CHANGED
metadata
CHANGED