active_stripper 1.0.1 → 1.1.1

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: 6719c1c08b655ed43c83b55308d0cdf0c5e5754b
4
- data.tar.gz: bbdac1ae5d5488114bb1fc4c1149299ca36b18ca
2
+ SHA256:
3
+ metadata.gz: 1c65dfabbd8c136849897da6a628529f9fc8d2f6be8ba4bb6a75e67a753d785b
4
+ data.tar.gz: 11be0f0e7394a9d080a03dd69fb88c627c2e54bd97509d1b43e4474852a9b314
5
5
  SHA512:
6
- metadata.gz: 38391e0c46cd63bb9f48bd254d16ec8be91a3541fef29eaf0dde3b5c4d3c0621a5804e38a539f00dba9eabb5cc10b1812a01cda61fdd7d4a5babe572543eaacc
7
- data.tar.gz: 4cd30121b4e776d71aac39d2e0573a68d2ede266174d297cc0488b400726004e86f93ac0de25b89d46b634202dbd0d9e3964891589d48fa5d5b09ee2233e40e8
6
+ metadata.gz: e8f2c5391d468382262395339d038bf126537b9fb68c17fe9edf2b16199c9f8f0ac16dde6fdcfccbe2632efa2f0d1af0e250f1b74d4dbf17091384e4b6137773
7
+ data.tar.gz: dbe7012f869522548f823bf069677181e91e8add5659ed8f61ccd94fbdc754e154dc18cc993c28811ea7f47dfa7cdf99182301261a595f4ef3626681228b8c9b
@@ -66,6 +66,32 @@ module ActiveStripper
66
66
  return val.downcase
67
67
  end
68
68
 
69
+ #
70
+ # Execute String#tr on `val`, find `pattern` and replace with `replacements`
71
+ #
72
+ # @param [String] val String to clean up
73
+ # @param [String] pattern First parameters to method String#tr
74
+ # @param [String] replacements Second parameters to method String#tr
75
+ #
76
+ # @return [String] Cleaned up string
77
+ #
78
+ def replace_stripper(val, pattern, replacements)
79
+ return val.tr(pattern, replacements)
80
+ end
81
+
82
+ #
83
+ # Execute String#gsub on `val`, find `pattern` and replace with `replacement`
84
+ #
85
+ # @param [String] val String to clean up
86
+ # @param [String] pattern First parameters to method String#gsub
87
+ # @param [String] replacement Second parameters to method String#gsub
88
+ #
89
+ # @return [String] Cleaned up string
90
+ #
91
+ def substitute_stripper(val, pattern, replacement)
92
+ return val.gsub(pattern, replacement)
93
+ end
94
+
69
95
  #
70
96
  # Set value to nil if val is an empty string
71
97
  #
@@ -1,5 +1,5 @@
1
1
  #coding: utf-8
2
2
 
3
3
  module ActiveStripper
4
- VERSION = "1.0.1"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_stripper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - François TCHENG
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-13 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  description: |2-
@@ -71,13 +71,13 @@ homepage: https://github.com/nekogami/active_stripper
71
71
  licenses:
72
72
  - MIT
73
73
  metadata: {}
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
78
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -86,10 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubyforge_project:
90
- rubygems_version: 2.4.5.1
91
- signing_key:
89
+ rubygems_version: 3.5.16
90
+ signing_key:
92
91
  specification_version: 4
93
92
  summary: Strip or preprocess Active Record / Object attributes with prepended setter
94
93
  test_files: []
95
- has_rdoc: