nifty_settings 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nifty_settings/settings.rb +0 -33
- data/lib/nifty_settings/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afe17f45b901676afd6eda08c0523130f180af55
|
4
|
+
data.tar.gz: 394d6c9f4fcd34dd355d748e63bc6475ffb68d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 610084ce9b84259a353e11b449d1c41e1233c24d02f30258864d43320abbb1a7df9453ecca6eddd31748f8ddad785f626c578ffd6767dfa8e4bd144e19d991cb
|
7
|
+
data.tar.gz: 6c5f996ce61be1a6c843bdcdda9b3afd588bfedc807cf98c30bda1a027aa190dcc1193c49883df6259850ef3adea02623ae94790b478923cce5251796044a02b
|
@@ -87,7 +87,6 @@ module NiftySettings
|
|
87
87
|
def reset!
|
88
88
|
@@default = nil
|
89
89
|
default # Force us to reload the settings
|
90
|
-
NiftySettings::Settings.setup_mailer! if defined?(ActionMailer)
|
91
90
|
# If a setup block is defined, call it post configuration.
|
92
91
|
@setup_callback.call if defined?(@setup_callback) && @setup_callback
|
93
92
|
true
|
@@ -108,38 +107,6 @@ module NiftySettings
|
|
108
107
|
def env
|
109
108
|
@env ||= defined?(Rails) ? Rails.env : ENV['RACK_ENV']
|
110
109
|
end
|
111
|
-
|
112
|
-
def ssl?
|
113
|
-
!disable_ssl? && (force_ssl? || env == 'production')
|
114
|
-
end
|
115
|
-
|
116
|
-
def ssl_protocol
|
117
|
-
ssl? ? "https" : "http"
|
118
|
-
end
|
119
|
-
|
120
|
-
# Sets up ActionMailer to use settings from Settings.
|
121
|
-
def setup_mailer!
|
122
|
-
return unless mailer?
|
123
|
-
s = mailer
|
124
|
-
ActionMailer::Base.default_url_options[:host] = s.host
|
125
|
-
ActionMailer::Base.delivery_method = s.delivery_method.to_sym
|
126
|
-
ActionMailer::Base.smtp_settings = s.smtp_settings.to_hash if s.smtp_settings?
|
127
|
-
ActionMailer::Base.sendmail_settings = s.sendmail_settings.to_hash if s.sendmail_settings?
|
128
|
-
ActionMailer::Base.default :from => s.from
|
129
|
-
|
130
|
-
# Setup sendgrid if present, sort of a faux-sendgrid helper.
|
131
|
-
if s.delivery_method.to_sym == :sendgrid
|
132
|
-
ActionMailer::Base.delivery_method = :smtp
|
133
|
-
ActionMailer::Base.smtp_settings = {
|
134
|
-
:address => "smtp.sendgrid.net",
|
135
|
-
:port => "25",
|
136
|
-
:authentication => :plain,
|
137
|
-
:user_name => s.sendgrid.username,
|
138
|
-
:password => s.sendgrid.password,
|
139
|
-
:domain => s.sendgrid.domain
|
140
|
-
}
|
141
|
-
end
|
142
|
-
end
|
143
110
|
end
|
144
111
|
|
145
112
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nifty_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Meurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Settings
|
14
14
|
email: manuel.meurer@gmail.com
|