Skip to content

Commit fac919d

Browse files
authored
Merge pull request #10 from tom-lord/remove_symblinks
Remove symlinks
2 parents a0b3580 + 6f5df5d commit fac919d

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*.so
1111
*.o
1212
*.a
13+
.*.sw?
1314
mkmf.log
1415
tags
1516
/coverage/

db/unicode_ranges_2.1.pstore

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/regexp-examples/helpers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def self.permutations_of_strings(arrays_of_strings, max_results_limiter = MaxRes
1919
end
2020

2121
def self.join_preserving_capture_groups(result)
22-
# Only save the LAST group from repeated capture groups, e.g. /([ab]){2}/
22+
# Only save the LAST group from repeated capture groups, because
23+
# e.g. /([ab]){2} \1/.examples should NOT include "ab a"
2324
# (Hence the need for "reverse"!)
2425
subgroups = result
2526
.flat_map(&:all_subgroups)

lib/regexp-examples/unicode_char_ranges.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class UnicodeCharRanges
1414

1515
attr_reader :range_store
1616

17-
def initialize(filename = STORE_FILENAME)
18-
@range_store = PStore.new(File.expand_path("../../../db/#{filename}", __FILE__))
17+
def initialize
18+
@range_store = PStore.new(unicode_ranges_file)
1919
end
2020

2121
def get(key)
@@ -28,6 +28,13 @@ def get(key)
2828

2929
private
3030

31+
def unicode_ranges_file
32+
db_path = File.join(__dir__, '../../db')
33+
Dir["#{db_path}/*.pstore"].sort.select do |file|
34+
file <= "#{db_path}/unicode_ranges_#{RUBY_VERSION[0..2]}.pstore"
35+
end.last
36+
end
37+
3138
# TODO: Document example input/output of this method
3239
# It's pretty simple, but this code is a little confusing!!
3340
def ranges_to_unicode(ranges)

lib/regexp-examples/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Gem version
22
module RegexpExamples
3-
VERSION = '1.2.1'
3+
VERSION = '1.3.0'
44
end

0 commit comments

Comments
 (0)