Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop'

  • Loading branch information...
commit 5d2d9dfdfbca81a65b282899234b575484f42180 2 parents 2c6e39b + 9a84b25
@ongaeshi authored
View
4 HISTORY.rdoc
@@ -1,3 +1,7 @@
+=== 0.1.5 2011/08/02
+
+* Compatibility Ruby 1.9.2p290.
+
=== 0.1.4 2011/08/01
* To act reasonably even if it fails to require 'readline'.
View
3  Rakefile
@@ -30,6 +30,8 @@ Jeweler::Tasks.new do |gem|
gem.add_runtime_dependency 'coderay', '>=0.9.8'
gem.add_runtime_dependency 'thin', '>=1.2.10'
gem.add_runtime_dependency 'archive-zip', '>=0.3.0'
+ gem.add_runtime_dependency 'haml', '>=3.1.2'
+ gem.add_runtime_dependency 'sass', '>=3.1.3'
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
# gem.add_development_dependency 'rspec', '> 1.2.3'
@@ -39,6 +41,7 @@ Jeweler::RubygemsDotOrgTasks.new
require 'rake/testtask'
# groonga関連のテストが通らないため、独自のrake_test_loaderを読み込む
+$LOAD_PATH.unshift '.'
module Rake
class TestTask < TaskLib
def rake_loader # :nodoc:
View
2  VERSION
@@ -1 +1 @@
-0.1.4
+0.1.5
View
2  bin/milk
@@ -6,5 +6,5 @@
require 'rubygems'
require 'milkode/cdstk/cli_cdstk'
-Version = "0.1.4"
+Version = "0.1.5"
Milkode::CLI_Cdstk.execute(STDOUT, ARGV)
View
4 lib/milkode/cdstk/cdstk.rb
@@ -194,7 +194,7 @@ def remove(args, options)
alert("rm_package", package)
@package_count += 1
- Database.instance.remove(package) do |record|
+ Database.instance.remove([package]) do |record|
alert("rm_record", record.path)
@file_count += 1
end
@@ -447,7 +447,7 @@ def db_add_file(stdout, filename, shortpath)
# 実際に使うタイミングでファイルの内容を読み込み
# values[:content] = open(filename).read
# データベース内の文字コードは'utf-8'で統一
- values[:content] = File.read(filename).kconv(Kconv::UTF8)
+ values[:content] = Kconv.kconv(File.read(filename), Kconv::UTF8)
# データベースに格納
values.each do |key, value|
View
2  lib/milkode/cdweb/app.rb
@@ -18,7 +18,7 @@
set :haml, :format => :html5
get '/' do
- @version = "0.1.4"
+ @version = "0.1.5"
@package_num = Database.instance.fileList('').size
@file_num = Database.instance.fileNum
haml :index
View
4 lib/milkode/cdweb/lib/coderay_wrapper.rb
@@ -22,9 +22,9 @@ def initialize(content, filename, match_lines = [])
end
def set_range(range)
- content_a = @content.to_a
+ content_a = @content.split("\n")
range = limit_range(range, content_a)
- @content = content_a[range]
+ @content = content_a[range].join("\n")
@line_number_start = range.first + 1
end
View
2  lib/milkode/cdweb/lib/command.rb
@@ -55,7 +55,7 @@ def filelist(path, params, before)
@total_records = fileList.size
@record_content = fileList.map do |v|
"<dt class='result-file'>#{file_or_dirimg(v[1])}<a href='#{Mkurl.new('/home/' + v[0], params).inherit_query_shead}'>#{File.basename v[0]}</a></dt>"
- end
+ end.join
@elapsed = Time.now - before
haml :filelist
end
View
10 lib/milkode/common/util.rb
@@ -58,7 +58,7 @@ def time_s(time)
t = t % 3600
m = t / 60
t = t % 60
- t += round(time - time.prec_i, 2)
+ t += round(time - time.to_i, 2)
if (h > 0 && m > 0)
"#{h}h #{m}m #{t}s"
@@ -82,13 +82,13 @@ def size_s(size)
kb = 1024
if (size >= tb)
- round(size / tb.prec_f, 2).to_s + "TB"
+ round(size / tb.to_f, 2).to_s + "TB"
elsif (size >= gb)
- round(size / gb.prec_f, 2).to_s + "GB"
+ round(size / gb.to_f, 2).to_s + "GB"
elsif (size >= mb)
- round(size / mb.prec_f, 2).to_s + "MB"
+ round(size / mb.to_f, 2).to_s + "MB"
elsif (size >= kb)
- round(size / kb.prec_f, 2).to_s + "KB"
+ round(size / kb.to_f, 2).to_s + "KB"
else
size.to_s + "Byte"
end
View
4 test/file_assert.rb
@@ -27,8 +27,8 @@ def assert_diff_files(file1, file2)
end
def assert_lines(s1, s2)
- a1 = s1.to_a
- a2 = s2.to_a
+ a1 = s1.split("\n")
+ a2 = s2.split("\n")
a1.each_index do |i|
assert_equal a1[i], a2[i]
View
19 test/test_cdstk_yaml.rb
@@ -51,13 +51,9 @@ def test_000
# save
yaml.save
- assert_equal <<EOF, open('milkode.yaml').read
----
-version: 0.1
-contents:
-- directory: dir1
-- directory: dir4
-EOF
+ r = YAML.load(open('milkode.yaml').read)
+ assert_equal 0.1, r['version']
+ assert_equal([{'directory'=>'dir1'}, {'directory' => 'dir4'}], r['contents'])
end
def test_001
@@ -66,12 +62,9 @@ def test_001
yaml.save
# save
- assert_equal <<EOF, open('otherpath/milkode.yaml').read
----
-version: 0.1
-contents: []
-
-EOF
+ r = YAML.load(open('otherpath/milkode.yaml').read)
+ assert_equal 0.1, r['version']
+ assert_equal([], r['contents'])
end
def test_query
View
4 test/test_database.rb
@@ -63,8 +63,8 @@ def t_cleanup
def t_remove
db = Database.instance
- db.remove('test')
- db.remove('lib')
+ db.remove(['test'])
+ db.remove(['lib'])
assert_equal 0, db.totalRecords
end
Please sign in to comment.
Something went wrong with that request. Please try again.