milkode 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.ja.rdoc +33 -1
- data/HISTORY.rdoc +22 -0
- data/LICENSE.txt +81 -0
- data/VERSION +1 -1
- data/bin/gmilk +1 -1
- data/bin/milk +1 -1
- data/lib/milkode/cdweb/app.rb +18 -1
- data/lib/milkode/cdweb/lib/database.rb +31 -17
- data/lib/milkode/cdweb/public/css/jquery.multiselect.css +23 -0
- data/lib/milkode/cdweb/public/css/jquery.multiselect.filter.css +3 -0
- data/lib/milkode/cdweb/public/css/milkode.css +10 -2
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/milkode/cdweb/public/css/smoothness/jquery-ui-1.8.22.custom.css +564 -0
- data/lib/milkode/cdweb/public/js/jquery-1.7.2.min.js +4 -0
- data/lib/milkode/cdweb/public/js/jquery-ui-1.8.22.custom.min.js +125 -0
- data/lib/milkode/cdweb/public/js/jquery.multiselect.filter.min.js +15 -0
- data/lib/milkode/cdweb/public/js/jquery.multiselect.min.js +20 -0
- data/lib/milkode/cdweb/public/js/milkode.js +36 -2
- data/lib/milkode/cdweb/views/error.haml +9 -0
- data/lib/milkode/cdweb/views/help.haml +2 -2
- data/lib/milkode/cdweb/views/index.haml +15 -1
- data/lib/milkode/cdweb/views/layout.haml +8 -1
- data/lib/milkode/cli.rb +4 -1
- data/lib/milkode/common/ignore_setting.rb +44 -6
- data/lib/milkode/database/document_table.rb +27 -0
- data/lib/milkode/grep/cli_grep.rb +2 -0
- data/milkode.gemspec +25 -2
- data/test/data/b_project2/runner.rb +11 -0
- data/test/data/b_project2/test_dir.rb +21 -0
- data/test/test_cdweb_app.rb +1 -1
- data/test/test_cli_grep.rb +6 -0
- data/test/test_document_table.rb +15 -0
- data/test/test_ignore_setting.rb +25 -0
- metadata +27 -4
data/milkode.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{milkode}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["ongaeshi"]
|
12
|
-
s.date = %q{2012-
|
12
|
+
s.date = %q{2012-08-05}
|
13
13
|
s.description = %q{Line based local source code search engine & grep-command & web-app.}
|
14
14
|
s.email = %q{ongaeshi0621@gmail.com}
|
15
15
|
s.executables = ["gmilk", "milk"]
|
@@ -52,7 +52,23 @@ Gem::Specification.new do |s|
|
|
52
52
|
"lib/milkode/cdweb/public/css/bootstrap.min.css",
|
53
53
|
"lib/milkode/cdweb/public/css/coderay-patch.css",
|
54
54
|
"lib/milkode/cdweb/public/css/coderay.css",
|
55
|
+
"lib/milkode/cdweb/public/css/jquery.multiselect.css",
|
56
|
+
"lib/milkode/cdweb/public/css/jquery.multiselect.filter.css",
|
55
57
|
"lib/milkode/cdweb/public/css/milkode.css",
|
58
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png",
|
59
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png",
|
60
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png",
|
61
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png",
|
62
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png",
|
63
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png",
|
64
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png",
|
65
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png",
|
66
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-icons_222222_256x240.png",
|
67
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-icons_2e83ff_256x240.png",
|
68
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-icons_454545_256x240.png",
|
69
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-icons_888888_256x240.png",
|
70
|
+
"lib/milkode/cdweb/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png",
|
71
|
+
"lib/milkode/cdweb/public/css/smoothness/jquery-ui-1.8.22.custom.css",
|
56
72
|
"lib/milkode/cdweb/public/images/MilkodeIcon135.png",
|
57
73
|
"lib/milkode/cdweb/public/images/directory.png",
|
58
74
|
"lib/milkode/cdweb/public/images/document-new-4.png",
|
@@ -62,7 +78,12 @@ Gem::Specification.new do |s|
|
|
62
78
|
"lib/milkode/cdweb/public/img/glyphicons-halflings-white.png",
|
63
79
|
"lib/milkode/cdweb/public/img/glyphicons-halflings.png",
|
64
80
|
"lib/milkode/cdweb/public/js/bootstrap.min.js",
|
81
|
+
"lib/milkode/cdweb/public/js/jquery-1.7.2.min.js",
|
82
|
+
"lib/milkode/cdweb/public/js/jquery-ui-1.8.22.custom.min.js",
|
83
|
+
"lib/milkode/cdweb/public/js/jquery.multiselect.filter.min.js",
|
84
|
+
"lib/milkode/cdweb/public/js/jquery.multiselect.min.js",
|
65
85
|
"lib/milkode/cdweb/public/js/milkode.js",
|
86
|
+
"lib/milkode/cdweb/views/error.haml",
|
66
87
|
"lib/milkode/cdweb/views/filelist.haml",
|
67
88
|
"lib/milkode/cdweb/views/header_menu.haml",
|
68
89
|
"lib/milkode/cdweb/views/help.haml",
|
@@ -100,6 +121,8 @@ Gem::Specification.new do |s|
|
|
100
121
|
"test/data/abc.zip",
|
101
122
|
"test/data/b_project/runner.rb",
|
102
123
|
"test/data/b_project/test_dir.rb",
|
124
|
+
"test/data/b_project2/runner.rb",
|
125
|
+
"test/data/b_project2/test_dir.rb",
|
103
126
|
"test/data/c_project/a.txt",
|
104
127
|
"test/data/c_project/abc.c",
|
105
128
|
"test/data/c_project/abc.h",
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# @file
|
4
|
+
# @brief
|
5
|
+
# @author ongaeshi
|
6
|
+
# @date 2011/02/20
|
7
|
+
|
8
|
+
require 'milkode/common/dir'
|
9
|
+
require 'test/unit'
|
10
|
+
require 'file_test_utils'
|
11
|
+
|
12
|
+
class TestDir < Test::Unit::TestCase
|
13
|
+
include FileTestUtils
|
14
|
+
|
15
|
+
def test_emptydir?
|
16
|
+
assert_equal true, Dir.emptydir?(".")
|
17
|
+
assert_equal false, Dir.emptydir?("..")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
|
data/test/test_cdweb_app.rb
CHANGED
data/test/test_cli_grep.rb
CHANGED
@@ -25,6 +25,7 @@ class TestCLI_Grep < Test::Unit::TestCase
|
|
25
25
|
t_cache
|
26
26
|
t_case_sensitive
|
27
27
|
t_keyword
|
28
|
+
t_db
|
28
29
|
end
|
29
30
|
|
30
31
|
def teardown
|
@@ -92,6 +93,11 @@ class TestCLI_Grep < Test::Unit::TestCase
|
|
92
93
|
CLI_Grep.execute(io, "a b -k -p a_project c d".split)
|
93
94
|
CLI_Grep.execute(io, "a b -k c d -l e -k f".split)
|
94
95
|
end
|
96
|
+
|
97
|
+
def t_db
|
98
|
+
io = StringIO.new
|
99
|
+
CLI_Grep.execute(io, "--db #{@work.path("db1")} -a db_dir_expand".split)
|
100
|
+
end
|
95
101
|
end
|
96
102
|
|
97
103
|
|
data/test/test_document_table.rb
CHANGED
@@ -31,6 +31,7 @@ module Milkode
|
|
31
31
|
t_remove_match_path
|
32
32
|
t_add_package_name
|
33
33
|
t_shortpath_below
|
34
|
+
t_search_strict_packages
|
34
35
|
ensure
|
35
36
|
t_cleanup
|
36
37
|
end
|
@@ -40,6 +41,7 @@ module Milkode
|
|
40
41
|
@obj = GroongaDatabase.new
|
41
42
|
@tmp_dir = expand("groonga_database_work")
|
42
43
|
@b_project = expand('data/b_project')
|
44
|
+
@b_project2 = expand('data/b_project2')
|
43
45
|
@c_project = expand('data/c_project')
|
44
46
|
end
|
45
47
|
|
@@ -300,6 +302,19 @@ module Milkode
|
|
300
302
|
@documents.remove_all
|
301
303
|
end
|
302
304
|
|
305
|
+
def t_search_strict_packages
|
306
|
+
@documents.add(@b_project, 'runner.rb')
|
307
|
+
@documents.add(@b_project2, 'runner.rb')
|
308
|
+
|
309
|
+
records = @documents.search(:packages => ['b_project'])
|
310
|
+
assert_equal 2, records.size
|
311
|
+
|
312
|
+
records = @documents.search(:strict_packages => ['b_project'])
|
313
|
+
assert_equal 1, records.size
|
314
|
+
|
315
|
+
@documents.remove_all
|
316
|
+
end
|
317
|
+
|
303
318
|
private
|
304
319
|
|
305
320
|
def touch(filename, timestamp)
|
data/test/test_ignore_setting.rb
CHANGED
@@ -110,4 +110,29 @@ EOF
|
|
110
110
|
assert_equal true, is.ignore?("/doc/lib")
|
111
111
|
assert_equal true, is.ignore?("/doc/lib/test")
|
112
112
|
end
|
113
|
+
|
114
|
+
def test_not_ignore
|
115
|
+
is = IgnoreSetting.new "/", ["/*", "!/bin"]
|
116
|
+
assert_equal true, is.ignore?("/tmp")
|
117
|
+
assert_equal false, is.ignore?("/bin")
|
118
|
+
|
119
|
+
is = IgnoreSetting.new "/", ["/*", "!/path/to/dir"]
|
120
|
+
assert_equal false, is.ignore?("/path") # 途中も除外してはいけない
|
121
|
+
assert_equal false, is.ignore?("/path/to")
|
122
|
+
assert_equal true , is.ignore?("/path/to/a") # 除外対象
|
123
|
+
assert_equal false, is.ignore?("/path/to/dir")
|
124
|
+
|
125
|
+
is = IgnoreSetting.new "/", ["/*", "!/path/to/*/dir"]
|
126
|
+
assert_equal false, is.ignore?("/path")
|
127
|
+
assert_equal false, is.ignore?("/path/to")
|
128
|
+
assert_equal false, is.ignore?("/path/to/lib")
|
129
|
+
assert_equal true, is.ignore?("/path/to/lib/a")
|
130
|
+
assert_equal false, is.ignore?("/path/to/bin")
|
131
|
+
assert_equal true, is.ignore?("/path/to/bin/a")
|
132
|
+
assert_equal false, is.ignore?("/path/to/lib/dir")
|
133
|
+
|
134
|
+
is = IgnoreSetting.new "/", ["/*", "!path/to/dir"]
|
135
|
+
assert_equal false, is.ignore?("/path/to/dir")
|
136
|
+
assert_equal false, is.ignore?("hoge/path/to/dir")
|
137
|
+
end
|
113
138
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milkode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 1
|
10
|
+
version: 0.9.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- ongaeshi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-08-05 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -281,7 +281,23 @@ files:
|
|
281
281
|
- lib/milkode/cdweb/public/css/bootstrap.min.css
|
282
282
|
- lib/milkode/cdweb/public/css/coderay-patch.css
|
283
283
|
- lib/milkode/cdweb/public/css/coderay.css
|
284
|
+
- lib/milkode/cdweb/public/css/jquery.multiselect.css
|
285
|
+
- lib/milkode/cdweb/public/css/jquery.multiselect.filter.css
|
284
286
|
- lib/milkode/cdweb/public/css/milkode.css
|
287
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
288
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
289
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
290
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
291
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
292
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
293
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
294
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
295
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-icons_222222_256x240.png
|
296
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-icons_2e83ff_256x240.png
|
297
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-icons_454545_256x240.png
|
298
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-icons_888888_256x240.png
|
299
|
+
- lib/milkode/cdweb/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png
|
300
|
+
- lib/milkode/cdweb/public/css/smoothness/jquery-ui-1.8.22.custom.css
|
285
301
|
- lib/milkode/cdweb/public/images/MilkodeIcon135.png
|
286
302
|
- lib/milkode/cdweb/public/images/directory.png
|
287
303
|
- lib/milkode/cdweb/public/images/document-new-4.png
|
@@ -291,7 +307,12 @@ files:
|
|
291
307
|
- lib/milkode/cdweb/public/img/glyphicons-halflings-white.png
|
292
308
|
- lib/milkode/cdweb/public/img/glyphicons-halflings.png
|
293
309
|
- lib/milkode/cdweb/public/js/bootstrap.min.js
|
310
|
+
- lib/milkode/cdweb/public/js/jquery-1.7.2.min.js
|
311
|
+
- lib/milkode/cdweb/public/js/jquery-ui-1.8.22.custom.min.js
|
312
|
+
- lib/milkode/cdweb/public/js/jquery.multiselect.filter.min.js
|
313
|
+
- lib/milkode/cdweb/public/js/jquery.multiselect.min.js
|
294
314
|
- lib/milkode/cdweb/public/js/milkode.js
|
315
|
+
- lib/milkode/cdweb/views/error.haml
|
295
316
|
- lib/milkode/cdweb/views/filelist.haml
|
296
317
|
- lib/milkode/cdweb/views/header_menu.haml
|
297
318
|
- lib/milkode/cdweb/views/help.haml
|
@@ -329,6 +350,8 @@ files:
|
|
329
350
|
- test/data/abc.zip
|
330
351
|
- test/data/b_project/runner.rb
|
331
352
|
- test/data/b_project/test_dir.rb
|
353
|
+
- test/data/b_project2/runner.rb
|
354
|
+
- test/data/b_project2/test_dir.rb
|
332
355
|
- test/data/c_project/a.txt
|
333
356
|
- test/data/c_project/abc.c
|
334
357
|
- test/data/c_project/abc.h
|