milkode 1.8.6 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12378f6077b1123ce6b9bcd84cbe0bb3c3ff07a8
4
- data.tar.gz: 2f24db6c3d5662cda2ae568cfc2e6ba5a1beb5bb
3
+ metadata.gz: be80288c1f73665336ab5c3b751e2ea235ee3dd8
4
+ data.tar.gz: 633620e41f54780a8fd1c78d4e3e70c0bb618468
5
5
  SHA512:
6
- metadata.gz: 22c74630e94f14eee72d8e29ed8d85bf8421c0b7b808741ca7bc3688b63a1a4ccb333413453910dbaa386de7564c9fd0dd21d656127149439f132fa2a6f38745
7
- data.tar.gz: b75d71fa9ea0bb72666dabd45addf14613f1f8014f8c9132e61bf2f8c79ff71ce04a724d3d70a74eca1c18ad8a97333e55e1a3c01178159506da4c80e611d983
6
+ metadata.gz: dcd343b63e0a979066b2192d3af7a380ea94efcc732db62288e6ed4e2d4e0443e9991f60d4572268b6a3c19f25d0862ff3c7f3416547a7769239c47ba403c56c
7
+ data.tar.gz: 56079577b015b4e8f12c912cde8b4eb9a407f693d6c12f5afce3c74197fffcda90febbb3e5156c09820a1efecbfc41373b130149deccefbdfbd60439e7a53b7f
@@ -1,3 +1,10 @@
1
+ === 1.8.7 2015/06/22
2
+
3
+ * milk web
4
+ * Add :eliminate_extname attribute
5
+ * Remove duplicated :type => :boolean
6
+ * Add the parameter of :tab_width for coderay
7
+
1
8
  === 1.8.6 2014/10/22
2
9
 
3
10
  * Phrase 'aaa(' is searchable in gmilk
@@ -10,7 +17,7 @@
10
17
 
11
18
  * milk
12
19
  * Add 'milk rm' command
13
- * 'milk remove' is obsolate
20
+ * 'milk remove' is obsolete
14
21
  * Fix a failure when 'gem install milkode' at a empty environment
15
22
 
16
23
  === 1.8.3 2014/10/12
@@ -1,3 +1,10 @@
1
+ === 1.8.7 2015/06/22
2
+
3
+ * milk web
4
+ * Add :eliminate_extname attribute
5
+ * Remove duplicated :type => :boolean
6
+ * Add the parameter of :tab_width for coderay
7
+
1
8
  === 1.8.6 2014/10/22
2
9
 
3
10
  * Phrase 'aaa(' is searchable in gmilk
@@ -10,7 +17,7 @@
10
17
 
11
18
  * milk
12
19
  * Add 'milk rm' command
13
- * 'milk remove' is obsolate
20
+ * 'milk remove' is obsolete
14
21
  * Fix a failure when 'gem install milkode' at a empty environment
15
22
 
16
23
  === 1.8.3 2014/10/12
@@ -89,6 +89,8 @@ EOF
89
89
 
90
90
  :display_about_milkode: true
91
91
  :hide_update_button: false
92
+
93
+ :eliminate_extname: ""
92
94
  EOF
93
95
  end
94
96
  end
@@ -11,6 +11,7 @@ require 'coderay/helpers/file_type'
11
11
  require 'milkode/common/util'
12
12
  require 'milkode/cdweb/lib/coderay_html2'
13
13
  require 'milkode/cdweb/lib/coderay_php_utf8'
14
+ require 'milkode/cdweb/lib/web_setting'
14
15
 
15
16
  module Milkode
16
17
  class CodeRayWrapper
@@ -51,6 +52,9 @@ module Milkode
51
52
  end
52
53
 
53
54
  def to_html
55
+ setting = WebSetting.new
56
+ layout_setting = setting.layout_setting
57
+
54
58
  CodeRay.scan(@content, file_type).
55
59
  html2(
56
60
  :wrap => nil,
@@ -61,11 +65,15 @@ module Milkode
61
65
  :line_number_anchors => false,
62
66
  :onclick_copy_line_number => true,
63
67
  :onclick_copy_prefix => "/#{@filename}:",
64
- :keywords => @keywords
68
+ :keywords => @keywords,
69
+ :tab_width => layout_setting[:tab_width],
65
70
  )
66
71
  end
67
72
 
68
73
  def to_html_anchorlink(url)
74
+ setting = WebSetting.new
75
+ layout_setting = setting.layout_setting
76
+
69
77
  CodeRay.scan(@content, file_type).
70
78
  html2(
71
79
  :wrap => nil,
@@ -75,12 +83,20 @@ module Milkode
75
83
  :line_number_start => @line_number_start,
76
84
  :line_number_anchors => 'n',
77
85
  :line_number_anchor_url => url,
78
- :keywords => @keywords
86
+ :keywords => @keywords,
87
+ :tab_width => layout_setting[:tab_width],
79
88
  )
80
89
  end
81
90
 
82
91
  def file_type
83
- case File.extname(@filename)
92
+ @setting = WebSetting.new
93
+ @extname = File.extname(@filename)
94
+ @p_extname = "^\\#{@extname}$"
95
+ if @setting.eliminate_extname.split(" ").grep(/#{@p_extname}/).size > 0
96
+ @filename = File.basename(@filename, @extname)
97
+ @extname = File.extname(@filename)
98
+ end
99
+ case @extname
84
100
  when ".php"
85
101
  :php_utf8
86
102
  when ".el"
@@ -23,6 +23,12 @@ module Milkode
23
23
 
24
24
  :display_about_milkode => true,
25
25
  :hide_update_button => false,
26
+
27
+ :eliminate_extname => "",
28
+
29
+ :layout_setting => {
30
+ :tab_width => 8
31
+ }
26
32
  }
27
33
 
28
34
  def self.hash_method(name)
@@ -64,6 +70,9 @@ module Milkode
64
70
  end
65
71
 
66
72
  hash_method :hide_update_button
73
+ hash_method :eliminate_extname
74
+
75
+ hash_method :layout_setting
67
76
  end
68
77
  end
69
78
 
@@ -66,7 +66,7 @@ EOF
66
66
  option :force, :type => :boolean, :aliases => '-f', :desc => 'Force remove.'
67
67
  option :verbose, :type => :boolean, :aliases => '-v', :desc => 'Be verbose.'
68
68
  def remove(*args)
69
- $stdout.puts "[warning] 'milk remove' is obsolate. Please use 'milk rm'."
69
+ $stdout.puts "[warning] 'milk remove' is obsolete. Please use 'milk rm'."
70
70
 
71
71
  if args.empty? && !options[:all]
72
72
  CLI.task_help(shell, "remove")
@@ -175,7 +175,7 @@ EOF
175
175
  desc "web", "Startup web interface"
176
176
  option :customize, :type => :boolean, :desc => 'Create customize file.'
177
177
  option :db, :default => Milkode::CLI_Cdweb::select_dbdir, :desc => 'Database dir.'
178
- option :no_browser, :type => :boolean, :default => false, :aliases => '-n', :type => :boolean, :desc => 'Do not launch browser.'
178
+ option :no_browser, :type => :boolean, :default => false, :aliases => '-n', :desc => 'Do not launch browser.'
179
179
  option :host, :default => '127.0.0.1', :aliases => '-o', :desc => 'Listen on HOST.'
180
180
  option :port, :default => 9292, :aliases => '-p', :desc => 'Use PORT.'
181
181
  option :server, :default => 'thin', :aliases => '-s', :desc => 'Use SERVER.'
@@ -1,3 +1,3 @@
1
1
  module Milkode
2
- VERSION = "1.8.6"
2
+ VERSION = "1.8.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milkode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ongaeshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -486,7 +486,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
486
486
  version: '0'
487
487
  requirements: []
488
488
  rubyforge_project:
489
- rubygems_version: 2.2.2
489
+ rubygems_version: 2.4.5
490
490
  signing_key:
491
491
  specification_version: 4
492
492
  summary: Milkode is line based local source code search engine.