powerpack 0.1.2 → 0.1.3
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 +5 -5
- data/.travis.yml +2 -0
- data/CHANGELOG.md +7 -3
- data/README.md +49 -41
- data/lib/powerpack/string/ascii_only.rb +1 -1
- data/lib/powerpack/string/format.rb +1 -1
- data/lib/powerpack/version.rb +1 -1
- data/powerpack.gemspec +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 466f04d01b789b666492e731d3e25590843994afdcb881537a38937d084d0d45
|
4
|
+
data.tar.gz: c926128481ab9eb8fde51b9e4d40346a3f2ea3f1b273e9d92b7de12cab730478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21383a2e29ce45233f4dadf33ce04452f27b9ed71770995a9796af9d142b251ba3aaab2749a8df921d60283630513dd77c929dcdb81ac1865f7435c941d9bf86
|
7
|
+
data.tar.gz: 6542479c6e1f8bb875aa4b1adf8e8cf18c7a7b76b1c5bd0e83659508a343f8baf0e337238141c24d8ad421ab05d4bc9048f4c4f3ae8b658de539a14329ef4cd6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,16 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.1.3 (2020-11-16)
|
6
|
+
|
7
|
+
* [#42](https://github.com/bbatsov/powerpack/pull/42): Fix a warning on Ruby 2.7.
|
8
|
+
|
5
9
|
## 0.1.2 (2018-06-10)
|
6
10
|
|
7
11
|
* Changed `String#remove_prefix` to return the original string if the parameter is not a prefix.
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
* Changed `String#remove_prefix!`to return the original string if the parameter is not a prefix.
|
13
|
+
* Changed `String#remove_suffix` to return the original string if the parameter is not a suffix.
|
14
|
+
* Changed `String#remove_suffix!` to return the original string if the parameter is not a suffix.
|
11
15
|
|
12
16
|
## 0.1.1 (2015-05-04)
|
13
17
|
|
data/README.md
CHANGED
@@ -3,7 +3,15 @@
|
|
3
3
|
|
4
4
|
# Powerpack
|
5
5
|
|
6
|
-
Powerpack offers some useful extensions to the standard Ruby classes
|
6
|
+
Powerpack offers some useful extensions to the standard Ruby classes
|
7
|
+
(kind of like `ActiveSupport`, but less ambitious and more modular).
|
8
|
+
|
9
|
+
The project has several design goals:
|
10
|
+
|
11
|
+
* **minimalistic** - we don't add every possible extensions, we focus only
|
12
|
+
on the stuff that are commonly requested and would be often useful in practice
|
13
|
+
* **modular** - all extensions can be loaded individually (often they are just individual methods)
|
14
|
+
* **safe** - you can't end up accidentally overriding some existing method definition with Powerpack's extensions
|
7
15
|
|
8
16
|
## Installation
|
9
17
|
|
@@ -21,50 +29,50 @@ Or install it yourself as:
|
|
21
29
|
|
22
30
|
## Extensions
|
23
31
|
|
24
|
-
* [Array](http://rdoc.info/
|
25
|
-
* [#butfirst](http://rdoc.info/
|
26
|
-
* [#butlast](http://rdoc.info/
|
27
|
-
* [Enumerable](http://rdoc.info/
|
28
|
-
* [#average](http://rdoc.info/
|
29
|
-
* [#drop_last](http://rdoc.info/
|
30
|
-
* [#drop_last_while](http://rdoc.info/
|
31
|
-
* [#exactly?](http://rdoc.info/
|
32
|
-
* [#frequencies](http://rdoc.info/
|
33
|
-
* [#several?](http://rdoc.info/
|
34
|
-
* [#sum](http://rdoc.info/
|
35
|
-
* [#take_last](http://rdoc.info/
|
36
|
-
* [#take_last_while](http://rdoc.info/
|
37
|
-
* [Hash](http://rdoc.info/
|
38
|
-
* [#symbolize_keys](http://rdoc.info/
|
39
|
-
* [Numeric](http://rdoc.info/
|
40
|
-
* [#pos?](http://rdoc.info/
|
41
|
-
* [#neg?](http://rdoc.info/
|
42
|
-
* [#hundred](http://rdoc.info/
|
43
|
-
* [#thousand](http://rdoc.info/
|
44
|
-
* [#million](http://rdoc.info/
|
45
|
-
* [#billion](http://rdoc.info/
|
46
|
-
* [#trillion](http://rdoc.info/
|
47
|
-
* [#quadrillion](http://rdoc.info/
|
48
|
-
* [String](http://rdoc.info/
|
49
|
-
* [#ascii_only](http://rdoc.info/
|
50
|
-
* [#ascii_only!](http://rdoc.info/
|
51
|
-
* [#blank?](http://rdoc.info/
|
52
|
-
* [#format](http://rdoc.info/
|
53
|
-
* [#remove](http://rdoc.info/
|
54
|
-
* [#remove!](http://rdoc.info/
|
55
|
-
* [#remove_prefix](http://rdoc.info/
|
56
|
-
* [#remove_prefix!](http://rdoc.info/
|
57
|
-
* [#remove_suffix](http://rdoc.info/
|
58
|
-
* [#remove_suffix!](http://rdoc.info/
|
59
|
-
* [#strip_indent](http://rdoc.info/
|
60
|
-
* [#strip_margin](http://rdoc.info/
|
61
|
-
* [#squish](http://rdoc.info/
|
62
|
-
* [#squish!](http://rdoc.info/
|
32
|
+
* [Array](http://rdoc.info/gems/powerpack/Array)
|
33
|
+
* [#butfirst](http://rdoc.info/gems/powerpack/Array#butfirst-instance_method)
|
34
|
+
* [#butlast](http://rdoc.info/gems/powerpack/Array#butlast-instance_method)
|
35
|
+
* [Enumerable](http://rdoc.info/gems/powerpack/Enumerable)
|
36
|
+
* [#average](http://rdoc.info/gems/powerpack/Enumerable#average-instance_method)
|
37
|
+
* [#drop_last](http://rdoc.info/gems/powerpack/Enumerable#drop_last-instance_method)
|
38
|
+
* [#drop_last_while](http://rdoc.info/gems/powerpack/Enumerable#drop_last_while-instance_method)
|
39
|
+
* [#exactly?](http://rdoc.info/gems/powerpack/Enumerable#exactly?-instance_method)
|
40
|
+
* [#frequencies](http://rdoc.info/gems/powerpack/Enumerable#frequencies-instance_method)
|
41
|
+
* [#several?](http://rdoc.info/gems/powerpack/Enumerable#several?-instance_method)
|
42
|
+
* [#sum](http://rdoc.info/gems/powerpack/Enumerable#sum-instance_method)
|
43
|
+
* [#take_last](http://rdoc.info/gems/powerpack/Enumerable#take_last-instance_method)
|
44
|
+
* [#take_last_while](http://rdoc.info/gems/powerpack/Enumerable#take_last_while-instance_method)
|
45
|
+
* [Hash](http://rdoc.info/gems/powerpack/Hash)
|
46
|
+
* [#symbolize_keys](http://rdoc.info/gems/powerpack/Hash#symbolize_keys-instance_method)
|
47
|
+
* [Numeric](http://rdoc.info/gems/powerpack/Numeric)
|
48
|
+
* [#pos?](http://rdoc.info/gems/powerpack/Numeric#pos?-instance_method)
|
49
|
+
* [#neg?](http://rdoc.info/gems/powerpack/Numeric#neg?-instance_method)
|
50
|
+
* [#hundred](http://rdoc.info/gems/powerpack/Numeric#hundred-instance_method)
|
51
|
+
* [#thousand](http://rdoc.info/gems/powerpack/Numeric#thousand-instance_method)
|
52
|
+
* [#million](http://rdoc.info/gems/powerpack/Numeric#million-instance_method)
|
53
|
+
* [#billion](http://rdoc.info/gems/powerpack/Numeric#billion-instance_method)
|
54
|
+
* [#trillion](http://rdoc.info/gems/powerpack/Numeric#trillion-instance_method)
|
55
|
+
* [#quadrillion](http://rdoc.info/gems/powerpack/Numeric#quadrillion-instance_method)
|
56
|
+
* [String](http://rdoc.info/gems/powerpack/String)
|
57
|
+
* [#ascii_only](http://rdoc.info/gems/powerpack/String#ascii_only-instance_method)
|
58
|
+
* [#ascii_only!](http://rdoc.info/gems/powerpack/String#ascii_only!-instance_method)
|
59
|
+
* [#blank?](http://rdoc.info/gems/powerpack/String#blank?-instance_method)
|
60
|
+
* [#format](http://rdoc.info/gems/powerpack/String#format-instance_method)
|
61
|
+
* [#remove](http://rdoc.info/gems/powerpack/String#remove-instance_method)
|
62
|
+
* [#remove!](http://rdoc.info/gems/powerpack/String#remove!-instance_method)
|
63
|
+
* [#remove_prefix](http://rdoc.info/gems/powerpack/String#remove_prefix-instance_method)
|
64
|
+
* [#remove_prefix!](http://rdoc.info/gems/powerpack/String#remove_prefix!-instance_method)
|
65
|
+
* [#remove_suffix](http://rdoc.info/gems/powerpack/String#remove_suffix-instance_method)
|
66
|
+
* [#remove_suffix!](http://rdoc.info/gems/powerpack/String#remove_suffix!-instance_method)
|
67
|
+
* [#strip_indent](http://rdoc.info/gems/powerpack/String#strip_indent-instance_method)
|
68
|
+
* [#strip_margin](http://rdoc.info/gems/powerpack/String#strip_margin-instance_method)
|
69
|
+
* [#squish](http://rdoc.info/gems/powerpack/String#squish-instance_method)
|
70
|
+
* [#squish!](http://rdoc.info/gems/powerpack/String#squish!-instance_method)
|
63
71
|
|
64
72
|
## Documentation
|
65
73
|
|
66
74
|
A listing of the extensions provided by Powerpack is available
|
67
|
-
[here](http://rdoc.info/
|
75
|
+
[here](http://rdoc.info/gems/powerpack).
|
68
76
|
|
69
77
|
## Usage
|
70
78
|
|
@@ -36,7 +36,7 @@ class String
|
|
36
36
|
:replace => '', # Use a blank for those replacements
|
37
37
|
:UNIVERSAL_NEWLINE_DECORATOR => true # Always break lines with \n
|
38
38
|
}
|
39
|
-
self.encode! Encoding.find('ASCII'), encoding_options
|
39
|
+
self.encode! Encoding.find('ASCII'), **encoding_options
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/lib/powerpack/version.rb
CHANGED
data/powerpack.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_development_dependency 'bundler', '
|
20
|
+
spec.add_development_dependency 'bundler', '>= 1.3', "< 3.0"
|
21
21
|
spec.add_development_dependency 'rake'
|
22
22
|
spec.add_development_dependency('rspec')
|
23
23
|
spec.add_development_dependency('yard', '~> 0.9')
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: powerpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-16 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.3'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.3'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
164
|
- !ruby/object:Gem::Version
|
159
165
|
version: '0'
|
160
166
|
requirements: []
|
161
|
-
|
162
|
-
rubygems_version: 2.6.11
|
167
|
+
rubygems_version: 3.1.2
|
163
168
|
signing_key:
|
164
169
|
specification_version: 4
|
165
170
|
summary: A few useful extensions to core Ruby classes.
|