sewell 1.0.1 → 1.0.2

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: 8be9b9a10e900eac90087e772524257a611c5b4a
4
- data.tar.gz: a5230c1ae1a448de4a95073230eac0da0aef3bf7
3
+ metadata.gz: 9eec248152e1cd25971d0c36606436891e5c13e5
4
+ data.tar.gz: f2d071cc42e3ebe6327a47813ded9e42bffde384
5
5
  SHA512:
6
- metadata.gz: f934b702be87e9f4fb43b3e38132c8888e7e4c5b5a64961c46a2ba52803dccbf34140007806d5ae5c50f7f8139bb1cdf70d9268946c009bda8225f17d53d28a0
7
- data.tar.gz: 66024bf342ccf05471e7b031041f73614be470789768bd973f88ee12a9012e71894f81a3b7be040bf31ad7813b5e5a13493b88ed095c9e5dd651ad52b8ab3aaf
6
+ metadata.gz: a7a84532962c2926a798abe847d9e803f40d98ebd1cf02465c28d429fc703667018e597ca79aa2ebea808946534494b65ab241d9e47252b39ed49c47ef3a9d99
7
+ data.tar.gz: cd08c5cae917790d874108b309481f577703a8ddf309a817c645b1e7e7c7eb24828314e3d68a0faac4fbcae61e6dc9290c5ccaafe1f51c53d6bfb2ceab2d43ec
@@ -1,3 +1,3 @@
1
1
  module Sewell
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/sewell.rb CHANGED
@@ -64,8 +64,12 @@ module Sewell
64
64
  end
65
65
  else
66
66
  if x.split('').first == '-'
67
- x.sub!(/^-/, '')
68
- q << ' - ( ' + tables.map{|t| "#{t}:@#{sanitize(x)}"}.join(' OR ') + ' )'
67
+ if x == '-'
68
+ q << '( ' + tables.map{|t| "#{t}:@#{sanitize(x)}"}.join(' OR ') + ' )'
69
+ else
70
+ x.sub!(/^-/, '')
71
+ q << ' - ( ' + tables.map{|t| "#{t}:@#{sanitize(x)}"}.join(' OR ') + ' )'
72
+ end
69
73
  else
70
74
  q << '( ' + tables.map{|t| "#{t}:@#{sanitize(x)}"}.join(' OR ') + ' )'
71
75
  end
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
  require 'sewell'
3
3
 
4
4
  describe Sewell do
5
+ =begin
5
6
  it 'raise TypeError unless input String' do
6
7
  lambda{Sewell.generate [], []}.should raise_error(TypeError)
7
8
  end
@@ -15,4 +16,9 @@ describe Sewell do
15
16
  Sewell.generate({sena: 'airi OR huro', nuko: 'trape'}, 'AND').should == '( sena:@airi OR sena:@huro ) + ( nuko:@trape )'
16
17
  Sewell.generate({mashiro: '-inui airi'}, 'AND').should == '( mashiro:@airi - mashiro:@inui )'
17
18
  end
19
+ =end
20
+
21
+ it 'can generate with "-"' do
22
+ Sewell.generate('ビジュメニア - Single', ['buta']).should == "( buta:@ビジュメニア ) + ( buta:@- ) + ( buta:@Single )"
23
+ end
18
24
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sewell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ssig33
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-01 00:00:00.000000000 Z
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Generator for Groonga's query
@@ -45,8 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .rspec
48
+ - ".gitignore"
49
+ - ".rspec"
50
50
  - Gemfile
51
51
  - LICENSE
52
52
  - README.md
@@ -66,17 +66,17 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.0.3
79
+ rubygems_version: 2.2.2
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Generator for Groonga's query