findrr 0.0.2 → 0.0.3

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: b43b8b92b94614de19cfb1c1285e7c1aeab611fb
4
- data.tar.gz: 989e319e2cfc2aabbac32c511fe73f58dde0501b
3
+ metadata.gz: f482ac9128560b5bb2556532a0449ed61eca3dcd
4
+ data.tar.gz: e7dd172941adeb0e3d9a30dd6d8390f19a42716e
5
5
  SHA512:
6
- metadata.gz: 7022195f168af37305ef489d0fa8a0ccba04de6bd0dd21f3f8cf52f9758ad3b53b5c6168e7ce3dc124e7a6b1400bc1f853060ab6031e0f81505b7967221d93b4
7
- data.tar.gz: 1d60e28709ef47dba08d835fb0c9f461aaf05cbecac930f70a8114cb5bf32a4de8038b8bcb34798f5c4a744d80570917bd723733bca3a26c838a75bccdd05ced
6
+ metadata.gz: fd0e53778525a66c47d2bbfd41522a4d064593909051d22381eff0f22cf285308dd8bb49ff2471d45ffc023de76ddf5958ae3c93b85d04270c874bfefc57d3e8
7
+ data.tar.gz: fcc1e54642e02d7879ec02d26e8a326cf0897e424ac11ea03b634e15f01103ef4e13d3d79df46e5f090bd9b165cc1cd947cacc3fe0ddbc10622623ed1079a036
data/NEWS.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.0.3: 2013-12-13
4
+
5
+ ### Changes
6
+
7
+ * Improvements
8
+ * Use ShortText type to "basename" column.
9
+ * Added "Registers" table.
10
+
11
+ * Fixes
12
+ * Skip Errno::ENOENT when collecting filenames.
13
+
3
14
  ## 0.0.2: 2013-12-13
4
15
 
5
16
  Improve the table shcema!
@@ -9,7 +9,7 @@ module Findrr
9
9
  Database.new.collect(path)
10
10
  rescue => e
11
11
  $stderr.puts <<-END_OF_MESSAGE
12
- Error: #{e.message}
12
+ #{e.class}: #{e.message}
13
13
  Hint: table schema might be changed. Please try `findrr destroy` command.
14
14
  END_OF_MESSAGE
15
15
  end
@@ -21,7 +21,7 @@ Hint: table schema might be changed. Please try `findrr destroy` command.
21
21
  Database.new.search(part_of_filename)
22
22
  rescue => e
23
23
  $stderr.puts <<-END_OF_MESSAGE
24
- Error: #{e.message}
24
+ #{e.class}: #{e.message}
25
25
  Hint: database probably isn't created. Please try `findrr collect` command.
26
26
  END_OF_MESSAGE
27
27
  end
@@ -14,11 +14,15 @@ module Findrr
14
14
  create_database_dir
15
15
  create_database
16
16
  Groonga::Database.open(database_path) do
17
- Groonga["Registers"].add(target)
17
+ Groonga["Registers"].add(File.expand_path(target))
18
18
  files = Groonga["Files"]
19
19
  Find.find(File.expand_path(target)) do |path|
20
- files.add(path, :basename => File.basename(path),
21
- :mtime => File.mtime(path))
20
+ begin
21
+ files.add(path, :basename => File.basename(path),
22
+ :mtime => File.mtime(path))
23
+ rescue Errno::ENOENT
24
+ next
25
+ end
22
26
  end
23
27
  files.size
24
28
  end
@@ -64,10 +68,10 @@ module Findrr
64
68
 
65
69
  Groonga::Database.create(:path => database_path)
66
70
 
67
- Groonga::Schema.create_table("Registers", :type => :hash)
71
+ Groonga::Schema.create_table("Registers", :type => :patricia_trie)
68
72
 
69
73
  Groonga::Schema.create_table("Files", :type => :patricia_trie) do |table|
70
- table.text("basename")
74
+ table.short_text("basename")
71
75
  table.time("mtime")
72
76
  end
73
77
 
@@ -1,3 +1,3 @@
1
1
  module Findrr
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: findrr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama