regexp_trie 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: dc5d82e2dcc68ec8de57029fbf620684030d9bb7
4
- data.tar.gz: 295962c592aab654c8e6ca6be08d302d34e9b04f
3
+ metadata.gz: 01582ccdb8d800cc4fb4ddcc6e31d333a4078c33
4
+ data.tar.gz: 176d5895f95dba8a666e0752766fb4a380062304
5
5
  SHA512:
6
- metadata.gz: 19d2c66bbdd657e6cb2eb004289a721e3c098bac5f9736ac90cb1a7f18621ceb012b24da292bc07958153352f97a0c813b7c4be919d99ada0d32e6febf6c9898
7
- data.tar.gz: 065b12017b3b7117ac824a745d3b0eab5841ddb477d1dfdc6768138faaa7c8703b1f9990f4370fdc61de817183e51fc1b156352dedf936479ed6e0244c5be474
6
+ metadata.gz: 37e291c4c4384a5a12d2e0d5b8f112dac8fdc97dc9a76e9386be2dbec5f39ed6438fa8479cfc65cfdaa585425b5b772f2e4499d5aa46ea49a4a6f7541dd6bde3
7
+ data.tar.gz: f7b71a7c335df3f54d316d7a9afd34022b6081ab6a9207948ec0a7db697bcce9ba7e87a086387cf1d62d13b7933225ee4591d086dd6ad91ad195dd7789059a69
data/CHANGES.md ADDED
@@ -0,0 +1,9 @@
1
+ Revision history of the RegexpTrie gem
2
+
3
+ ## v0.2.0 - 2016/01/22
4
+
5
+ - Tweaks for documentation
6
+
7
+ ## v0.1.0 - 2016/01/22
8
+
9
+ - Initial release
data/README.md CHANGED
@@ -3,10 +3,17 @@
3
3
  ## Synopsis
4
4
 
5
5
  ```ruby
6
+ #!/usr/bin/env ruby
6
7
  require 'regexp_trie'
7
- rt = RegexpTrie.new;
8
- rt.add_all(*%w(foobar fooxar foozap fooza/))
9
- puts $rt.to_regexp # (?-xism:foo(?:bar|xar|zap?))
8
+ # like Regexp.union()
9
+ p RegexpTrie.union(%w(foobar fooxar foozap fooza)) # (?-mix:foo(?:bar|xar|zap?))
10
+
11
+ # or object-oriented interface
12
+ rt = RegexpTrie.new
13
+ %w(foobar fooxar foozap fooza).each do |word|
14
+ rt.add(word)
15
+ end
16
+ p rt.to_regexp # (?-mix:foo(?:bar|xar|zap?))
10
17
  ```
11
18
 
12
19
  See also the original [Regexp::Trie in Perl](https://metacpan.org/pod/Regexp::Trie).
@@ -25,6 +32,10 @@ Add this line to your application's Gemfile:
25
32
  gem 'regexp_trie'
26
33
  ```
27
34
 
35
+ ## Known Issues
36
+
37
+ This is not perfectly compatible with `Regexp.union()`.
38
+
28
39
  ## Development
29
40
 
30
41
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/example/synopsis.rb CHANGED
@@ -1,4 +1,11 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'regexp_trie'
2
- rt = RegexpTrie.new;
3
- rt.add_all(*%w(foobar fooxar foozap fooza))
4
- puts rt.to_regexp # (?-mix:foo(?:bar|xar|zap?))
3
+ # like Regexp.union()
4
+ p RegexpTrie.union(%w(foobar fooxar foozap fooza)) # /foo(?:bar|xar|zap?)/
5
+
6
+ # or object-oriented interface
7
+ rt = RegexpTrie.new
8
+ %w(foobar fooxar foozap fooza).each do |word|
9
+ rt.add(word)
10
+ end
11
+ p rt.to_regexp # /foo(?:bar|xar|zap?)/
@@ -1,3 +1,3 @@
1
1
  class RegexpTrie
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regexp_trie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FUJI Goro (gfx)
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".travis.yml"
78
+ - CHANGES.md
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md