chrislloyd-fancypath 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'date'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "fancypath"
8
- GEM_VERSION = "0.5.2"
8
+ GEM_VERSION = "0.5.3"
9
9
  AUTHORS = ["Myles Byrne", "Chris Lloyd"]
10
10
  EMAIL = "myles@ducknewmedia.com"
11
11
  HOMEPAGE = "http://ducknewmedia.com/fancypath"
data/lib/fancypath.rb CHANGED
@@ -67,6 +67,11 @@ class Fancypath < Pathname
67
67
  self
68
68
  end
69
69
 
70
+ def move(dest)
71
+ self.rename(dest)
72
+ dest.to_path
73
+ end
74
+
70
75
  def set_extension(ext)
71
76
  base = self.to_s[/^ (.+?) (\. ([^\.]+))? $/x, 1]
72
77
  self.class.new(base + '.' + ext)
@@ -83,6 +83,18 @@ describe '#set_extension' do
83
83
 
84
84
  end
85
85
 
86
+ describe '#move' do
87
+
88
+ example "destination has the file contents, source does not exist" do
89
+ @file.write('foo')
90
+ dest = TMP_DIR/'newfile'
91
+ @file.move( dest )
92
+ @file.should_not exist
93
+ dest.read.should == 'foo'
94
+ end
95
+
96
+ end
97
+
86
98
  end #/Fancypath
87
99
 
88
100
  describe "String#to_path" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chrislloyd-fancypath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myles Byrne