parameter_substitution 0.3.0.pre.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/parameter_substitution.rb +1 -2
- data/lib/parameter_substitution/context.rb +1 -1
- data/lib/parameter_substitution/formatters/date_time_custom.rb +2 -5
- data/lib/parameter_substitution/formatters/parse_time.rb +1 -1
- data/lib/parameter_substitution/substitution_expression.rb +1 -1
- data/lib/parameter_substitution/version.rb +1 -1
- metadata +62 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9d6031634a3751b62d9d584b15849f2ca5129af7d167be16d507bf2872ec3f86
|
4
|
+
data.tar.gz: b9a1ce433449018cbd38baf05df52a6dadd521d788cf0ad4aabed2c7ba79f7a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05edabbb29a83d31801c0b5945da813a3ebd8b2814b3ef4661b0444c290818baaaadd4ac477fb0c2b39a1d108be6955135b4cc527a404212e71e7cb576388f8e
|
7
|
+
data.tar.gz: a509ef29f6bcfc7811ea0ede3e7298b54af4750b27995272dc1b0aed0cbc211a572cf2c8c8703212f851a524bad6d51ecb2a4b942e6a7153a2e8985e334bd22f
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# See lib/parameter_substitution/readme.md
|
4
4
|
|
5
|
+
require 'active_support/all'
|
5
6
|
require "parameter_substitution/context"
|
6
7
|
require "parameter_substitution/parse_error"
|
7
8
|
require "parameter_substitution/parser"
|
@@ -18,8 +19,6 @@ Dir[File.dirname(__FILE__) + '/parameter_substitution/formatters/*.rb'].each do
|
|
18
19
|
require file
|
19
20
|
end
|
20
21
|
|
21
|
-
require 'active_support/all'
|
22
|
-
|
23
22
|
class ParameterSubstitution
|
24
23
|
class SubstitutionError < StandardError; end
|
25
24
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'hobo_support'
|
2
|
+
require "parameter_substitution/formatters/date_time_format"
|
4
3
|
|
5
4
|
class ParameterSubstitution::Formatters::DateTimeCustom < ParameterSubstitution::Formatters::DateTimeFormat
|
6
5
|
def self.has_parameters?
|
@@ -18,8 +17,6 @@ class ParameterSubstitution::Formatters::DateTimeCustom < ParameterSubstitution:
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def format(value)
|
21
|
-
self.class.parse_to_time(value, @parse_options).
|
22
|
-
.in_time_zone(@to_time_zone)._?
|
23
|
-
.strftime(@to_formatting).to_s
|
20
|
+
self.class.parse_to_time(value, @parse_options)&.in_time_zone(@to_time_zone)&.strftime(@to_formatting).to_s # rubocop:disable Lint/SafeNavigationChain
|
24
21
|
end
|
25
22
|
end
|
@@ -17,7 +17,7 @@ class ParameterSubstitution::Formatters::ParseTime < ParameterSubstitution::Form
|
|
17
17
|
value && Time.strptime(value.to_s, @format_string).strftime('%Y-%m-%d %H:%M:%S')
|
18
18
|
rescue ArgumentError => ex
|
19
19
|
# strptime raises argument error if either argument is wrong.
|
20
|
-
ex.message =~ /invalid strptime format/ or raise
|
20
|
+
ex.message =~ /invalid .*strptime format/ or raise
|
21
21
|
value
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,15 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parameter_substitution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca Development
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
12
|
-
dependencies:
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: builder
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: invoca-utils
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.3'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: parslet
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
13
69
|
description: The substitution can be formatted using a syntax that looks like method
|
14
70
|
calls
|
15
71
|
email:
|
@@ -88,12 +144,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
144
|
version: '0'
|
89
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
146
|
requirements:
|
91
|
-
- - "
|
147
|
+
- - ">="
|
92
148
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
149
|
+
version: '0'
|
94
150
|
requirements: []
|
95
|
-
|
96
|
-
rubygems_version: 2.6.13
|
151
|
+
rubygems_version: 3.0.3
|
97
152
|
signing_key:
|
98
153
|
specification_version: 4
|
99
154
|
summary: Handles parsing an input strings with embedded substitution parameters and
|