Skip to content

Commit

Permalink
Merge pull request #10 from tom-lord/remove_symblinks
Browse files Browse the repository at this point in the history
Remove symlinks
  • Loading branch information
tom-lord committed Dec 17, 2016
2 parents a0b3580 + 6f5df5d commit fac919d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@
*.so
*.o
*.a
.*.sw?
mkmf.log
tags
/coverage/
1 change: 0 additions & 1 deletion db/unicode_ranges_2.1.pstore

This file was deleted.

3 changes: 2 additions & 1 deletion lib/regexp-examples/helpers.rb
Expand Up @@ -19,7 +19,8 @@ def self.permutations_of_strings(arrays_of_strings, max_results_limiter = MaxRes
end

def self.join_preserving_capture_groups(result)
# Only save the LAST group from repeated capture groups, e.g. /([ab]){2}/
# Only save the LAST group from repeated capture groups, because
# e.g. /([ab]){2} \1/.examples should NOT include "ab a"
# (Hence the need for "reverse"!)
subgroups = result
.flat_map(&:all_subgroups)
Expand Down
11 changes: 9 additions & 2 deletions lib/regexp-examples/unicode_char_ranges.rb
Expand Up @@ -14,8 +14,8 @@ class UnicodeCharRanges

attr_reader :range_store

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

def get(key)
Expand All @@ -28,6 +28,13 @@ def get(key)

private

def unicode_ranges_file
db_path = File.join(__dir__, '../../db')
Dir["#{db_path}/*.pstore"].sort.select do |file|
file <= "#{db_path}/unicode_ranges_#{RUBY_VERSION[0..2]}.pstore"
end.last
end

# TODO: Document example input/output of this method
# It's pretty simple, but this code is a little confusing!!
def ranges_to_unicode(ranges)
Expand Down
2 changes: 1 addition & 1 deletion lib/regexp-examples/version.rb
@@ -1,4 +1,4 @@
# Gem version
module RegexpExamples
VERSION = '1.2.1'
VERSION = '1.3.0'
end

0 comments on commit fac919d

Please sign in to comment.