milkode 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 0.2.0 2011/08/10
2
+
3
+ * Issues#4 Bug fix, wrong display of search results. (thanks rakkoyaku, ryo)
4
+ * Issues#5 Delete GoogleAnalytics code. (thanks vividtone)
5
+
1
6
  === 0.1.9 2011/08/05
2
7
 
3
8
  * Bug fix, can't move 'milk web'.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.2.0
data/bin/milk CHANGED
@@ -6,5 +6,5 @@
6
6
  require 'rubygems'
7
7
  require 'milkode/cdstk/cli_cdstk'
8
8
 
9
- Version = "0.1.9"
9
+ Version = "0.2.0"
10
10
  Milkode::CLI_Cdstk.execute(STDOUT, ARGV)
@@ -18,7 +18,7 @@ require 'milkode/cdweb/lib/mkurl'
18
18
  set :haml, :format => :html5
19
19
 
20
20
  get '/' do
21
- @version = "0.1.9"
21
+ @version = "0.2.0"
22
22
  @package_num = Database.instance.fileList('').size
23
23
  @file_num = Database.instance.fileNum
24
24
  haml :index
@@ -44,6 +44,7 @@ module Milkode
44
44
  @total_records = searcher.total_records
45
45
  @range = searcher.data_range
46
46
  @record_content = searcher.html_contents + searcher.html_pagination;
47
+ @match_num = searcher.match_num
47
48
  @elapsed = Time.now - before
48
49
  haml :search
49
50
  end
@@ -216,7 +216,7 @@ module Milkode
216
216
  end
217
217
 
218
218
  # マッチ数
219
- total_records = records.size
219
+ total_records = table.size
220
220
 
221
221
  return records, total_records
222
222
  end
@@ -18,7 +18,10 @@ module Milkode
18
18
  DISP_NUM = 20 # 1ページの表示数
19
19
  LIMIT_NUM = 50 # 最大検索ファイル数
20
20
  NTH = 3 # 表示範囲
21
-
21
+ # DISP_NUM = 1000 # 1ページの表示数
22
+ # LIMIT_NUM = 1000 # 最大検索ファイル数
23
+ # NTH = 3 # 表示範囲
24
+
22
25
  def initialize(path, params, query)
23
26
  @params = params
24
27
  @q = query
@@ -57,6 +60,10 @@ module Milkode
57
60
  EOF
58
61
  end
59
62
 
63
+ def match_num
64
+ @match_records.size
65
+ end
66
+
60
67
  private
61
68
 
62
69
  MatchRecord = Struct.new(:record, :match_line)
@@ -70,7 +77,7 @@ EOF
70
77
  match_line = grep.one_match_and(@q.keywords)
71
78
  @match_records << MatchRecord.new(record, match_line) if match_line
72
79
 
73
- if @match_records.size > DISP_NUM
80
+ if @match_records.size >= DISP_NUM
74
81
  @next_index = index + 1
75
82
  break
76
83
  end
@@ -58,6 +58,10 @@ module Milkode
58
58
  EOF
59
59
  end
60
60
 
61
+ def match_num
62
+ @records.size
63
+ end
64
+
61
65
  private
62
66
 
63
67
  def pagination_link(offset, label)
@@ -13,21 +13,4 @@
13
13
 
14
14
  != yield
15
15
 
16
- %script{:type=>"text/javascript"}
17
- var _gaq = _gaq || [];
18
- _gaq.push(['_setAccount', 'UA-13136329-8']);
19
- _gaq.push(['_trackPageview']);
20
-
21
- (function() {
22
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
23
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
24
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
25
- })();
26
-
27
- -# %hr
28
-
29
- -# %footer
30
- -# %p
31
- -# ! Develop by <a href="./contact.html">ongaeshi</a>
32
- -# ! Powered by <a href="http://www.ruby-lang.org/">Ruby</a> #{::RUBY_VERSION},
33
- -# ! <a href="http://www.sinatrarb.com/">Sinatra</a> #{Sinatra::VERSION}
16
+ -# GoogleAnalyticsを使いたい場合はここにコードを挿入して下さい。
@@ -8,5 +8,10 @@
8
8
  = create_form(@path, params[:query], params[:shead])
9
9
 
10
10
  .search-summary
