match_all 0.1.1 → 0.1.2

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: 5fbb6f155a123f64582bde14cb0be8a733632f1debbd5cc414df3af3a25335af
4
- data.tar.gz: 67b9d7deb14f89de97119cbeaa118034eb9efae725f3a337fbb1a589cf338a2e
3
+ metadata.gz: 17597ee7daad1b7f2d883c63a2ae30b513ee04c207f96479a59cc6dab7c7170f
4
+ data.tar.gz: 37b7d31240b09dc27b656dcedfd2bdba67e407cb104840eae3a210579a7e7d2c
5
5
  SHA512:
6
- metadata.gz: a23b6f909543d21f9e0d6d94d56ef3f3be337107286a0716189c285973dd03c14574a56aaa7a8bee2c308da8e36dad676bde19dd76afb321c0bf063b7d25d103
7
- data.tar.gz: 774a7c483d88067e9d9b4c62b1dceff202f907e410ea520726119501e90dba7909a10c22646d3adaab71e3f5be9f2823516929b9de358a243e987088b7234cd3
6
+ metadata.gz: 4760d4e5270db018f3aaa31753402296ed0c3c312d20c0b4453757e5dfd5738beb3ee08ed03669503fecd2d0a55e54a0ce26222bb0b8230d5eb26f3e549379d2
7
+ data.tar.gz: d520199cbc66810f9cccb32b24d51a6c3246d512173b4211fd36807208b1a1d31e3ddfa7298c354bb9c75b284cca02970f43ec24d4f4df3c1b54edefde2e193d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- match_all (0.1.0)
4
+ match_all (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MatchAll
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/match_all.gemspec ADDED
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/match_all/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "match_all"
7
+ spec.version = MatchAll::VERSION
8
+ spec.authors = ["Jeff Lange"]
9
+ spec.email = ["jeffersonian.lange@gmail.com"]
10
+
11
+ spec.summary = "Provides #match_all method to String class"
12
+ spec.description = <<~DESC
13
+ Ruby String's native #match method will only return the first instance of a
14
+ pattern match. This gem provides the #match_all method, returns all instances
15
+ of a pattern match in a String as an array.
16
+
17
+ EXAMPLES:
18
+ # Given the test string:
19
+ string = "My cat is asleep on the couch. Now the cat is playing."
20
+
21
+ # #match only returns the first match:
22
+
23
+ string.match(/cat/)
24
+ => #<MatchData "cat">
25
+
26
+ # However, I've found I often want to match _all_ instances of the pattern, and
27
+ # then e.g. iterate through them and do something with them. #match_all does that:
28
+
29
+ string.match_all(/cat/)
30
+ => [
31
+ [0] #<MatchData "cat">,
32
+ [1] #<MatchData "cat">
33
+ ]
34
+
35
+ This is especially useful if, e.g. you want to interrogate the matches to find
36
+ out their starting/ending indexes within the string, etc
37
+ DESC
38
+ spec.homepage = "https://github.com/jeffdlange/match_all"
39
+ spec.license = "MIT"
40
+ spec.required_ruby_version = ">= 2.6.0"
41
+
42
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
43
+
44
+ spec.metadata["homepage_uri"] = spec.homepage
45
+ spec.metadata["source_code_uri"] = "https://github.com/jeffdlange/match_all"
46
+ spec.metadata["changelog_uri"] = "https://github.com/jeffdlange/match_all/blob/main/CHANGELOG.md"
47
+
48
+ spec.add_development_dependency "rspec", "~> 3.2"
49
+ spec.add_development_dependency "pry", "~> 0.13.1"
50
+
51
+ # Specify which files should be added to the gem when it is released.
52
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
53
+ spec.files = Dir.chdir(__dir__) do
54
+ `git ls-files -z`.split("\x0").reject do |f|
55
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
56
+ end
57
+ end
58
+ spec.bindir = "exe"
59
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
60
+ spec.require_paths = ["lib"]
61
+
62
+ # Uncomment to register a new dependency of your gem
63
+ # spec.add_dependency "example-gem", "~> 1.0"
64
+
65
+ # For more information and examples about making a new gem, check out our
66
+ # guide at: https://bundler.io/guides/creating_gem.html
67
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: match_all
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lange
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-11 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -80,6 +80,7 @@ files:
80
80
  - lib/match_all.rb
81
81
  - lib/match_all/version.rb
82
82
  - lib/ruby_core_extensions/string/match_all.rb
83
+ - match_all.gemspec
83
84
  - sig/match_all.rbs
84
85
  homepage: https://github.com/jeffdlange/match_all
85
86
  licenses: