smallcage 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.7 2009-09-18
2
+
3
+ * bugfix issue #2: The files under the common prefix directory should not be removed. http://github.com/bluemark/smallcage/issues/#issue/2
4
+
1
5
  == 0.1.6 2009-09-07
2
6
 
3
7
  * use _local.smc for local machine settings. This file overwrite _dir.smc.
@@ -51,8 +51,9 @@ module SmallCage::Commands
51
51
  def delete_expired_files(urilist)
52
52
  old_urilist = load_list
53
53
  root = @loader.root
54
- target_uri = SmallCage::DocumentPath.new(root, @loader.target).uri
55
-
54
+ target = SmallCage::DocumentPath.new(root, @loader.target)
55
+ target_uri = target.uri
56
+ target_uri += "/" if target.path.directory? and target_uri[-1] != ?/
56
57
  if @loader.target.file?
57
58
  old_urilist << target_uri unless old_urilist.include?(target_uri)
58
59
  return old_urilist
@@ -67,7 +68,7 @@ module SmallCage::Commands
67
68
  not_target_uris << uri
68
69
  end
69
70
  end
70
-
71
+
71
72
  deletelist = target_uris - urilist
72
73
 
73
74
  deletelist.each do |uri|
@@ -2,7 +2,7 @@ module SmallCage #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,2 @@
1
+ --- |
2
+ common prefix directory test. 'a' and 'ab' and 'abc'.
@@ -0,0 +1,4 @@
1
+ --- |
2
+ common prefix directory test. 'a' and 'ab' and 'abc'.
3
+
4
+
@@ -0,0 +1,2 @@
1
+ --- |
2
+ common prefix directory test. 'a' and 'ab'.
@@ -54,5 +54,32 @@ describe "smallcage" do
54
54
  end
55
55
 
56
56
  end
57
+
58
+ # http://github.com/bluemark/smallcage/issues/#issue/2
59
+ it "should not delete files under the common prefix directory" do
60
+ root = Pathname.new(File.dirname(__FILE__) + "/data/htdocs3")
61
+ begin
62
+ SmallCage::Runner.run({ :command => "update", :path => root.to_s, :quiet => true })
63
+
64
+ (root + "a/index.html").file?.should be_true
65
+ (root + "ab/index.html").file?.should be_true
66
+ (root + "abc/index.html").file?.should be_true
67
+
68
+ SmallCage::Runner.run({ :command => "update", :path => (root + "a").to_s, :quiet => true })
69
+
70
+ (root + "a/index.html").file?.should be_true
71
+ (root + "ab/index.html").file?.should be_true
72
+ (root + "abc/index.html").file?.should be_true
73
+
74
+ SmallCage::Runner.run({ :command => "update", :path => (root + "ab").to_s, :quiet => true })
75
+
76
+ (root + "a/index.html").file?.should be_true
77
+ (root + "ab/index.html").file?.should be_true
78
+ (root + "abc/index.html").file?.should be_true
79
+ ensure
80
+ SmallCage::Runner.run({:command => "clean", :path => root.to_s, :quiet => true })
81
+ end
82
+
83
+ end
57
84
 
58
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smallcage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - SAITO Toshihiro
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-09-07 00:00:00 +09:00
14
+ date: 2009-09-18 00:00:00 +09:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
@@ -121,6 +121,9 @@ files:
121
121
  - spec/data/htdocs3/a/b/_local.smc
122
122
  - spec/data/htdocs3/a/b/c/_local.smc
123
123
  - spec/data/htdocs3/a/b/c/index.html.smc
124
+ - spec/data/htdocs3/a/index.html.smc
125
+ - spec/data/htdocs3/ab/index.html.smc
126
+ - spec/data/htdocs3/abc/index.html.smc
124
127
  - spec/document_path_spec.rb
125
128
  - spec/export_spec.rb
126
129
  - spec/import_spec.rb