grn_mini 0.5.0 → 0.6.0

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: ae45c1488c3a7184b8fd2c10bba81c2eed07d494
4
- data.tar.gz: de61b4abb5bc91414e59fa604172c6c77d12a4fb
3
+ metadata.gz: b27bb5e7e2b183d686409ef30ef001ac6cf16666
4
+ data.tar.gz: b506f67fc449d9ae1dfdb53ebe9fbb8fe3e0e449
5
5
  SHA512:
6
- metadata.gz: ce4e8c4e078767403beb126bd8db0b9e1fe423088cb2e16297798cee3089af4d06a1e145cfb7bdbd98567e45bd65f3b6c0d3497345195d0a7e58235fda137c89
7
- data.tar.gz: 1b79f00b43b762205ab8b6415b637886d7a305b7dbb62acdea87cefee24ff20b3829bb8511e6cf858d37dd6e1e9e05319f3238d4396a5758ee593655fdc99f91
6
+ metadata.gz: 5f8e33886f9ecea434c5149414e811ace41c63426451cab50dcacbbb88b76af82afd42e901d740428c91a14a2ed209b23a42a9648581eeae2ae42781c2ce7c9d
7
+ data.tar.gz: 68867614a92d71582b293c7db31f325794191f1a440e5015713338365ed52b0b14960fc00b4546dee396dae3d349fc6438732052dce7f74a11e8e129c03f0718
data/HISTORY.md CHANGED
@@ -1,9 +1,17 @@
1
1
  # HISTORY - grn_mini
2
2
 
3
+ ## 0.6 - 2014/11/30
4
+
5
+ - GrnMini::tmpdb can be used in non-block
6
+ - Customize default tokenizer
7
+ - GrnMini::default_tokenizer()
8
+ - GrnMnini::default_tokenizer()=
9
+
3
10
  ## 0.5 - 2014/02/11
4
11
 
5
12
  - Use Groonga::Schema
6
- - Can use setup_columns when table column defined already.
13
+ - Can use setup_columns when table column defined already
14
+ - Put link to "Rroonga Install Manual"
7
15
 
8
16
  ## 0.4 - 2014/02/01
9
17
 
@@ -17,9 +17,23 @@ module GrnMini
17
17
  end
18
18
 
19
19
  def tmpdb
20
- Dir.mktmpdir do |dir|
20
+ if block_given?
21
+ Dir.mktmpdir do |dir|
22
+ create_or_open(File.join(dir, "tmp.db"))
23
+ yield
24
+ end
25
+ else
26
+ dir = Dir.mktmpdir
21
27
  create_or_open(File.join(dir, "tmp.db"))
22
- yield
28
+ dir
23
29
  end
24
30
  end
31
+
32
+ def default_tokenizer
33
+ @default_tokenizer || "TokenBigramSplitSymbolAlphaDigit"
34
+ end
35
+
36
+ def default_tokenizer=(tokenizer)
37
+ @default_tokenizer = tokenizer
38
+ end
25
39
  end
@@ -11,7 +11,7 @@ module GrnMini
11
11
  def initialize(name, grn)
12
12
  @name = name
13
13
  @grn = grn
14
- @terms = Groonga["Terms"] || Groonga::PatriciaTrie.create(name: "Terms", key_normalize: true, default_tokenizer: "TokenBigramSplitSymbolAlphaDigit")
14
+ @terms = Groonga["Terms"] || Groonga::PatriciaTrie.create(name: "Terms", key_normalize: true, default_tokenizer: GrnMini::default_tokenizer)
15
15
  @setup_columns_once = false
16
16
  end
17
17
 
@@ -1,3 +1,3 @@
1
1
  module GrnMini
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -1,7 +1,34 @@
1
1
  require 'minitest_helper'
2
+ require 'fileutils'
2
3
 
3
4
  class TestGrnMini < MiniTest::Test
4
5
  def test_that_it_has_a_version_number
5
6
  refute_nil ::GrnMini::VERSION
6
7
  end
8
+
9
+ def test_tmpdb
10
+ GrnMini::tmpdb do
11
+ array = GrnMini::Array.new
12
+ end
13
+ end
14
+
15
+ def test_tmpdb_block_isnt_given
16
+ dir = GrnMini::tmpdb
17
+
18
+ array = GrnMini::Array.new
19
+
20
+ FileUtils.remove_entry_secure dir
21
+ end
22
+
23
+ def test_default_tokenizer
24
+ prev = GrnMini::default_tokenizer
25
+ GrnMini::default_tokenizer = "TokenBigramIgnoreBlank"
26
+ assert_equal "TokenBigramIgnoreBlank", GrnMini::default_tokenizer
27
+
28
+ GrnMini::tmpdb do
29
+ array = GrnMini::Array.new
30
+ end
31
+
32
+ GrnMini::default_tokenizer = prev
33
+ end
7
34
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grn_mini
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ongaeshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
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: '1.3'
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
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rroonga
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Groonga(Rroonga) for using easily. You can add the data in the column
@@ -76,8 +76,8 @@ executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
- - .gitignore
80
- - .travis.yml
79
+ - ".gitignore"
80
+ - ".travis.yml"
81
81
  - Gemfile
82
82
  - HISTORY.md
83
83
  - LICENSE.txt
@@ -106,17 +106,17 @@ require_paths:
106
106
  - lib
107
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - '>='
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.0.0
119
+ rubygems_version: 2.2.2
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Groonga(Rroonga) wrapper for use as the KVS.
@@ -127,4 +127,3 @@ test_files:
127
127
  - test/test_hash.rb
128
128
  - test/test_micro_blog.rb
129
129
  - test/test_setup_columns.rb
130
- has_rdoc: