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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  require "files"
8
8
 
9
- files = Files.create do # creates a temporary directory inside Dir.tmpdir
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` to `Files.new`
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
@@ -56,3 +56,7 @@ module Files
56
56
 
57
57
  end
58
58
  end
59
+
60
+ def Files *args, &block
61
+ Files.create *args, &block
62
+ end
data/lib/files/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Files
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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: -2492696661746365680
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: -2492696661746365680
57
+ hash: 3051429508033972705
58
58
  requirements: []
59
59
  rubyforge_project: files
60
60
  rubygems_version: 1.8.10