java_regex 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. data/lib/java_regex/translator.rb +1 -4
  2. metadata +2 -2
@@ -26,10 +26,7 @@ class JavaRegex::Translator
26
26
  end
27
27
 
28
28
  def self.character_classes_or_character_sets(regex)
29
- literal_hyphen = regex.scan(/\[\\.-.\]/)
30
- raise JavaRegexException::TranslationError,
31
- 'Literal hyphens like [\d-z] are not supported' unless
32
- literal_hyphen.empty?
29
+ regex.gsub!(/(\[\\.)-(.\])/, '\1\\-\2')
33
30
  end
34
31
 
35
32
  def self.word_boundaries(regex)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: java_regex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! " For the most common cases, either converts to the Ruby equivalent,
15
15
  or\n throws an exception if conversion is not supported.\n"