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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 124f1cea84a337eac85f40e96819b2e39d49036d
4
- data.tar.gz: fafd9cedaca3aa36cb0daa6647c6fbad0fe378a2
2
+ SHA256:
3
+ metadata.gz: 9d6031634a3751b62d9d584b15849f2ca5129af7d167be16d507bf2872ec3f86
4
+ data.tar.gz: b9a1ce433449018cbd38baf05df52a6dadd521d788cf0ad4aabed2c7ba79f7a1
5
5
  SHA512:
6
- metadata.gz: 874a1e19b434bcab0e6e910c8f39cd46e5b5e47be959752cc741255afcd8c6767c92b9055643cdfe0ab6aab47318a257ae9a1378addb82fd2879fc20a08a600a
7
- data.tar.gz: f7691be5bd986cb43a5128db4c6a5ec1e0efcc3ffc034a60127cbd86bcbf85da58d24d91c67919ba90d02b1253f784f990f3a481f5a572194d747183376ade86
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,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'hobo_support/enumerable'
3
+ require 'invoca/utils/enumerable'
4
4
 
5
5
  class ParameterSubstitution
6
6
  class Context
@@ -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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'hobo_support/array'
3
+ require 'invoca/utils/array'
4
4
 
5
5
  class ParameterSubstitution
6
6
  class SubstitutionExpression
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ParameterSubstitution
4
- VERSION = "0.3.0.pre.4"
4
+ VERSION = "1.0.0"
5
5
  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.3.0.pre.4
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-04-28 00:00:00.000000000 Z
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: 1.3.1
149
+ version: '0'
94
150
  requirements: []
95
- rubyforge_project:
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