foreman-tasks 10.0.0 → 10.0.1

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
  SHA256:
3
- metadata.gz: 12c497c315d4ddc13756f00588584ebbb26fd0320231cc2e6a2b5e1e285ad1c6
4
- data.tar.gz: 404c59c211805039713e0d61411a649d21f318ad9f5e4a1f7872f2d2633dd3c4
3
+ metadata.gz: 4a7506ccab551c52f9408df7fcfca78e6a565753bc35ca7263bd2265a5aa95bf
4
+ data.tar.gz: 2a6a714e7cfc082139d7fd73f1f7c2547817e4e9ace0b02c681bad6b8f63043b
5
5
  SHA512:
6
- metadata.gz: 831bfb836cedcf996170dcb23db17edc1fb9c3606130cb0f1c8c946de3164e7a9059ef61e6bbf5fdde4fb3febe1cc6cd5e07c668f891dfda51926b89b5da6f3e
7
- data.tar.gz: e63d4cb1e9f172ff81bae074a6bba0abbb96b1c67369506e6e8a134f42fc161c46236d505ba4503ef8e9805a7ecf9015bb963b98c7bf78a5f88b4777c1345471
6
+ metadata.gz: 3c1f0897789b528c739a77a21b39b2471f841759472c2755228b288e698485c11aee37224106c96725cd858d98c970fbe71948adceeb1553b83931a75e817676
7
+ data.tar.gz: fe5eb0b8a95b15ada47a46b4839c79e5b45d43042a28ca13fd1ad318a1dbeb7afe0257138eea96b3006613baf4fe0ec7d51c98854347b1a5f908cea6eefabf77
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ locale/*/*.po.time_stamp
16
16
  node_modules
17
17
  package-lock.json
18
18
  coverage/
19
+ locale/action_names.rb
@@ -252,7 +252,7 @@ module ForemanTasks
252
252
 
253
253
  def prepare_filter
254
254
  filter_parts = [filter]
255
- filter_parts << %(started_at < "#{after.ago.to_s(:db)}") if after > 0
255
+ filter_parts << %(started_at < "#{after.ago.to_formatted_s(:db)}") if after > 0
256
256
  filter_parts << "state ^ (#{states.join(',')})" if states.any?
257
257
  filter_parts.select(&:present?).map { |segment| "(#{segment})" }.join(' AND ')
258
258
  end
@@ -310,15 +310,15 @@ namespace :foreman_tasks do
310
310
  SKIP_ERRORS = ['true', '1', 'y', 'yes'].include? (ENV['SKIP_FAILED'] || '').downcase
311
311
 
312
312
  filter = if ENV['TASK_SEARCH'].nil? && ENV['TASK_DAYS'].nil?
313
- "started_at > \"#{7.days.ago.to_s(:db)}\" || " \
314
- "(result != success && started_at > \"#{60.days.ago.to_s(:db)})\""
313
+ "started_at > \"#{7.days.ago.to_formatted_s(:db)}\" || " \
314
+ "(result != success && started_at > \"#{60.days.ago.to_formatted_s(:db)})\""
315
315
  else
316
316
  ENV['TASK_SEARCH'] || ''
317
317
  end
318
318
 
319
319
  if (days = ENV['TASK_DAYS'])
320
320
  filter += ' && ' unless filter == ''
321
- filter += "started_at > \"#{days.to_i.days.ago.to_s(:db)}\""
321
+ filter += "started_at > \"#{days.to_i.days.ago.to_formatted_s(:db)}\""
322
322
  end
323
323
 
324
324
  format = ENV['TASK_FORMAT'] || 'html'
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '10.0.0'.freeze
2
+ VERSION = '10.0.1'.freeze
3
3
  end
@@ -8,21 +8,27 @@ if gettext_find_task
8
8
  namespace :gettext do
9
9
  task :store_action_names => :environment do
10
10
  storage_file = "#{locale_path}/action_names.rb"
11
- klasses = Actions::EntryAction
12
- .subclasses
13
- .uniq
14
- .select do |action|
15
- src, = Object.const_source_location(action.to_s)
16
- src.start_with? @engine.root.to_s
11
+ method_names = [:plan, :run, :finalize]
12
+ instances = Actions::EntryAction
13
+ .descendants
14
+ .uniq
15
+ .map(&:allocate)
16
+ .select do |action|
17
+ method_names.any? do |method_name|
18
+ if action.respond_to?(method_name)
19
+ src, = action.method(method_name).source_location
20
+ src.start_with? @engine.root.to_s
21
+ end
22
+ end
17
23
  end
18
24
 
19
- if klasses.any?
25
+ if instances.any?
20
26
  puts "writing action translations to: #{storage_file}"
21
27
 
22
28
  File.write storage_file,
23
29
  "# Autogenerated!\n" +
24
- klasses
25
- .map { |klass| %[_("#{klass.allocate.humanized_name}")] }
30
+ instances
31
+ .map { |instance| %[_("#{instance.humanized_name}")] }
26
32
  .sort
27
33
  .join("\n") + "\n"
28
34
  elsif File.exist? storage_file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0
4
+ version: 10.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-10 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -318,7 +318,6 @@ files:
318
318
  - lib/foreman_tasks/version.rb
319
319
  - lib/tasks/gettext.rake
320
320
  - locale/Makefile
321
- - locale/action_names.rb
322
321
  - locale/de/LC_MESSAGES/foreman_tasks.mo
323
322
  - locale/de/foreman_tasks.po
324
323
  - locale/en/LC_MESSAGES/foreman_tasks.mo
@@ -1,6 +0,0 @@
1
- # Autogenerated!
2
- _("Action with sub plans")
3
- _("Check for long running tasks")
4
- _("Deliver notifications about long running tasks")
5
- _("Import Puppet classes")
6
- _("Import facts")