powertools 0.2.2 → 0.3.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: 9bcd41100572beb93a11d58824fc071ea5fdf680fc56f0b5c747d5233a4e73fd
4
- data.tar.gz: 52fe1e4acd2de1331c214e2a2575e6d94672172e459303b93fe528daa4ce79ab
3
+ metadata.gz: f8d82a0507106039e0fa6b9ff42e918a2653e0128262bf755fca4816de6fddff
4
+ data.tar.gz: 7677dc849d6ee73b08566425422396fce40ad1a7f0cebb95085a087c031380b5
5
5
  SHA512:
6
- metadata.gz: a63ab6c525bf83c21a6d6374bf720b389c88483fa6e9620b97ed2faf033fbd68b077f8f1d42b4a97754818fb837844eded29ea197a5e83ba283fc9cf04d3a1ee
7
- data.tar.gz: 42d65c8ab48f60abbcb0604a2604ff7221df1d4bd12dd1e96b7d680c2e2e68c2f90662c2ecfe140f81ff2aab5ed879cae694683660ba51e0bfe927df3fe0c678
6
+ metadata.gz: 3a5d905564f9d81b80911ff00f4d16822a1b913c67d4bbcf57c5897c3ad3487d124e886dc89749be8c48747141f28b689618af5d48f449ffc60d05296f8a7e05
7
+ data.tar.gz: f58f2a37ed8b8fa2dbba13dc1bd9036aa2f248f75022d980cb5c878c9818522e38ce9b2dfadbbfb814263692af211db8da17ab7b79d25940458cf3f9d01e66c9
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2021 C.J.Kinniburgh
1
+ Copyright 2022 C.J.Kinniburgh
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -19,6 +19,7 @@ You can currently also use the following to selectively add features:
19
19
  - `require 'powertool/maybe_chain'`
20
20
  - `require 'powertool/range'`
21
21
  - `require 'powertool/set'`
22
+ - `require 'powertool/string'`
22
23
 
23
24
  # Warning about Breaking Changes
24
25
 
data/lib/powertool/set.rb CHANGED
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Extensions to Ruby's Set class
1
4
  class Set
2
- def pop
3
- temp = self.to_a.pop
4
- self.delete(temp)
5
- temp
6
- end
7
- end
5
+ def pop
6
+ temp = to_a.pop
7
+ delete(temp)
8
+ temp
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Extensions to Ruby's String class
4
+ class String
5
+ def titleize
6
+ # This is an alternative to the rails Tileize which removes hyphens, which
7
+ # in all cases, including the "X Men" => "X Men" example in the rails docs.
8
+ # See: https://apidock.com/rails/v6.1.3.1/String/titleize
9
+ humanize.gsub(/\b('?[a-z])/) { Regexp.last_match(1).capitalize }
10
+ end
11
+ end
data/lib/powertools.rb CHANGED
@@ -3,3 +3,4 @@
3
3
  require_relative 'powertool/maybe_chain'
4
4
  require_relative 'powertool/range'
5
5
  require_relative 'powertool/set'
6
+ require_relative 'powertool/string'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Kinniburgh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-09 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: powertools@cjkinni.com
@@ -21,6 +21,7 @@ files:
21
21
  - lib/powertool/maybe_chain.rb
22
22
  - lib/powertool/range.rb
23
23
  - lib/powertool/set.rb
24
+ - lib/powertool/string.rb
24
25
  - lib/powertools.rb
25
26
  homepage: http://github.com/cjkinni/powertools
26
27
  licenses:
@@ -42,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
43
  - !ruby/object:Gem::Version
43
44
  version: '0'
44
45
  requirements: []
45
- rubygems_version: 3.2.22
46
+ rubygems_version: 3.3.3
46
47
  signing_key:
47
48
  specification_version: 4
48
49
  summary: A set of small improvements to Ruby classes