11
- <span class="keyword">#{topic_path(@path, params)}</span> <span class="total-entries">#{@total_records}</span>件中 <span class="display-range">#{@range.first} - #{@range.last}</span>件(#{@elapsed}秒)
11
+ <span class="keyword">#{topic_path(@path, params)}</span>
12
+ <span class="hit-num">#{@total_records}</span>件ヒット中</span>
13
+ <span class="search-range">#{@range.first}番から#{@range.last - @range.first + 1}件を検索</span>
14
+ <span class="match-num">#{@match_num}</span>件マッチ</span>
15
+ (#{@elapsed}秒)
16
+
12
17
  ~ @record_content
@@ -0,0 +1,148 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{milkode}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{ongaeshi}]
12
+ s.date = %q{2011-08-09}
13
+ s.description = %q{Line based local source code search engine & web-app.}
14
+ s.email = %q{ongaeshi0621@gmail.com}
15
+ s.executables = [%q{cdv}, %q{cdview}, %q{milk}]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "HISTORY.rdoc",
25
+ "LICENSE.txt",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bin/cdv",
30
+ "bin/cdview",
31
+ "bin/milk",
32
+ "lib/milkode/cdstk/cdstk.rb",
33
+ "lib/milkode/cdstk/cdstk_yaml.rb",
34
+ "lib/milkode/cdstk/cli_cdstk.rb",
35
+ "lib/milkode/cdstk/cli_cdstksub.rb",
36
+ "lib/milkode/cdview/cli_cdview.rb",
37
+ "lib/milkode/cdweb/app.rb",
38
+ "lib/milkode/cdweb/cli_cdweb.rb",
39
+ "lib/milkode/cdweb/config.ru",
40
+ "lib/milkode/cdweb/lib/coderay_wrapper.rb",
41
+ "lib/milkode/cdweb/lib/command.rb",
42
+ "lib/milkode/cdweb/lib/database.rb",
43
+ "lib/milkode/cdweb/lib/grep.rb",
44
+ "lib/milkode/cdweb/lib/mkurl.rb",
45
+ "lib/milkode/cdweb/lib/query.rb",
46
+ "lib/milkode/cdweb/lib/search_contents.rb",
47
+ "lib/milkode/cdweb/lib/search_files.rb",
48
+ "lib/milkode/cdweb/public/css/coderay.css",
49
+ "lib/milkode/cdweb/public/css/gren.css",
50
+ "lib/milkode/cdweb/public/images/MilkodeIcon135.png",
51
+ "lib/milkode/cdweb/public/images/directory.png",
52
+ "lib/milkode/cdweb/public/images/file.png",
53
+ "lib/milkode/cdweb/views/filelist.haml",
54
+ "lib/milkode/cdweb/views/help.haml",
55
+ "lib/milkode/cdweb/views/index.haml",
56
+ "lib/milkode/cdweb/views/layout.haml",
57
+ "lib/milkode/cdweb/views/search.haml",
58
+ "lib/milkode/cdweb/views/view.haml",
59
+ "lib/milkode/common/archive-zip.rb",
60
+ "lib/milkode/common/dbdir.rb",
61
+ "lib/milkode/common/dir.rb",
62
+ "lib/milkode/common/display_util.rb",
63
+ "lib/milkode/common/grenfiletest.rb",
64
+ "lib/milkode/common/grensnip.rb",
65
+ "lib/milkode/common/platform.rb",
66
+ "lib/milkode/common/string_snip.rb",
67
+ "lib/milkode/common/util.rb",
68
+ "lib/milkode/findgrep/findgrep.rb",
69
+ "lib/milkode/findgrep/result.rb",
70
+ "milkode.gemspec",
71
+ "test/data/abc.zip",
72
+ "test/data/nodir_abc.zip",
73
+ "test/data/nodir_abc_xpi.xpi",
74
+ "test/file_assert.rb",
75
+ "test/file_test_utils.rb",
76
+ "test/rake_test_loader.rb",
77
+ "test/runner.rb",
78
+ "test/test_bin_exec.rb",
79
+ "test/test_cdstk.rb",
80
+ "test/test_cdstk_yaml.rb",
81
+ "test/test_coderay_wrapper.rb",
82
+ "test/test_coderay_wrapper_data.rb",
83
+ "test/test_database.rb",
84
+ "test/test_dbdir.rb",
85
+ "test/test_dir.rb",
86
+ "test/test_gren_util.rb",
87
+ "test/test_helper.rb",
88
+ "test/test_mkurl.rb",
89
+ "test/test_query.rb",
90
+ "test/test_string_snip.rb",
91
+ "test/test_util.rb",
92
+ "vendor/archive/support/io.rb"
93
+ ]
94
+ s.homepage = %q{http://github.com/ongaeshi/milkode}
95
+ s.licenses = [%q{MIT}]
96
+ s.require_paths = [%q{lib}]
97
+ s.rubygems_version = %q{1.8.6}
98
+ s.summary = %q{Line based local source code search engine & web-app.}
99
+
100
+ if s.respond_to? :specification_version then
101
+ s.specification_version = 3
102
+
103
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
104
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
105
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
106
+ s.add_development_dependency(%q<rcov>, [">= 0"])
107
+ s.add_runtime_dependency(%q<termcolor>, [">= 1.2.0"])
108
+ s.add_runtime_dependency(%q<rroonga>, [">= 1.0.0"])
109
+ s.add_runtime_dependency(%q<rack>, [">= 1.2.1"])
110
+ s.add_runtime_dependency(%q<sinatra>, [">= 1.2.6"])
111
+ s.add_runtime_dependency(%q<launchy>, [">= 0.3.7"])
112
+ s.add_runtime_dependency(%q<coderay>, [">= 0.9.8"])
113
+ s.add_runtime_dependency(%q<thin>, [">= 1.2.10"])
114
+ s.add_runtime_dependency(%q<archive-zip>, [">= 0.3.0"])
115
+ s.add_runtime_dependency(%q<haml>, [">= 3.1.2"])
116
+ s.add_runtime_dependency(%q<sass>, [">= 3.1.3"])
117
+ else
118
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
119
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
120
+ s.add_dependency(%q<rcov>, [">= 0"])
121
+ s.add_dependency(%q<termcolor>, [">= 1.2.0"])
122
+ s.add_dependency(%q<rroonga>, [">= 1.0.0"])
123
+ s.add_dependency(%q<rack>, [">= 1.2.1"])
124
+ s.add_dependency(%q<sinatra>, [">= 1.2.6"])
125
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
126
+ s.add_dependency(%q<coderay>, [">= 0.9.8"])
127
+ s.add_dependency(%q<thin>, [">= 1.2.10"])
128
+ s.add_dependency(%q<archive-zip>, [">= 0.3.0"])
129
+ s.add_dependency(%q<haml>, [">= 3.1.2"])
130
+ s.add_dependency(%q<sass>, [">= 3.1.3"])
131
+ end
132
+ else
133
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
134
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
135
+ s.add_dependency(%q<rcov>, [">= 0"])
136
+ s.add_dependency(%q<termcolor>, [">= 1.2.0"])
137
+ s.add_dependency(%q<rroonga>, [">= 1.0.0"])
138
+ s.add_dependency(%q<rack>, [">= 1.2.1"])
139
+ s.add_dependency(%q<sinatra>, [">= 1.2.6"])
140
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
141
+ s.add_dependency(%q<coderay>, [">= 0.9.8"])
142
+ s.add_dependency(%q<thin>, [">= 1.2.10"])
143
+ s.add_dependency(%q<archive-zip>, [">= 0.3.0"])
144
+ s.add_dependency(%q<haml>, [">= 3.1.2"])
145
+ s.add_dependency(%q<sass>, [">= 3.1.3"])
146
+ end
147
+ end
148
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milkode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-04 00:00:00.000000000Z
12
+ date: 2011-08-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &2152283560 !ruby/object:Gem::Requirement
16
+ requirement: &2151836120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152283560
24
+ version_requirements: *2151836120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jeweler
27
- requirement: &2152274740 !ruby/object:Gem::Requirement
27
+ requirement: &2151835340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2152274740
35
+ version_requirements: *2151835340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rcov
38
- requirement: &2152273480 !ruby/object:Gem::Requirement
38
+ requirement: &2151834260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2152273480
46
+ version_requirements: *2151834260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: termcolor
49
- requirement: &2152272360 !ruby/object:Gem::Requirement
49
+ requirement: &2151833020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.2.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152272360
57
+ version_requirements: *2151833020
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rroonga
60
- requirement: &2152271480 !ruby/object:Gem::Requirement
60
+ requirement: &2151831820 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2152271480
68
+ version_requirements: *2151831820
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack
71
- requirement: &2152270580 !ruby/object:Gem::Requirement
71
+ requirement: &2151830480 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.2.1
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2152270580
79
+ version_requirements: *2151830480
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sinatra
82
- requirement: &2152269340 !ruby/object:Gem::Requirement
82
+ requirement: &2151829080 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.2.6
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2152269340
90
+ version_requirements: *2151829080
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: launchy
93
- requirement: &2152268260 !ruby/object:Gem::Requirement
93
+ requirement: &2151828080 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.3.7
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2152268260
101
+ version_requirements: *2151828080
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: coderay
104
- requirement: &2152267220 !ruby/object:Gem::Requirement
104
+ requirement: &2151826860 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 0.9.8
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *2152267220
112
+ version_requirements: *2151826860
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: thin
115
- requirement: &2152266100 !ruby/object:Gem::Requirement
115
+ requirement: &2151825960 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 1.2.10
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *2152266100
123
+ version_requirements: *2151825960
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: archive-zip
126
- requirement: &2152265120 !ruby/object:Gem::Requirement
126
+ requirement: &2151824500 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 0.3.0
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *2152265120
134
+ version_requirements: *2151824500
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: haml
137
- requirement: &2152264220 !ruby/object:Gem::Requirement
137
+ requirement: &2151823320 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 3.1.2
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *2152264220
145
+ version_requirements: *2151823320
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: sass
148
- requirement: &2152263200 !ruby/object:Gem::Requirement
148
+ requirement: &2151821740 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,7 +153,7 @@ dependencies:
153
153
  version: 3.1.3
154
154
  type: :runtime
155
155
  prerelease: false
156
- version_requirements: *2152263200
156
+ version_requirements: *2151821740
157
157
  description: Line based local source code search engine & web-app.
158
158
  email: ongaeshi0621@gmail.com
159
159
  executables:
@@ -214,6 +214,7 @@ files:
214
214
  - lib/milkode/common/util.rb
215
215
  - lib/milkode/findgrep/findgrep.rb
216
216
  - lib/milkode/findgrep/result.rb
217
+ - milkode.gemspec
217
218
  - test/data/abc.zip
218
219
  - test/data/nodir_abc.zip
219
220
  - test/data/nodir_abc_xpi.xpi