rindle 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -132,9 +132,13 @@ class Rindle
132
132
  Rindle.index.delete(@index)
133
133
 
134
134
  old_index = @index
135
+ old_path = @path.dup
135
136
  @path.gsub!(filename, new_name)
136
137
  @index = Rindle::Document.generate_index(@path)
137
138
 
139
+ File.rename File.join(Rindle.root_path, old_path),
140
+ File.join(Rindle.root_path, @path)
141
+
138
142
  Rindle.collections.values.each do |col|
139
143
  if col.include?(old_index)
140
144
  col.remove old_index
@@ -143,6 +147,7 @@ class Rindle
143
147
  end
144
148
 
145
149
  Rindle.index[@index] = self
150
+ true
146
151
  end
147
152
 
148
153
  def destroy!
@@ -1,3 +1,3 @@
1
1
  class Rindle
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -184,6 +184,11 @@ describe Rindle::Document do
184
184
  it 'should set the new path' do
185
185
  @doc.path.should == '/documents/Indeed a test.mobi'
186
186
  end
187
+
188
+ it 'should rename the actual file' do
189
+ File.should_not exist File.join(Rindle.root_path, '/documents/A test aswell.mobi')
190
+ File.should exist File.join(Rindle.root_path, '/documents/Indeed a test.mobi')
191
+ end
187
192
  end
188
193
 
189
194
  describe '#destroy!' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rindle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &22965600 !ruby/object:Gem::Requirement
16
+ requirement: &22838980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *22965600
24
+ version_requirements: *22838980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard-rspec
27
- requirement: &22965080 !ruby/object:Gem::Requirement
27
+ requirement: &22838480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *22965080
35
+ version_requirements: *22838480
36
36
  description: The Rindle gem provides an object-oriented way to manage kindle collection
37
37
  data.
38
38
  email:
@@ -87,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: 4157338638094343741
90
+ hash: -3997906863196200334
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 4157338638094343741
99
+ hash: -3997906863196200334
100
100
  requirements: []
101
101
  rubyforge_project:
102
102
  rubygems_version: 1.8.17