arugula 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d54840cc707cfd54c866d94b902c4a6a3ac1ec01
4
- data.tar.gz: 918b25030d62dbbff5081f04dd71adbfb3d9222c
3
+ metadata.gz: 450b105a13d2bee3427f3ab008d1a0172e0bbacf
4
+ data.tar.gz: 091ebc89a888684923c2c05175c7370e43844a6f
5
5
  SHA512:
6
- metadata.gz: e7a0b0c985aa8c3b100df17b3cbc2edfcecf767fb8d1e675705324bfbcc2ae38de0e9cc0044931ffc2b65a4340c9d2c517650d0aea641c96eb35d588ea2c6f9f
7
- data.tar.gz: e2960e17711fb417fef5b5b46065639cde59297b60c824cf2068b15b9b72041b699616be45e68b4814814fcb788c24eff91888e6ef4a357e85e39fa1ed2bfe43
6
+ metadata.gz: afb71d903455aa9d1508078919cccc34fd7cb1fb5ad7e15d3e39ab8170f9d31cfd12d21633098088b57e0003e99d267dd097d5acf8aca10901afac03c1266e9e
7
+ data.tar.gz: 27130b99003c17307830266fc1f2b29045d109c9bfaec2fc505f03e4978c3347e35e4945caebe4fe7437b16d7608c3c3510f910a0afc0443450fa26b598cfc5f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arugula (0.2.0)
4
+ arugula (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # Arugula
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/arugula`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ `Arugula` is a naïve (and incomplete) regular expression implementation written
4
+ from scratch on a Friday night.
6
5
 
7
6
  ## Installation
8
7
 
@@ -22,20 +21,35 @@ Or install it yourself as:
22
21
 
23
22
  ## Usage
24
23
 
25
- TODO: Write usage instructions here
24
+ ```ruby
25
+ regexp = Arugula.new('[A-Z][a-z]+')
26
+ regexp.match?('ahoy! my name is Samuel') # => 17
27
+ regexp.match?('foobar') # => null
28
+ ```
26
29
 
27
30
  ## Development
28
31
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+ After checking out the repo, run `bin/setup` to install dependencies.
33
+ Then, run `bin/rake spec` to run the tests.
34
+ You can also run `bin/console` for an interactive prompt that will allow you to
35
+ experiment.
30
36
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+ To install this gem onto your local machine, run `bundle exec rake install`.
38
+ To release a new version, update the version number in `version.rb`,
39
+ run `bundle install`, commit,
40
+ and then run `bundle exec rake release`, which will create a git tag for the
41
+ version, push git commits and tags,
42
+ and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
43
 
33
44
  ## Contributing
34
45
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/arugula. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
46
+ Bug reports and pull requests are welcome on GitHub at
47
+ https://github.com/segiddins/arugula.
48
+ This project is intended to be a safe, welcoming space for collaboration,
49
+ and contributors are expected to adhere to the
50
+ [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
51
 
38
52
  ## License
39
53
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
54
+ The gem is available as open source under the terms of the
55
+ [MIT License](http://opensource.org/licenses/MIT).
data/lib/arugula.rb CHANGED
@@ -8,8 +8,7 @@ class Arugula
8
8
  @root = Parser.new(pattern).parse!
9
9
  end
10
10
 
11
- def match?(str)
12
- index = 0
11
+ def match?(str, index = 0)
13
12
  loop do
14
13
  match, = @root.match(str, index)
15
14
  return index if match
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class Arugula
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arugula
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
@@ -14,42 +14,42 @@ dependencies:
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.5'
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.5'
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.4'
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.4'
55
55
  description:
@@ -59,10 +59,10 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".rubocop.yml"
65
- - ".travis.yml"
62
+ - .gitignore
63
+ - .rspec
64
+ - .rubocop.yml
65
+ - .travis.yml
66
66
  - CODE_OF_CONDUCT.md
67
67
  - Gemfile
68
68
  - Gemfile.lock
@@ -89,12 +89,12 @@ require_paths:
89
89
  - lib
90
90
  required_ruby_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ">="
92
+ - - '>='
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ">="
97
+ - - '>='
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []