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 f375eab521dff182d46954b4dd94f252d475de8e 2 parents acc1df0 + 855bb0a
@ongaeshi authored
View
4 HISTORY.rdoc
@@ -1,3 +1,7 @@
+=== 0.1.6 2011/08/03
+
+* Bug fix, faild 'milk init' for Ubunts. (thanks kumonopanya, and maroekun)
+
=== 0.1.5 2011/08/02
* Compatibility Ruby 1.9.2p290.
View
2  VERSION
@@ -1 +1 @@
-0.1.5
+0.1.6
View
2  bin/milk
@@ -6,5 +6,5 @@
require 'rubygems'
require 'milkode/cdstk/cli_cdstk'
-Version = "0.1.5"
+Version = "0.1.6"
Milkode::CLI_Cdstk.execute(STDOUT, ARGV)
View
3  lib/milkode/cdstk/cdstk.rb
@@ -9,6 +9,7 @@
require 'milkode/cdstk/cdstk_yaml'
require 'milkode/common/grenfiletest'
require 'milkode/common/util'
+require 'milkode/common/dir'
include Milkode
require 'kconv'
begin
@@ -45,7 +46,7 @@ def clear_count
end
def init
- if Dir.entries(@db_dir) == [".", ".."]
+ if Dir.emptydir?(@db_dir)
CdstkYaml.create(@db_dir)
@out.puts "create : #{yaml_file}"
db_create(db_file)
View
2  lib/milkode/cdweb/app.rb
@@ -18,7 +18,7 @@
set :haml, :format => :html5
get '/' do
- @version = "0.1.5"
+ @version = "0.1.6"
@package_num = Database.instance.fileList('').size
@file_num = Database.instance.fileNum
haml :index
View
14 lib/milkode/common/dir.rb
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+#
+# @file
+# @brief
+# @author ongaeshi
+# @date 2011/08/03
+
+class Dir
+ def self.emptydir?(dir)
+ entries = Dir.entries(dir)
+ entries == [".", ".."] or entries == ["..", "."]
+ end
+end
+
View
21 test/test_dir.rb
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+#
+# @file
+# @brief
+# @author ongaeshi
+# @date 2011/02/20
+
+require 'milkode/common/dir'
+require 'test/unit'
+require 'file_test_utils'
+
+class TestDir < Test::Unit::TestCase
+ include FileTestUtils
+
+ def test_emptydir?
+ assert_equal true, Dir.emptydir?(".")
+ assert_equal false, Dir.emptydir?("..")
+ end
+end
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.