dekiru 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/README.md +3 -1
- data/lib/dekiru/railtie.rb +5 -0
- data/lib/dekiru/smtp_check_mailer.rb +20 -0
- data/lib/dekiru/tasks/delayed_job_queue_check.rake +12 -0
- data/lib/dekiru/tasks/smtp_check.rake +10 -0
- data/lib/dekiru/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d49b2b97a5bd054d1fa807215f55b91a3668f70c
|
4
|
+
data.tar.gz: d2ef3e8d934db029bf900087a771e9e5ca7b11e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 504cd9240a6ec0550b92f3dd011916aa05f3001038d78d1c9d765811bfc9783bfa437af0742ba362a044db25a2a176bc6bbd5ec81a7fec44cd44c8549ff7d1cf
|
7
|
+
data.tar.gz: 20b2e5e4c64cde884398c6ccbcb777d1144da84399890c1a589313b695b4dbed52fc98b01a1ffa0871352ed22a3a1393c20b700f3b9bafa80e9abd2e992bae6e
|
data/.travis.yml
ADDED
data/README.md
CHANGED
data/lib/dekiru/railtie.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Dekiru
|
2
|
+
class SmtpCheckMailer < ActionMailer::Base
|
3
|
+
default from: 'smtp-checker@sonicgarden.jp'
|
4
|
+
|
5
|
+
def checkmail
|
6
|
+
app_key = ENV['SMTP_CHECKER_APP_KEY'] || Rails.application.class.parent_name.downcase
|
7
|
+
smtp_checker_to_addr = ENV['SMTP_CHECKER_TO_ADDR'] || 'smtp-alive@sg-ops-mail.sonicgarden.jp'
|
8
|
+
|
9
|
+
Rails.logger.error "ENV['SMTP_CHECKER_APP_KEY'] undefined!" if app_key.blank?
|
10
|
+
Rails.logger.error "ENV['SMTP_CHECKER_TO_ADDR'] undefined!" if smtp_checker_to_addr.blank?
|
11
|
+
|
12
|
+
Rails.logger.info "checkmail send start #{smtp_checker_to_addr} key:#{app_key}"
|
13
|
+
subject = "[SMTP Checker] SMTP Check Mail"
|
14
|
+
mail to: smtp_checker_to_addr, subject: subject do |format|
|
15
|
+
format.text { render text: app_key }
|
16
|
+
end
|
17
|
+
Rails.logger.info "send to #{smtp_checker_to_addr} key:#{app_key}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
namespace :dekiru do
|
2
|
+
desc 'Ops check for Delayed::Job queue'
|
3
|
+
task delayed_job_queue_check: :environment do
|
4
|
+
Rails.logger.info "[INFO] Start dekiru:delayed_job_queue_check env:#{Rails.env}"
|
5
|
+
if defined?(Delayed::Job)
|
6
|
+
if (count = Delayed::Job.where { run_at < 30.seconds.since }.count) > 0
|
7
|
+
raise("There are #{count} jobs that are not running for Delayed::Job. Check job list!")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Rails.logger.info "[INFO] End dekiru:delayed_job_queue_check env:#{Rails.env}"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "dekiru/smtp_check_mailer"
|
2
|
+
|
3
|
+
namespace :dekiru do
|
4
|
+
desc 'Ops check for smpt alival'
|
5
|
+
task smtp_check: :environment do
|
6
|
+
Rails.logger.info "[INFO] Start task dekiru:smtp_check env:#{Rails.env}"
|
7
|
+
Dekiru::SmtpCheckMailer.checkmail.deliver
|
8
|
+
Rails.logger.info "[INFO] End task dekiru:smtp_check env:#{Rails.env}"
|
9
|
+
end
|
10
|
+
end
|
data/lib/dekiru/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dekiru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akihiro Matsumura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http_accept_language
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
77
78
|
- Gemfile
|
78
79
|
- LICENSE
|
79
80
|
- README.md
|
@@ -83,6 +84,9 @@ files:
|
|
83
84
|
- lib/dekiru/controller_additions.rb
|
84
85
|
- lib/dekiru/helper.rb
|
85
86
|
- lib/dekiru/railtie.rb
|
87
|
+
- lib/dekiru/smtp_check_mailer.rb
|
88
|
+
- lib/dekiru/tasks/delayed_job_queue_check.rake
|
89
|
+
- lib/dekiru/tasks/smtp_check.rake
|
86
90
|
- lib/dekiru/version.rb
|
87
91
|
- spec/dekiru/helper_spec.rb
|
88
92
|
- spec/spec_helper.rb
|
@@ -105,10 +109,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
109
|
version: '0'
|
106
110
|
requirements: []
|
107
111
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.4.5
|
109
113
|
signing_key:
|
110
114
|
specification_version: 4
|
111
115
|
summary: Usefull helper methods for Ruby on Rails
|
112
116
|
test_files:
|
113
117
|
- spec/dekiru/helper_spec.rb
|
114
118
|
- spec/spec_helper.rb
|
119
|
+
has_rdoc:
|