findrr 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/NEWS.md +11 -0
- data/lib/findrr/command.rb +2 -2
- data/lib/findrr/database.rb +9 -5
- data/lib/findrr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f482ac9128560b5bb2556532a0449ed61eca3dcd
|
4
|
+
data.tar.gz: e7dd172941adeb0e3d9a30dd6d8390f19a42716e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!
|
data/lib/findrr/command.rb
CHANGED
@@ -9,7 +9,7 @@ module Findrr
|
|
9
9
|
Database.new.collect(path)
|
10
10
|
rescue => e
|
11
11
|
$stderr.puts <<-END_OF_MESSAGE
|
12
|
-
|
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
|
-
|
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
|
data/lib/findrr/database.rb
CHANGED
@@ -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
|
-
|
21
|
-
|
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 => :
|
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.
|
74
|
+
table.short_text("basename")
|
71
75
|
table.time("mtime")
|
72
76
|
end
|
73
77
|
|
data/lib/findrr/version.rb
CHANGED