cronjobs 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +37 -0
- data/lib/cronjobs/dsl/actions.rb +24 -0
- data/lib/cronjobs/proxy.rb +25 -0
- data/lib/cronjobs/railtie.rb +9 -0
- data/lib/cronjobs/version.rb +3 -0
- data/lib/cronjobs.rb +83 -0
- data/lib/generators/cronjobs/install_generator.rb +15 -0
- data/lib/generators/cronjobs/templates/definitions.rb +5 -0
- data/lib/tasks/cronjobs.rake +5 -0
- data/test/cronjobs_test.rb +25 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config/application.rb +27 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cronjobs.rb +12 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +38 -0
- data/test/dummy/config/environments/production.rb +76 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/log/development.log +35 -0
- data/test/dummy/log/test.log +1628 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/generator_test.rb +19 -0
- data/test/tasks_test.rb +26 -0
- data/test/test_helper.rb +13 -0
- metadata +166 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rails/generators'
|
3
|
+
require 'generators/cronjobs/install_generator'
|
4
|
+
|
5
|
+
class GeneratorsTest < Rails::Generators::TestCase
|
6
|
+
|
7
|
+
tests Cronjobs::Generators::InstallGenerator
|
8
|
+
destination Rails.root.join('tmp')
|
9
|
+
|
10
|
+
teardown do
|
11
|
+
FileUtils.rm_rf destination_root
|
12
|
+
end
|
13
|
+
|
14
|
+
test 'file generation' do
|
15
|
+
run_generator
|
16
|
+
assert_file 'config/cronjobs.rb'
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/test/tasks_test.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TasksTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
load File.expand_path('../../lib/tasks/cronjobs.rake', __FILE__)
|
7
|
+
Rake::Task.define_task :environment
|
8
|
+
end
|
9
|
+
|
10
|
+
teardown do
|
11
|
+
FileUtils.rm_rf Rails.root.join('tmp')
|
12
|
+
end
|
13
|
+
|
14
|
+
test 'check' do
|
15
|
+
Cronjobs.expects(:write).once
|
16
|
+
Rake::Task['cronjobs:check'].invoke
|
17
|
+
|
18
|
+
digest = Digest::MD5.file(Rails.root.join('config/cronjobs.rb'))
|
19
|
+
digest_path = Rails.root.join('tmp/digests/cronjobs')
|
20
|
+
FileUtils.mkdir_p digest_path.dirname
|
21
|
+
File.write digest_path, digest
|
22
|
+
Cronjobs.expects(:write).never
|
23
|
+
Rake::Task['cronjobs:check'].invoke
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
|
+
require 'rails/test_help'
|
6
|
+
require 'mocha/mini_test'
|
7
|
+
|
8
|
+
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
9
|
+
# to be shown.
|
10
|
+
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
11
|
+
|
12
|
+
# Load support files
|
13
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cronjobs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- mmontossi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.3.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 4.0.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 4.3.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: mocha
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.1'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.1'
|
47
|
+
description: DSL to manage cronjobs in rails.
|
48
|
+
email:
|
49
|
+
- mmontossi@buyin.io
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- MIT-LICENSE
|
55
|
+
- Rakefile
|
56
|
+
- lib/cronjobs.rb
|
57
|
+
- lib/cronjobs/dsl/actions.rb
|
58
|
+
- lib/cronjobs/proxy.rb
|
59
|
+
- lib/cronjobs/railtie.rb
|
60
|
+
- lib/cronjobs/version.rb
|
61
|
+
- lib/generators/cronjobs/install_generator.rb
|
62
|
+
- lib/generators/cronjobs/templates/definitions.rb
|
63
|
+
- lib/tasks/cronjobs.rake
|
64
|
+
- test/cronjobs_test.rb
|
65
|
+
- test/dummy/Rakefile
|
66
|
+
- test/dummy/app/assets/javascripts/application.js
|
67
|
+
- test/dummy/app/assets/stylesheets/application.css
|
68
|
+
- test/dummy/app/controllers/application_controller.rb
|
69
|
+
- test/dummy/app/helpers/application_helper.rb
|
70
|
+
- test/dummy/app/views/layouts/application.html.erb
|
71
|
+
- test/dummy/bin/bundle
|
72
|
+
- test/dummy/bin/rails
|
73
|
+
- test/dummy/bin/rake
|
74
|
+
- test/dummy/bin/setup
|
75
|
+
- test/dummy/config.ru
|
76
|
+
- test/dummy/config/application.rb
|
77
|
+
- test/dummy/config/boot.rb
|
78
|
+
- test/dummy/config/cronjobs.rb
|
79
|
+
- test/dummy/config/environment.rb
|
80
|
+
- test/dummy/config/environments/development.rb
|
81
|
+
- test/dummy/config/environments/production.rb
|
82
|
+
- test/dummy/config/environments/test.rb
|
83
|
+
- test/dummy/config/initializers/assets.rb
|
84
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
85
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
86
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
87
|
+
- test/dummy/config/initializers/inflections.rb
|
88
|
+
- test/dummy/config/initializers/mime_types.rb
|
89
|
+
- test/dummy/config/initializers/session_store.rb
|
90
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
91
|
+
- test/dummy/config/locales/en.yml
|
92
|
+
- test/dummy/config/routes.rb
|
93
|
+
- test/dummy/config/secrets.yml
|
94
|
+
- test/dummy/log/development.log
|
95
|
+
- test/dummy/log/test.log
|
96
|
+
- test/dummy/public/404.html
|
97
|
+
- test/dummy/public/422.html
|
98
|
+
- test/dummy/public/500.html
|
99
|
+
- test/dummy/public/favicon.ico
|
100
|
+
- test/generator_test.rb
|
101
|
+
- test/tasks_test.rb
|
102
|
+
- test/test_helper.rb
|
103
|
+
homepage: https://github.com/mmontossi/cronjobs
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata: {}
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 2.1.0
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 2.5.1
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Cronjobs for rails.
|
127
|
+
test_files:
|
128
|
+
- test/cronjobs_test.rb
|
129
|
+
- test/dummy/app/assets/javascripts/application.js
|
130
|
+
- test/dummy/app/assets/stylesheets/application.css
|
131
|
+
- test/dummy/app/controllers/application_controller.rb
|
132
|
+
- test/dummy/app/helpers/application_helper.rb
|
133
|
+
- test/dummy/app/views/layouts/application.html.erb
|
134
|
+
- test/dummy/bin/bundle
|
135
|
+
- test/dummy/bin/rails
|
136
|
+
- test/dummy/bin/rake
|
137
|
+
- test/dummy/bin/setup
|
138
|
+
- test/dummy/config/application.rb
|
139
|
+
- test/dummy/config/boot.rb
|
140
|
+
- test/dummy/config/cronjobs.rb
|
141
|
+
- test/dummy/config/environment.rb
|
142
|
+
- test/dummy/config/environments/development.rb
|
143
|
+
- test/dummy/config/environments/production.rb
|
144
|
+
- test/dummy/config/environments/test.rb
|
145
|
+
- test/dummy/config/initializers/assets.rb
|
146
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
147
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
148
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
149
|
+
- test/dummy/config/initializers/inflections.rb
|
150
|
+
- test/dummy/config/initializers/mime_types.rb
|
151
|
+
- test/dummy/config/initializers/session_store.rb
|
152
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
153
|
+
- test/dummy/config/locales/en.yml
|
154
|
+
- test/dummy/config/routes.rb
|
155
|
+
- test/dummy/config/secrets.yml
|
156
|
+
- test/dummy/config.ru
|
157
|
+
- test/dummy/log/development.log
|
158
|
+
- test/dummy/log/test.log
|
159
|
+
- test/dummy/public/404.html
|
160
|
+
- test/dummy/public/422.html
|
161
|
+
- test/dummy/public/500.html
|
162
|
+
- test/dummy/public/favicon.ico
|
163
|
+
- test/dummy/Rakefile
|
164
|
+
- test/generator_test.rb
|
165
|
+
- test/tasks_test.rb
|
166
|
+
- test/test_helper.rb
|