tasks_scheduler 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d55cf267a17b9745518a4c84e1cfc2aef077840
4
- data.tar.gz: c76a8903f97bff753eec0794c1d51d2305501843
3
+ metadata.gz: 455e3bc8143c47e770a49410d5db8f896eab85fb
4
+ data.tar.gz: 3334d0012b0c26ac6f8c6a3a59a2f1f393d5e92d
5
5
  SHA512:
6
- metadata.gz: 915274287591f4c7fc5dc286c18e9c9b085d3b15b33d8d9fe3f1571a02028a4f31d6ce3e406de66c2eb79b5cf7a49b90d34ad83e3f59d45a9c049e7e6faae638
7
- data.tar.gz: d3495bd1fbe9de29057e14f7f2aae07ddfc116f9e292ff752c60b51235131671f51c361bfd43bb4d840516c3d89826bd1672710593604ff3db6e1fbf170cbb14
6
+ metadata.gz: a9943a9c7ff126b77d906ac2b9ef996c89c51d4494886612b3936c73afb543136e5c280a4a92d60ef5349fa54225c8754947d67ade966553c9d97d1b4d2072c2
7
+ data.tar.gz: 96198cd7b08d9e67b801ac05b3594c8d038246d7adbac2ff9c8ac208f6b2f63e19f33ed50c39a2a0c3c9bfeb0a3646af5a76bc4bec92a3e54009abd65883eb25
@@ -4,7 +4,7 @@ function TasksScheduler() {
4
4
  }
5
5
 
6
6
  TasksScheduler.Status = function () {
7
- }
7
+ };
8
8
 
9
9
  // Shortcut
10
10
  var _S = TasksScheduler.Status;
@@ -67,7 +67,8 @@ _A.DEFAULT_REFRESH_INTERVAL = 60000;
67
67
  _A.DEFAULT_ELEMENT_SELECTOR = '#tasks_scheduler_alert';
68
68
  _A.url = null;
69
69
 
70
- _A.init = function (url, options = {}) {
70
+ _A.init = function (url, options) {
71
+ options = typeof options !== 'undefined' ? options : {};
71
72
  $(document).ready(function () {
72
73
  _A.url = url;
73
74
  _A.options = options;
@@ -27,6 +27,7 @@ class ScheduledTask < ActiveRecord::Base
27
27
  run_log("Task: #{self}")
28
28
  run_log("PID: #{pid ? pid : '-'} (Current: #{Process.pid})")
29
29
  run_log("Process running? #{process_running? ? 'Yes' : 'No'}")
30
+ run_log("Rails.env: #{Rails.env}")
30
31
  end
31
32
 
32
33
  def invoke_task
@@ -17,10 +17,12 @@ module TasksScheduler
17
17
  def execute(action)
18
18
  raise "Action not allowed: #{action} (Allowed: #{ACTIONS})" unless ACTIONS.include?(action)
19
19
  command = ['bundle', 'exec', 'tasks_scheduler', action]
20
+ env_args = { 'RAILS_ENV' => Rails.env }
20
21
  Dir.chdir(Rails.root) do
21
- Open3.popen3(*command) do |_stdin, stdout, stderr, wait_thr|
22
- { action: action, command: command.join(' '), status: wait_thr.value.to_i,
23
- stdout: stdout.read, stderr: stderr.read }
22
+ Open3.popen3(env_args, *command) do |_stdin, stdout, stderr, wait_thr|
23
+ { action: action, env_args: env_args.map { |k, v| "#{k}=#{v}" }.join(' | '),
24
+ command: command.join(' '), status: wait_thr.value.to_i, stdout: stdout.read,
25
+ stderr: stderr.read }
24
26
  end
25
27
  end
26
28
  end
@@ -1,3 +1,3 @@
1
1
  module TasksScheduler
2
- VERSION = '0.0.5'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tasks_scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-08 00:00:00.000000000 Z
11
+ date: 2017-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold
@@ -184,46 +184,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.4.8
187
+ rubygems_version: 2.6.12
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Scheduler for Rake tasks.
191
191
  test_files:
192
- - test/fixtures/scheduled_tasks.yml
193
- - test/models/scheduled_task_test.rb
194
- - test/dummy/config.ru
195
- - test/dummy/README.rdoc
196
- - test/dummy/db/schema.rb
197
- - test/dummy/app/views/layouts/application.html.erb
198
- - test/dummy/app/assets/stylesheets/application.css
199
- - test/dummy/app/assets/javascripts/application.js
200
- - test/dummy/app/helpers/application_helper.rb
201
- - test/dummy/app/controllers/application_controller.rb
202
- - test/dummy/bin/bundle
203
- - test/dummy/bin/rails
204
- - test/dummy/bin/setup
205
- - test/dummy/bin/rake
206
192
  - test/dummy/Rakefile
207
- - test/dummy/config/environments/production.rb
208
- - test/dummy/config/environments/test.rb
209
- - test/dummy/config/environments/development.rb
210
- - test/dummy/config/application.rb
193
+ - test/dummy/README.rdoc
194
+ - test/dummy/config.ru
211
195
  - test/dummy/config/boot.rb
196
+ - test/dummy/config/database.yml
197
+ - test/dummy/config/secrets.yml
212
198
  - test/dummy/config/locales/en.yml
199
+ - test/dummy/config/application.rb
200
+ - test/dummy/config/environments/development.rb
201
+ - test/dummy/config/environments/test.rb
202
+ - test/dummy/config/environments/production.rb
203
+ - test/dummy/config/environment.rb
204
+ - test/dummy/config/routes.rb
205
+ - test/dummy/config/initializers/assets.rb
206
+ - test/dummy/config/initializers/cookies_serializer.rb
207
+ - test/dummy/config/initializers/inflections.rb
213
208
  - test/dummy/config/initializers/session_store.rb
214
- - test/dummy/config/initializers/filter_parameter_logging.rb
215
209
  - test/dummy/config/initializers/wrap_parameters.rb
210
+ - test/dummy/config/initializers/filter_parameter_logging.rb
216
211
  - test/dummy/config/initializers/backtrace_silencers.rb
217
- - test/dummy/config/initializers/inflections.rb
218
- - test/dummy/config/initializers/assets.rb
219
- - test/dummy/config/initializers/cookies_serializer.rb
220
212
  - test/dummy/config/initializers/mime_types.rb
221
- - test/dummy/config/secrets.yml
222
- - test/dummy/config/database.yml
223
- - test/dummy/config/routes.rb
224
- - test/dummy/config/environment.rb
213
+ - test/dummy/db/schema.rb
214
+ - test/dummy/app/views/layouts/application.html.erb
215
+ - test/dummy/app/controllers/application_controller.rb
216
+ - test/dummy/app/helpers/application_helper.rb
217
+ - test/dummy/app/assets/stylesheets/application.css
218
+ - test/dummy/app/assets/javascripts/application.js
225
219
  - test/dummy/public/422.html
226
- - test/dummy/public/favicon.ico
227
220
  - test/dummy/public/404.html
221
+ - test/dummy/public/favicon.ico
228
222
  - test/dummy/public/500.html
223
+ - test/dummy/bin/bundle
224
+ - test/dummy/bin/setup
225
+ - test/dummy/bin/rails
226
+ - test/dummy/bin/rake
229
227
  - test/test_helper.rb
228
+ - test/fixtures/scheduled_tasks.yml
229
+ - test/models/scheduled_task_test.rb