lambda_whenever 0.1.1 → 0.2.0

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
  SHA256:
3
- metadata.gz: 67a5c5474ef6496852336282c2a377f9f6c0063d0ab366c0af32ccaf2913c379
4
- data.tar.gz: f823d4e7f110f729553ea01187c712d6adb0b3a85b1edbb97218fd95b64f1cd6
3
+ metadata.gz: ed20460e8d292c55e32a2e25c7aac08a780fbd6fd95d2cf9f12373a1b70104b3
4
+ data.tar.gz: cf27f30637d128eb9d557e1444d9d33f6660d427c8f0b098383ceca2e925794d
5
5
  SHA512:
6
- metadata.gz: 14ecdce83d2156801ddd4af596ba084dbd5a1741b97f74c39bd64d541df34573a070c56fd18dc628678069551c0f8d0befeea4721ec3110fee3cb4c23d370212
7
- data.tar.gz: 1239df92546e75453eb7ead19baf439515451e80ae538a11f9b926648bc74b146af06d70f75afc2ed1f520bfa57ea76a3bfb53a603a1267afb548ae3a2cf9c1d
6
+ metadata.gz: ffffdef9d3446074e7337ed3cad49dabdd8687d42106bf55ceccc6ccafa704aced77d16385b08e9bf04f913ddb87686351d6c255975a8fc9ff2998d8611648e3
7
+ data.tar.gz: 69a28cc18e85b668d1b25492cabf8a9286cc87c9e1c0ee85bf9974267bf0d6436625b8f3f9e939d9dd02dbb1f5b3ed1ef379ec6302989b91a8f8869e68cf470e
@@ -49,7 +49,8 @@ module LambdaWhenever
49
49
  end
50
50
 
51
51
  def schedule_name(task, option)
52
- Digest::SHA1.hexdigest([option.key, task.expression, *task.commands].join("-")).to_s[0, 64]
52
+ input = "#{task.name}-#{Digest::SHA1.hexdigest([option.key, task.expression, *task.commands].join("-"))}"
53
+ sanitize_and_trim(input)
53
54
  end
54
55
 
55
56
  def schedule_description(task)
@@ -67,5 +68,13 @@ module LambdaWhenever
67
68
  rescue Aws::Scheduler::Errors::ResourceNotFoundException
68
69
  puts "Schedule group '#{schedule_group}' does not exist."
69
70
  end
71
+
72
+ private
73
+
74
+ def sanitize_and_trim(input)
75
+ sanitized = input.gsub(/[^a-zA-Z0-9\-._]/, "_")
76
+
77
+ sanitized[0, 64]
78
+ end
70
79
  end
71
80
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module LambdaWhenever
4
4
  class Task
5
- attr_reader :commands, :expression
5
+ attr_reader :commands, :expression, :name
6
6
 
7
7
  def initialize(environment, verbose, bundle_command, expression)
8
8
  @environment = environment
@@ -10,6 +10,7 @@ module LambdaWhenever
10
10
  @bundle_command = bundle_command.split(" ")
11
11
  @expression = expression
12
12
  @commands = []
13
+ @name = ""
13
14
  end
14
15
 
15
16
  def command(task)
@@ -17,14 +18,17 @@ module LambdaWhenever
17
18
  end
18
19
 
19
20
  def rake(task)
21
+ @name = task
20
22
  @commands << [@bundle_command, "rake", task, @verbose_mode].flatten.compact
21
23
  end
22
24
 
23
25
  def runner(src)
26
+ @name = src
24
27
  @commands << [@bundle_command, "rails", "runner", "-e", @environment, src].flatten
25
28
  end
26
29
 
27
30
  def script(script)
31
+ @name = script
28
32
  @commands << [@bundle_command, "script/#{script}"].flatten
29
33
  end
30
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LambdaWhenever
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lambda_whenever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - toshichanapp
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
11
+ date: 2024-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -209,7 +209,7 @@ licenses: []
209
209
  metadata:
210
210
  homepage_uri: https://github.com/toshichanapp/lambda_whenever
211
211
  source_code_uri: https://github.com/toshichanapp/lambda_whenever
212
- post_install_message:
212
+ post_install_message:
213
213
  rdoc_options: []
214
214
  require_paths:
215
215
  - lib
@@ -224,8 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.5.11
228
- signing_key:
227
+ rubygems_version: 3.5.16
228
+ signing_key:
229
229
  specification_version: 4
230
230
  summary: whenever for Amazon EventBridge Scheduler.
231
231
  test_files: []