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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a455f62a6c8c381489ce651317a63ad22adabdd
4
- data.tar.gz: 7863b27de025b16213493683a6fa93d366a355e0
3
+ metadata.gz: d49b2b97a5bd054d1fa807215f55b91a3668f70c
4
+ data.tar.gz: d2ef3e8d934db029bf900087a771e9e5ca7b11e6
5
5
  SHA512:
6
- metadata.gz: 4cd5e64580768d46e724cd5c5ca12b5c94657d156e4d4f80d43e86c78981d5dd11da554be2925ccf4e08bf05040628e889be7b054d8ca5ff448a15875b6fd02f
7
- data.tar.gz: e5ceec0e09d75630f1b393501f1a3ab1696ebd8f02c5182fcdf3a2c70898983b0b149f9990e5d89434babee53a75c10caf7ae8f11692a245f2d3dc611d174a5c
6
+ metadata.gz: 504cd9240a6ec0550b92f3dd011916aa05f3001038d78d1c9d765811bfc9783bfa437af0742ba362a044db25a2a176bc6bbd5ec81a7fec44cd44c8549ff7d1cf
7
+ data.tar.gz: 20b2e5e4c64cde884398c6ccbcb777d1144da84399890c1a589313b695b4dbed52fc98b01a1ffa0871352ed22a3a1393c20b700f3b9bafa80e9abd2e992bae6e
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 2.0
3
+ - 2.1
4
+ - 2.2
5
+
6
+ sudo: false
7
+ cache: bundler
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # Dekiru
1
+ # できる!Rails
2
+
3
+ [![Build Status](https://travis-ci.org/mataki/dekiru.svg?branch=master)](https://travis-ci.org/mataki/dekiru)
2
4
 
3
5
  Usefull Helper methods for Ruby on Rails
4
6
 
@@ -9,5 +9,10 @@ module Dekiru
9
9
  ::ActionController::Base.send :include, Dekiru::ControllerAdditions
10
10
  end
11
11
  end
12
+
13
+ rake_tasks do
14
+ load "dekiru/tasks/smtp_check.rake"
15
+ load "dekiru/tasks/delayed_job_queue_check.rake"
16
+ end
12
17
  end
13
18
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Dekiru
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'rspec'
3
3
 
4
4
  # For rails app
5
+ require 'rails'
5
6
  require "active_support"
6
7
  require 'active_support/core_ext/object'
7
8
  require "active_record"
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.14
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: 2014-12-10 00:00:00.000000000 Z
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.2.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: