files 0.0.1 → 0.0.2
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 +5 -2
- data/lib/files.rb +4 -0
- data/lib/files/version.rb +1 -1
- data/test/files_test.rb +7 -0
- metadata +3 -3
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
require "files"
|
8
8
|
|
9
|
-
files = Files
|
9
|
+
files = Files do # creates a temporary directory inside Dir.tmpdir
|
10
10
|
file "hello.txt" # creates file "hello.txt" containing "contents of hello.txt"
|
11
11
|
dir "web" do # creates directory "web"
|
12
12
|
file "snippet.html", # creates file "web/snippet.html"...
|
@@ -18,10 +18,12 @@
|
|
18
18
|
end
|
19
19
|
end # returns a string with the path to the directory
|
20
20
|
|
21
|
+
see `test/files_test.rb` for more examples
|
22
|
+
|
21
23
|
## Details
|
22
24
|
|
23
25
|
* the directory will be removed at exit
|
24
|
-
* unless you pass `:remove => false`
|
26
|
+
* unless you pass `:remove => false`
|
25
27
|
|
26
28
|
## TODO
|
27
29
|
|
@@ -33,3 +35,4 @@
|
|
33
35
|
* symlinks (?)
|
34
36
|
* specify file mode
|
35
37
|
* copy an entire data dir
|
38
|
+
* play nice with FakeFS (possibly with a :fake option)
|
data/lib/files.rb
CHANGED
data/lib/files/version.rb
CHANGED
data/test/files_test.rb
CHANGED
@@ -28,3 +28,10 @@ assert {
|
|
28
28
|
File.read("#{dir}/web/img/other.jpg") ==
|
29
29
|
File.read("#{here}/data/cheez_doing_it_wrong.jpg")
|
30
30
|
}
|
31
|
+
|
32
|
+
dir = Files do
|
33
|
+
file "hello.txt"
|
34
|
+
dir("web") { file "hello.html" }
|
35
|
+
end
|
36
|
+
assert { File.read("#{dir}/hello.txt") == "contents of hello.txt" }
|
37
|
+
assert { File.read("#{dir}/web/hello.html") == "contents of hello.html" }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -45,7 +45,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
segments:
|
47
47
|
- 0
|
48
|
-
hash:
|
48
|
+
hash: 3051429508033972705
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
version: '0'
|
55
55
|
segments:
|
56
56
|
- 0
|
57
|
-
hash:
|
57
|
+
hash: 3051429508033972705
|
58
58
|
requirements: []
|
59
59
|
rubyforge_project: files
|
60
60
|
rubygems_version: 1.8.10
|