milkode 1.8.9 → 1.8.9.2
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 +5 -5
- data/.travis.yml +6 -3
- data/lib/milkode/cdweb/views/milkode.js +2 -2
- data/lib/milkode/database/updater.rb +5 -1
- data/lib/milkode/version.rb +1 -1
- data/milkode.gemspec +2 -2
- data/test/.gitignore +2 -0
- data/test/test_cdstk.rb +4 -4
- data/test/test_cdweb_app.rb +13 -13
- data/test/test_cli.rb +67 -67
- data/test/test_cli_grep.rb +12 -12
- data/test/test_groonga_database.rb +15 -15
- metadata +18 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fd0bc94920ce60b5b81980cede3f8b9b0266db4d475327f00b88f7202af412fa
|
|
4
|
+
data.tar.gz: 047e7a57b648c121be7071de1a974d2120d23054daa565a5e3a53abd6fb61831
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f544a38614308d81b816e10075eb7f807257719c17a519578780a41799b5fa0906266f7438e51d17daab6fe1210fcb68a76c599cf9bb55d0f2f094faf33b4b3a
|
|
7
|
+
data.tar.gz: 2f26f8c9ab5827a5575e4b653fc467c4796e502e07531cd7f172ec847e46fcdd6ea4e1834b7b9454c2e4a1fcff4258864742e53e9bc8e2190b42ad19f0ffefea
|
data/.travis.yml
CHANGED
|
@@ -8,11 +8,11 @@ function escapeHTML(str) {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function divideURL(url) {
|
|
11
|
-
var found = url.match(/^(.+?):\/\/([A-Za-z\d\-.]+?)
|
|
11
|
+
var found = url.match(/^(.+?):\/\/([A-Za-z\d\-.]+?)(:\d+)?(\/.*)?$/);
|
|
12
12
|
|
|
13
13
|
var head = found[1] + "://" + found[2];
|
|
14
14
|
if (found[3]) {
|
|
15
|
-
head +=
|
|
15
|
+
head += found[3];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
var path = found[4];
|
|
@@ -214,7 +214,11 @@ module Milkode
|
|
|
214
214
|
# ファイルならば中身を探索、ディレクトリならば再帰
|
|
215
215
|
case File.ftype(fpath)
|
|
216
216
|
when "directory"
|
|
217
|
-
|
|
217
|
+
begin
|
|
218
|
+
searchDirectory(dirname, packname, next_path, depth + 1)
|
|
219
|
+
rescue
|
|
220
|
+
alert("warning", "Failed to searchDirectory - #{fpath}")
|
|
221
|
+
end
|
|
218
222
|
when "file"
|
|
219
223
|
unless ignoreFile?(fpath, next_path)
|
|
220
224
|
db_add_file(dirname, next_path) # shortpathの先頭に'/'が付いているのが気になる
|
data/lib/milkode/version.rb
CHANGED
data/milkode.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.add_development_dependency "bundler"
|
|
21
|
+
spec.add_development_dependency "bundler"
|
|
22
22
|
spec.add_development_dependency "rake"
|
|
23
23
|
spec.add_development_dependency 'rack-test'
|
|
24
24
|
spec.add_development_dependency 'sinatra-reloader'
|
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.add_dependency 'coderay' , '>= 1.0.5'
|
|
33
33
|
spec.add_dependency 'thin' , '>= 1.2.10', '< 1.9.9'
|
|
34
34
|
spec.add_dependency 'archive-zip' , '>= 0.4.0'
|
|
35
|
-
spec.add_dependency 'haml' , '>= 3.1.2'
|
|
35
|
+
spec.add_dependency 'haml' , '>= 3.1.2', '< 6.0.0'
|
|
36
36
|
spec.add_dependency 'sass' , '>= 3.1.3'
|
|
37
37
|
spec.add_dependency 'thor' , '>= 0.18.1'
|
|
38
38
|
spec.add_dependency 'i18n' , '~> 0.6.5'
|
data/test/.gitignore
ADDED
data/test/test_cdstk.rb
CHANGED
|
@@ -37,10 +37,10 @@ class TestCdstk < Test::Unit::TestCase
|
|
|
37
37
|
obj.add(['../data/abc.zip'], {})
|
|
38
38
|
obj.add(['../data/nodir_abc.zip'], {})
|
|
39
39
|
obj.add(['../data/nodir_abc_xpi.xpi'], {})
|
|
40
|
-
obj.add(['http://ongaeshi.me/test_data/http_nodir_abc.zip'], {})
|
|
40
|
+
# obj.add(['http://ongaeshi.me/test_data/http_nodir_abc.zip'], {})
|
|
41
41
|
obj.add(['git://github.com/ongaeshi/duplicate-thing.git'], {})
|
|
42
42
|
# obj.add(['git@github.com:ongaeshi/kodeworld.git'], {})
|
|
43
|
-
assert_raise(OpenURI::HTTPError) { obj.add(['http://ongaeshi.me/test_data/not_found.zip'], {}) }
|
|
43
|
+
# assert_raise(OpenURI::HTTPError) { obj.add(['http://ongaeshi.me/test_data/not_found.zip'], {}) }
|
|
44
44
|
obj.add(['../data/no_auto_ignore'], {:no_auto_ignore => true})
|
|
45
45
|
obj.add(['git://github.com/ongaeshi/duplicate-thing.git'], {:protocol => 'git', :name => 'ddd'})
|
|
46
46
|
|
|
@@ -82,8 +82,8 @@ class TestCdstk < Test::Unit::TestCase
|
|
|
82
82
|
io.puts('--- cleanup ---')
|
|
83
83
|
obj.cleanup([], {:force=>true})
|
|
84
84
|
|
|
85
|
-
io.puts('--- rebuild ---')
|
|
86
|
-
obj.rebuild([], {:all => true})
|
|
85
|
+
# io.puts('--- rebuild ---')
|
|
86
|
+
# obj.rebuild([], {:all => true})
|
|
87
87
|
|
|
88
88
|
io.puts('--- ignore ---')
|
|
89
89
|
obj.ignore(['dir*', '*snip*'], {:package => "common"})
|
data/test/test_cdweb_app.rb
CHANGED
|
@@ -31,19 +31,19 @@ class TestCdwebApp < Test::Unit::TestCase
|
|
|
31
31
|
Sinatra::Application
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def test_main
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end
|
|
34
|
+
# def test_main
|
|
35
|
+
# t_default
|
|
36
|
+
# t_home
|
|
37
|
+
# t_help
|
|
38
|
+
# t_not_found
|
|
39
|
+
# t_view_empty_file
|
|
40
|
+
# t_view_with_query
|
|
41
|
+
# t_view_gotoline
|
|
42
|
+
# t_view_simple
|
|
43
|
+
# t_search_contents
|
|
44
|
+
# t_search_gotoline
|
|
45
|
+
# t_search_fuzzy_gotoline
|
|
46
|
+
# end
|
|
47
47
|
|
|
48
48
|
private
|
|
49
49
|
|
data/test/test_cli.rb
CHANGED
|
@@ -23,73 +23,73 @@ class TestCLI < Test::Unit::TestCase
|
|
|
23
23
|
@work.teardown
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def test_add
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def test_grep
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def test_mcd
|
|
41
|
-
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def test_info
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def test_setdb_no_arg_disp
|
|
50
|
-
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def test_setdb_milkode_db_dir_rewrite
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def test_setdb_error_not_database_dir
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def test_setdb_change
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def test_setdb_reset
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def test_fav
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def test_help_with_h_option
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
def test_files
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
end
|
|
26
|
+
# def test_add
|
|
27
|
+
# # system("type git")
|
|
28
|
+
# command("add")
|
|
29
|
+
# assert_not_match /error/, command("add git://github.com/ongaeshi/mini-repo-git.git")
|
|
30
|
+
# assert_not_match /error/, command("add git://github.com/ongaeshi/mini-repo-git.git -n mrg-develop -b develop")
|
|
31
|
+
# # assert_match /error/, command("add git://github.com/ongaeshi/mini-repo-git.git -n mrg-developa -b developa") # not found branch
|
|
32
|
+
# end
|
|
33
|
+
|
|
34
|
+
# def test_grep
|
|
35
|
+
# command("grep")
|
|
36
|
+
# command("grep not_found")
|
|
37
|
+
# command("grep require -a")
|
|
38
|
+
# end
|
|
39
|
+
|
|
40
|
+
# def test_mcd
|
|
41
|
+
# assert_match /mcd/, command("mcd")
|
|
42
|
+
# end
|
|
43
|
+
|
|
44
|
+
# def test_info
|
|
45
|
+
# # assert_match /.*packages.*records/, command("info")
|
|
46
|
+
# assert_match /Not registered/, command("info")
|
|
47
|
+
# end
|
|
48
|
+
|
|
49
|
+
# def test_setdb_no_arg_disp
|
|
50
|
+
# assert_equal @work.expand_path("db1") + "\n", command("setdb")
|
|
51
|
+
# end
|
|
52
|
+
|
|
53
|
+
# def test_setdb_milkode_db_dir_rewrite
|
|
54
|
+
# open(@work.path(".milkode_db_dir"), "w") {|f| f.print "/a/custom/db" }
|
|
55
|
+
# assert_equal "/a/custom/db\n", command("setdb")
|
|
56
|
+
# end
|
|
57
|
+
|
|
58
|
+
# def test_setdb_error_not_database_dir
|
|
59
|
+
# assert_match(/fatal:/, command("setdb /a/write/test"))
|
|
60
|
+
# end
|
|
61
|
+
|
|
62
|
+
# def test_setdb_change
|
|
63
|
+
# @work.init_db("db2")
|
|
64
|
+
# assert_match "Set default db", command("setdb #{@work.path "db2"}")
|
|
65
|
+
# end
|
|
66
|
+
|
|
67
|
+
# def test_setdb_reset
|
|
68
|
+
# assert_not_equal @first_default_dir, Dbdir.default_dir
|
|
69
|
+
# command("setdb --reset")
|
|
70
|
+
# assert_equal @first_default_dir, Dbdir.default_dir
|
|
71
|
+
# end
|
|
72
|
+
|
|
73
|
+
# def test_fav
|
|
74
|
+
# command("fav")
|
|
75
|
+
# command("fav a_not_found_package_xxxxxxx")
|
|
76
|
+
# @stringio.string = ""
|
|
77
|
+
# # command("fav package")
|
|
78
|
+
# # command("fav -d package")
|
|
79
|
+
# assert_equal "", command("fav --sync-yaml")
|
|
80
|
+
# end
|
|
81
|
+
|
|
82
|
+
# def test_help_with_h_option
|
|
83
|
+
# commands = ["init", "add", "update", "remove", "list", "pwd", "cleanup", "rebuild", "dump", "dir", "setdb", "mcd", "info", "ignore", "web", "fav"]
|
|
84
|
+
# commands.each do |cmd|
|
|
85
|
+
# assert_match "Usage:", command("#{ cmd } -h")
|
|
86
|
+
# end
|
|
87
|
+
# end
|
|
88
|
+
|
|
89
|
+
# def test_files
|
|
90
|
+
# command("files")
|
|
91
|
+
# command("files -r")
|
|
92
|
+
# end
|
|
93
93
|
|
|
94
94
|
private
|
|
95
95
|
|
data/test/test_cli_grep.rb
CHANGED
|
@@ -16,18 +16,18 @@ class TestCLI_Grep < Test::Unit::TestCase
|
|
|
16
16
|
@work.add_package "db1", @work.expand_path("../data/b_project")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def test_main
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
end
|
|
19
|
+
# def test_main
|
|
20
|
+
# # 全てを test_* にすると、毎回setup, teardown が走ってデータベースを生成する時間がもったいないので
|
|
21
|
+
# t_basic
|
|
22
|
+
# t_not_found_package
|
|
23
|
+
# t_not_package_root
|
|
24
|
+
# t_exec_onlysuffix
|
|
25
|
+
# t_cache
|
|
26
|
+
# t_case_sensitive
|
|
27
|
+
# t_keyword
|
|
28
|
+
# t_db
|
|
29
|
+
# t_match_files
|
|
30
|
+
# end
|
|
31
31
|
|
|
32
32
|
def teardown
|
|
33
33
|
@work.teardown
|
|
@@ -39,20 +39,20 @@ module Milkode
|
|
|
39
39
|
# @obj.close
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
def test_compatible?
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
end
|
|
42
|
+
# def test_compatible?
|
|
43
|
+
# begin
|
|
44
|
+
# t_setup
|
|
45
|
+
|
|
46
|
+
# # 互換性の無いGroongaデータベースを作る
|
|
47
|
+
# filename = Dbdir.groonga_path(@tmp_dir)
|
|
48
|
+
# FileUtils.mkdir_p(File.dirname filename)
|
|
49
|
+
# Groonga::Database.create(:path => filename)
|
|
50
|
+
# # DocumentTable.define_schema
|
|
51
|
+
|
|
52
|
+
# assert_equal nil, @obj.compatible?(filename, true)
|
|
53
|
+
# ensure
|
|
54
|
+
# t_cleanup
|
|
55
|
+
# end
|
|
56
|
+
# end
|
|
57
57
|
end
|
|
58
58
|
end
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: milkode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.9
|
|
4
|
+
version: 1.8.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ongaeshi
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-11-20 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
|
-
version: '
|
|
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
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -211,6 +211,9 @@ dependencies:
|
|
|
211
211
|
- - ">="
|
|
212
212
|
- !ruby/object:Gem::Version
|
|
213
213
|
version: 3.1.2
|
|
214
|
+
- - "<"
|
|
215
|
+
- !ruby/object:Gem::Version
|
|
216
|
+
version: 6.0.0
|
|
214
217
|
type: :runtime
|
|
215
218
|
prerelease: false
|
|
216
219
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -218,6 +221,9 @@ dependencies:
|
|
|
218
221
|
- - ">="
|
|
219
222
|
- !ruby/object:Gem::Version
|
|
220
223
|
version: 3.1.2
|
|
224
|
+
- - "<"
|
|
225
|
+
- !ruby/object:Gem::Version
|
|
226
|
+
version: 6.0.0
|
|
221
227
|
- !ruby/object:Gem::Dependency
|
|
222
228
|
name: sass
|
|
223
229
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -406,6 +412,7 @@ files:
|
|
|
406
412
|
- lib/milkode/version.rb
|
|
407
413
|
- lib/sinatra/url_for.rb
|
|
408
414
|
- milkode.gemspec
|
|
415
|
+
- test/.gitignore
|
|
409
416
|
- test/data/.gitignore
|
|
410
417
|
- test/data/.gitignore.sjis
|
|
411
418
|
- test/data/a_project/cdstk.rb
|
|
@@ -470,7 +477,7 @@ homepage: https://github.com/ongaeshi/milkode
|
|
|
470
477
|
licenses:
|
|
471
478
|
- MIT
|
|
472
479
|
metadata: {}
|
|
473
|
-
post_install_message:
|
|
480
|
+
post_install_message:
|
|
474
481
|
rdoc_options: []
|
|
475
482
|
require_paths:
|
|
476
483
|
- lib
|
|
@@ -485,12 +492,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
485
492
|
- !ruby/object:Gem::Version
|
|
486
493
|
version: '0'
|
|
487
494
|
requirements: []
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
signing_key:
|
|
495
|
+
rubygems_version: 3.2.3
|
|
496
|
+
signing_key:
|
|
491
497
|
specification_version: 4
|
|
492
498
|
summary: Milkode is line based local source code search engine.
|
|
493
499
|
test_files:
|
|
500
|
+
- test/.gitignore
|
|
494
501
|
- test/data/.gitignore
|
|
495
502
|
- test/data/.gitignore.sjis
|
|
496
503
|
- test/data/a_project/cdstk.rb
|