Dahistory 0.2.0 → 0.2.1
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/README.md +4 -3
- data/lib/Dahistory/version.rb +1 -1
- data/lib/Dahistory.rb +1 -0
- data/spec/tests/Dashistory.rb +15 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -20,9 +20,7 @@ Useage
|
|
20
20
|
|
21
21
|
require "Dahistory"
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
Dahistory path
|
23
|
+
Dahistory "some/file.txt"
|
26
24
|
|
27
25
|
# Checks your directory (default "./history").
|
28
26
|
# If not found there, saves copy of file in ./pending dir and
|
@@ -43,3 +41,6 @@ Override the default settings:
|
|
43
41
|
|
44
42
|
}
|
45
43
|
|
44
|
+
**Note:** Both **def Dahistory** and **class Dahistory** are defined.
|
45
|
+
All the code is in one file and less than 150 lines: [lib/Dahistory.rb](https://github.com/da99/Dahistory/blob/master/lib/Dahistory.rb)
|
46
|
+
|
data/lib/Dahistory/version.rb
CHANGED
data/lib/Dahistory.rb
CHANGED
data/spec/tests/Dashistory.rb
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
|
2
|
+
describe "Dahistory" do
|
3
|
+
|
4
|
+
it "returns a Dahistory object" do
|
5
|
+
file = "files/#{rand 1000}.txt"
|
6
|
+
target = rand(10000).to_s
|
7
|
+
chdir {
|
8
|
+
File.write file, target
|
9
|
+
File.write file.sub("files", "history"), target
|
10
|
+
o = Dahistory(file)
|
11
|
+
o.class.should.be == Object.const_get(:Dahistory)
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
end # === Dahistory
|
16
|
+
|
2
17
|
describe "Dahistory: new pending file" do
|
3
18
|
|
4
19
|
before { reset_dirs }
|