boogex 0.1.0 → 0.1.1

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: de3fe706280ac098115350c77c0420f36ca96af9
4
- data.tar.gz: e9f87414d4bfd2d1ee3d617eabbd919f3e5fb777
3
+ metadata.gz: 83f81d847ac61e973b5d4db503c9f03632308c9e
4
+ data.tar.gz: 09d2def1e45e8bd365b67f94f0157072c3ecfb31
5
5
  SHA512:
6
- metadata.gz: bf3676878d21a6342639ca8f57671d80932442c4c266ce478be5a5a5320d45b23b721fe9a419c4739fbd3f8a456f9916e118a94ccc465cf876f36e9839c075ab
7
- data.tar.gz: 0dab88ba6541a518550808c7cf6ae1a64b5c537adc5b4f056a7369243a274f9f7747e440d318b627179a69c940039f605aa22f8c39d5e4aec3ad5851181f710c
6
+ metadata.gz: 525ffc546863d4719e249a92b6939b44e3d716504dc53e776ddc11234090a94bb000638973233b234b7a597f97cbc4289e63a103d4e82c7bb7cf2782674800f8
7
+ data.tar.gz: b6ef7c7cba2d1948080e5dba10610f9b5da545b590253a67b2c7d3cf9fea5cb8e25b3f2cd0b33679a6ebade54ce06a230e69c859fcddbcc36c70500a10da7266
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boogex (0.0.1)
4
+ boogex (0.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,10 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "boogex/version"
4
+
1
5
  Gem::Specification.new do |s|
6
+ s.version = Boogex::VERSION
2
7
  s.name = 'boogex'
3
- s.version = '0.1.0'
4
8
  s.date = '2016-02-14'
5
9
  s.homepage = 'https://github.com/lexerdev/boogex.gem'
6
10
  s.license = 'MIT'
@@ -19,7 +19,7 @@ module Boogex
19
19
  inside_brackets = "[^\(\)]*"
20
20
 
21
21
  #This regex looks for anything in brackets OR anything with brackets in brackets OR anything with brackets in brackets in brackets
22
- regex = /(\(#{inside_brackets}\))|(\(#{inside_brackets}\(#{inside_brackets}\)#{inside_brackets}\))|(\(#{inside_brackets}\(#{inside_brackets}\(#{inside_brackets}\)#{inside_brackets}\)#{inside_brackets}\))/
22
+ regex = /(\(#{inside_brackets}\))|(\(#{inside_brackets}\(#{inside_brackets}\)#{inside_brackets}\))|(\(#{inside_brackets}\(#{inside_brackets}\)[^\(]*\(#{inside_brackets}\)#{inside_brackets}\))|(\(#{inside_brackets}\(#{inside_brackets}\(#{inside_brackets}\)#{inside_brackets}\)#{inside_brackets}\))/
23
23
 
24
24
  cuts = text.scan(regex).to_a.flatten.reject(&:nil?)
25
25
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Boogex
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
@@ -35,4 +35,11 @@ describe Boogex do
35
35
  result = Boogex.convert(string)
36
36
  assert_equal expecting, result
37
37
  end
38
+
39
+ it 'understands double embedded AND' do
40
+ string = 'Peeps OR ((dude OR roos) AND (what OR Footy))'
41
+ expecting = "Peeps|AND(['(?:dude|roos)','(?:what|Footy)'])"
42
+ result = Boogex.convert(string)
43
+ assert_equal expecting, result
44
+ end
38
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boogex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Crouch