milkode 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.ja.rdoc +28 -0
- data/HISTORY.rdoc +28 -0
- data/VERSION +1 -1
- data/bin/gmilk +1 -1
- data/bin/milk +1 -1
- data/lib/milkode/cdweb/app.rb +1 -1
- data/lib/milkode/cdweb/lib/package_list.rb +43 -0
- data/lib/milkode/cdweb/lib/search_contents.rb +1 -1
- data/lib/milkode/cdweb/lib/web_setting.rb +1 -1
- data/lib/milkode/cdweb/locales/en.yml +2 -0
- data/lib/milkode/cdweb/locales/ja.yml +2 -0
- data/lib/milkode/cdweb/views/index.haml +16 -27
- data/lib/milkode/cdweb/views/milkode.scss +30 -1
- data/milkode.gemspec +2 -2
- data/test/test_cli.rb +3 -3
- metadata +2 -2
data/HISTORY.ja.rdoc
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
=== 1.5.0 2014/02/08
|
2
|
+
|
3
|
+
* milk web
|
4
|
+
* トップページをリニューアル
|
5
|
+
* タイムラインスタイルに変更
|
6
|
+
|
7
|
+
=== 1.4.0 2013/11/29
|
8
|
+
|
9
|
+
* milk web
|
10
|
+
* Add Filtering feature
|
11
|
+
* Package
|
12
|
+
* Suffix
|
13
|
+
* Directory
|
14
|
+
* Delete result_refinement
|
15
|
+
* Support I18N (thanks takahashim)
|
16
|
+
* Bugfix
|
17
|
+
* Had forgotten Regexp.escape
|
18
|
+
|
19
|
+
* milk
|
20
|
+
* Change Groonga::Schema table.text(“suffix”) -> table.string(“suffix”)
|
21
|
+
* Need 'milk rebuild --all'
|
22
|
+
* #51 Add ‘milk add -b branch_name’ option (thanks niku)
|
23
|
+
* Arrow 'https://.….git' to Util#git_url?
|
24
|
+
* Add 'milk add --from-file LIST'
|
25
|
+
|
26
|
+
* gmilk
|
27
|
+
* Add ‘gmilk -o’ option (Specify output encode)
|
28
|
+
|
1
29
|
=== 1.3.0 2013/10/28
|
2
30
|
|
3
31
|
* milk web
|
data/HISTORY.rdoc
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
=== 1.5.0 2014/02/08
|
2
|
+
|
3
|
+
* milk web
|
4
|
+
* Renewal Top Page
|
5
|
+
* Change to Timeline Style
|
6
|
+
|
7
|
+
=== 1.4.0 2013/11/29
|
8
|
+
|
9
|
+
* milk web
|
10
|
+
* Add Filtering feature
|
11
|
+
* Package
|
12
|
+
* Suffix
|
13
|
+
* Directory
|
14
|
+
* Delete result_refinement
|
15
|
+
* Support I18N (thanks takahashim)
|
16
|
+
* Bugfix
|
17
|
+
* Had forgotten Regexp.escape
|
18
|
+
|
19
|
+
* milk
|
20
|
+
* Change Groonga::Schema table.text(“suffix”) -> table.string(“suffix”)
|
21
|
+
* Need 'milk rebuild --all'
|
22
|
+
* #51 Add ‘milk add -b branch_name’ option (thanks niku)
|
23
|
+
* Arrow 'https://.….git' to Util#git_url?
|
24
|
+
* Add 'milk add --from-file LIST'
|
25
|
+
|
26
|
+
* gmilk
|
27
|
+
* Add ‘gmilk -o’ option (Specify output encode)
|
28
|
+
|
1
29
|
=== 1.3.0 2013/10/28
|
2
30
|
|
3
31
|
* milk web
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0
|
data/bin/gmilk
CHANGED
data/bin/milk
CHANGED
data/lib/milkode/cdweb/app.rb
CHANGED
@@ -16,6 +16,9 @@ module Milkode
|
|
16
16
|
|
17
17
|
FAVORITE_LIST_NUM = 7
|
18
18
|
|
19
|
+
NEWS_ITEM_NUM = 20
|
20
|
+
EXCLUDE_UPDATE_SEC = 300
|
21
|
+
|
19
22
|
def initialize(grndb, suburl)
|
20
23
|
@grndb = grndb
|
21
24
|
@suburl = suburl
|
@@ -57,6 +60,42 @@ module Milkode
|
|
57
60
|
EOF
|
58
61
|
end
|
59
62
|
|
63
|
+
def news_items(locale)
|
64
|
+
updates = @grndb.packages.sort('updatetime')[0...NEWS_ITEM_NUM].map do |v|
|
65
|
+
{
|
66
|
+
kind: :update_news,
|
67
|
+
package: v,
|
68
|
+
timestamp: v.updatetime,
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
adds = @grndb.packages.sort('addtime')[0...NEWS_ITEM_NUM].map do |v|
|
73
|
+
{
|
74
|
+
kind: :add_news,
|
75
|
+
package: v,
|
76
|
+
timestamp: v.addtime,
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
items = (updates + adds).sort_by {|item|
|
81
|
+
item[:timestamp]
|
82
|
+
}.reverse
|
83
|
+
.find_all {|v|
|
84
|
+
if v[:kind] == :update_news &&
|
85
|
+
v[:timestamp] - v[:package].addtime < EXCLUDE_UPDATE_SEC
|
86
|
+
false
|
87
|
+
else
|
88
|
+
true
|
89
|
+
end
|
90
|
+
}[0...NEWS_ITEM_NUM]
|
91
|
+
|
92
|
+
items.map {|item|
|
93
|
+
v = item[:package]
|
94
|
+
message = I18n.t(item[:kind], {package_name: "<a href=\"#{@suburl}/home/#{v.name}\">#{v.name}</a>", locale: locale})
|
95
|
+
"<div class='news-item'>#{message} <span class='time'>#{news_time(item[:timestamp])}</span></div>"
|
96
|
+
}.join("\n")
|
97
|
+
end
|
98
|
+
|
60
99
|
# ------------------------------------------------------
|
61
100
|
private
|
62
101
|
|
@@ -76,5 +115,9 @@ EOF
|
|
76
115
|
</ul>
|
77
116
|
EOF
|
78
117
|
end
|
118
|
+
|
119
|
+
def news_time(timestamp)
|
120
|
+
timestamp.strftime("%Y-%m-%d %R")
|
121
|
+
end
|
79
122
|
end
|
80
123
|
end
|
@@ -54,7 +54,7 @@ module Milkode
|
|
54
54
|
|
55
55
|
def about_milkode(locale)
|
56
56
|
if (@data[:display_about_milkode])
|
57
|
-
'
|
57
|
+
'<a href="http://milkode.ongaeshi.me">'+I18n.t(:about_milkode, locale: locale)+'</a>'
|
58
58
|
else
|
59
59
|
''
|
60
60
|
end
|
@@ -17,11 +17,11 @@
|
|
17
17
|
%body
|
18
18
|
.container#toppage
|
19
19
|
.row
|
20
|
-
.
|
20
|
+
.span12.text-center
|
21
21
|
%h1 <a href="#{url_for '/'}"><img src=#{url_for @setting.home_icon} alt="milkode-icon" border="0" height="135px" /></a> #{@setting.home_title} <font class="version">#{@version}</font>
|
22
22
|
|
23
23
|
.row
|
24
|
-
.
|
24
|
+
.span12.text-center
|
25
25
|
.form
|
26
26
|
%form(method="post" action="#{url_for '/search'}")
|
27
27
|
%input(name="query" type="text" style="width: 419px;")
|
@@ -29,37 +29,26 @@
|
|
29
29
|
%input(name='pathname' type='hidden' value='#{url_for '/home'}')
|
30
30
|
|
31
31
|
.row
|
32
|
-
.
|
32
|
+
.span12.text-center
|
33
33
|
#select_package
|
34
34
|
= create_select_package_home
|
35
35
|
|
36
|
-
.row
|
37
|
-
.span3
|
38
|
-
%h2
|
39
|
-
= t(:recently_viewed)
|
40
|
-
= @package_list.top_view
|
41
|
-
.span3
|
42
|
-
%h2
|
43
|
-
= t(:added)
|
44
|
-
= @package_list.top_add
|
45
|
-
.span3
|
46
|
-
%h2
|
47
|
-
= t(:updated)
|
48
|
-
= @package_list.top_update
|
49
|
-
.span3
|
50
|
-
%h2
|
51
|
-
= t(:favorite)
|
52
|
-
= @package_list.top_fav
|
53
|
-
|
54
36
|
%hr
|
55
|
-
|
37
|
+
|
56
38
|
.row
|
57
|
-
.
|
58
|
-
.
|
59
|
-
|
60
|
-
|
61
|
-
|
39
|
+
.span7
|
40
|
+
= @package_list.news_items(@locale)
|
41
|
+
|
42
|
+
.span5
|
43
|
+
.topmenu-item
|
44
|
+
<a href="#{url_for '/home'}">#{@package_num}</a> #{t(:packages)}
|
45
|
+
.topmenu-item
|
46
|
+
<a href="#{url_for '/home?query=f:*'}">#{@file_num}</a> #{t(:files)}
|
47
|
+
.topmenu-item
|
62
48
|
<a href="#{url_for '/help'}">#{t(:help)}</a>
|
49
|
+
.topmenu-item
|
50
|
+
[<a href="#{url_for '/?locale=en'}">#{t(:english)}</a> | <a href="#{url_for '/?locale=ja'}">#{t(:japanese)}</a>]<br>
|
51
|
+
.topmenu-item
|
63
52
|
= @setting.about_milkode(@locale)
|
64
53
|
|
65
54
|
%script(type='text/javascript' src='#{url_for '/js/jquery-1.7.2.min.js'}')
|
@@ -178,6 +178,10 @@ label.ui-corner-all {
|
|
178
178
|
#toppage .footer {
|
179
179
|
}
|
180
180
|
|
181
|
+
#toppage .text-center {
|
182
|
+
text-align: center;
|
183
|
+
}
|
184
|
+
|
181
185
|
/* mainpage */
|
182
186
|
|
183
187
|
#mainpage {
|
@@ -276,4 +280,29 @@ label.ui-corner-all {
|
|
276
280
|
|
277
281
|
.filter_list {
|
278
282
|
margin-top: 3px;
|
279
|
-
}
|
283
|
+
}
|
284
|
+
|
285
|
+
.news-item {
|
286
|
+
font-size: 18px;
|
287
|
+
padding-top: 12px;
|
288
|
+
padding-bottom: 12px;
|
289
|
+
border-color: #f0f0f0;
|
290
|
+
border-bottom-style:solid;
|
291
|
+
border-bottom-width:1px;
|
292
|
+
}
|
293
|
+
|
294
|
+
.news-item .time {
|
295
|
+
color: gray;
|
296
|
+
font-size: 75%;
|
297
|
+
}
|
298
|
+
|
299
|
+
.topmenu-item {
|
300
|
+
font-size: 18px;
|
301
|
+
padding-top: 8px;
|
302
|
+
padding-bottom: 8px;
|
303
|
+
}
|
304
|
+
|
305
|
+
.topmenu-item a {
|
306
|
+
font-size: 18px;
|
307
|
+
}
|
308
|
+
|
data/milkode.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "milkode"
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.5.0"
|
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 = "
|
12
|
+
s.date = "2014-02-08"
|
13
13
|
s.description = "Line based local source code search engine & grep-command & web-app."
|
14
14
|
s.email = "ongaeshi0621@gmail.com"
|
15
15
|
s.executables = ["gmilk", "milk"]
|
data/test/test_cli.rb
CHANGED
@@ -26,9 +26,9 @@ class TestCLI < Test::Unit::TestCase
|
|
26
26
|
def test_add
|
27
27
|
# system("type git")
|
28
28
|
command("add")
|
29
|
-
assert_not_match /error/, command("add
|
30
|
-
assert_not_match /error/, command("add
|
31
|
-
assert_match /error/, 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
32
|
end
|
33
33
|
|
34
34
|
def test_grep
|
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: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: termcolor
|