fast 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fast/dir.rb +1 -2
- data/lib/fast/fast.rb +12 -4
- data/lib/fast/version.rb +1 -1
- data/lib/fast.rb +2 -2
- metadata +46 -73
data/lib/fast/dir.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module Fast
|
2
2
|
# Directory handling class
|
3
3
|
class Dir < Array
|
4
|
-
# .call -> like Fast::File.call -> NOUP: make delegator pattern Singleton-like
|
5
4
|
def initialize path = nil
|
6
5
|
super()
|
7
6
|
@path = normalize path if path
|
@@ -9,7 +8,7 @@ module Fast
|
|
9
8
|
|
10
9
|
# Returns a Fast::Dir list with all items in the directory, except ".." and "."
|
11
10
|
def list path = nil, &block
|
12
|
-
@path = normalize path
|
11
|
+
@path = normalize path unless path.nil?
|
13
12
|
::Dir.foreach @path do |entry|
|
14
13
|
unless entry == "." or entry == ".."
|
15
14
|
self << entry
|
data/lib/fast/fast.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
module Fast
|
2
2
|
# Returns a Dir with the file list already called (if a path is provided)
|
3
3
|
def self.dir path = nil
|
4
|
-
|
5
|
-
|
4
|
+
unless path.nil?
|
5
|
+
the_dir = Fast::Dir.new path
|
6
|
+
the_dir.list
|
7
|
+
else
|
8
|
+
Fast::Dir.new
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
12
|
# Like `dir`, but creates the directory if it does not exist
|
@@ -12,8 +16,12 @@ module Fast
|
|
12
16
|
|
13
17
|
# Returns a File with its content (if a path to a valid file is provided)
|
14
18
|
def self.file path = nil
|
15
|
-
|
16
|
-
|
19
|
+
if path
|
20
|
+
the_file = Fast::File.new path
|
21
|
+
the_file.read
|
22
|
+
else
|
23
|
+
Fast::File.new
|
24
|
+
end
|
17
25
|
end
|
18
26
|
|
19
27
|
# Returns a File, and creates it if is does not exist
|
data/lib/fast/version.rb
CHANGED
data/lib/fast.rb
CHANGED
metadata
CHANGED
@@ -1,74 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 6
|
10
|
-
version: 0.0.6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Xavier Via
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-11-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: metafun
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &9891740 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rspec
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: *9891740
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &9891160 !ruby/object:Gem::Requirement
|
38
28
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
46
33
|
type: :development
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: zucker
|
50
34
|
prerelease: false
|
51
|
-
|
35
|
+
version_requirements: *9891160
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: zucker
|
38
|
+
requirement: &9890580 !ruby/object:Gem::Requirement
|
52
39
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
60
44
|
type: :development
|
61
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *9890580
|
62
47
|
description: DSL for file system interaction
|
63
|
-
email:
|
48
|
+
email:
|
64
49
|
- xavierviacanel@gmail.com
|
65
50
|
executables: []
|
66
|
-
|
67
51
|
extensions: []
|
68
|
-
|
69
52
|
extra_rdoc_files: []
|
70
|
-
|
71
|
-
files:
|
53
|
+
files:
|
72
54
|
- .gitignore
|
73
55
|
- Gemfile
|
74
56
|
- README.rdoc
|
@@ -85,38 +67,29 @@ files:
|
|
85
67
|
- spec/fast/dir_spec.rb
|
86
68
|
- spec/fast/fast_spec.rb
|
87
69
|
- spec/fast/file_spec.rb
|
88
|
-
homepage:
|
70
|
+
homepage: ''
|
89
71
|
licenses: []
|
90
|
-
|
91
72
|
post_install_message:
|
92
73
|
rdoc_options: []
|
93
|
-
|
94
|
-
require_paths:
|
74
|
+
require_paths:
|
95
75
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
77
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
|
103
|
-
- 0
|
104
|
-
version: "0"
|
105
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
83
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
version: "0"
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
114
88
|
requirements: []
|
115
|
-
|
116
89
|
rubyforge_project: fast
|
117
|
-
rubygems_version: 1.8.
|
90
|
+
rubygems_version: 1.8.10
|
118
91
|
signing_key:
|
119
92
|
specification_version: 3
|
120
93
|
summary: DSL for file system interaction
|
121
94
|
test_files: []
|
122
|
-
|
95
|
+
has_rdoc:
|