filetree 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +45 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +65 -0
- data/Guardfile +5 -0
- data/Rakefile +1 -0
- data/filetree.gemspec +13 -10
- data/lib/filetree.rb +10 -2
- data/lib/filetree/simple_tree.rb +2 -1
- data/spec/filetree_spec.rb +11 -0
- data/spec/spec_helper.rb +3 -0
- metadata +17 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddf6cfb9534643ce2b003839f0b320471825fbc2
|
4
|
+
data.tar.gz: 8edc86da17750bebb39991e17e4068c4ee5a3cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34aa0920cdacc98a1bf6650e72e1ad6554ac788df5e5b77229a0276f8f43277c18493a34d2883da672b4dc82127eb9d61f85d146b7c4bc9393411d063731c138
|
7
|
+
data.tar.gz: dbb5d4f94b200bc266b6bcfee082b9ce23001184ed31252b4a63ef6bdc2e0fbb5c62e75dbdb9afe8b76e6066fbbcc1103adb00ff1ce4f38bc003df8b5923050d
|
data/.gitignore
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# jeweler generated
|
12
|
+
pkg
|
13
|
+
|
14
|
+
.bundle
|
15
|
+
|
16
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
17
|
+
#
|
18
|
+
# * Create a file at ~/.gitignore
|
19
|
+
# * Include files you want ignored
|
20
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
21
|
+
#
|
22
|
+
# After doing this, these files will be ignored in all your git projects,
|
23
|
+
# saving you from having to 'pollute' every project you touch with them
|
24
|
+
#
|
25
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
26
|
+
#
|
27
|
+
# For MacOS:
|
28
|
+
#
|
29
|
+
.DS_Store
|
30
|
+
#
|
31
|
+
# For TextMate
|
32
|
+
#*.tmproj
|
33
|
+
#tmtags
|
34
|
+
#
|
35
|
+
# For emacs:
|
36
|
+
*~
|
37
|
+
\#*
|
38
|
+
.\#*
|
39
|
+
#
|
40
|
+
# For vim:
|
41
|
+
*.swp
|
42
|
+
#
|
43
|
+
# For IDEA:
|
44
|
+
.idea/
|
45
|
+
*.iml
|
data/Gemfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in rsense.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
group :linux do
|
7
|
+
gem 'libnotify'
|
8
|
+
end
|
9
|
+
|
10
|
+
group :darwin do
|
11
|
+
gem 'terminal-notifier-guard'
|
12
|
+
end
|
13
|
+
|
14
|
+
group :development do
|
15
|
+
gem 'minitest'
|
16
|
+
gem 'guard'
|
17
|
+
gem 'guard-minitest'
|
18
|
+
gem 'minitest-colorize'
|
19
|
+
gem 'pry'
|
20
|
+
gem "bundler", "~> 1.6"
|
21
|
+
gem "rake"
|
22
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
filetree (1.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
celluloid (0.15.2)
|
10
|
+
timers (~> 1.1.0)
|
11
|
+
celluloid-io (0.15.0)
|
12
|
+
celluloid (>= 0.15.0)
|
13
|
+
nio4r (>= 0.5.0)
|
14
|
+
coderay (1.1.0)
|
15
|
+
ffi (1.9.3)
|
16
|
+
formatador (0.2.4)
|
17
|
+
guard (2.6.1)
|
18
|
+
formatador (>= 0.2.4)
|
19
|
+
listen (~> 2.7)
|
20
|
+
lumberjack (~> 1.0)
|
21
|
+
pry (>= 0.9.12)
|
22
|
+
thor (>= 0.18.1)
|
23
|
+
guard-minitest (2.3.0)
|
24
|
+
guard (~> 2.0)
|
25
|
+
minitest (>= 3.0)
|
26
|
+
libnotify (0.8.2)
|
27
|
+
ffi (>= 1.0.11)
|
28
|
+
listen (2.7.4)
|
29
|
+
celluloid (>= 0.15.2)
|
30
|
+
celluloid-io (>= 0.15.0)
|
31
|
+
rb-fsevent (>= 0.9.3)
|
32
|
+
rb-inotify (>= 0.9)
|
33
|
+
lumberjack (1.0.5)
|
34
|
+
method_source (0.8.2)
|
35
|
+
minitest (5.3.3)
|
36
|
+
minitest-colorize (0.0.5)
|
37
|
+
minitest (>= 2.0)
|
38
|
+
nio4r (1.0.0)
|
39
|
+
pry (0.9.12.6)
|
40
|
+
coderay (~> 1.0)
|
41
|
+
method_source (~> 0.8)
|
42
|
+
slop (~> 3.4)
|
43
|
+
rake (10.3.1)
|
44
|
+
rb-fsevent (0.9.4)
|
45
|
+
rb-inotify (0.9.4)
|
46
|
+
ffi (>= 0.5.0)
|
47
|
+
slop (3.5.0)
|
48
|
+
terminal-notifier-guard (1.5.3)
|
49
|
+
thor (0.18.1)
|
50
|
+
timers (1.1.0)
|
51
|
+
|
52
|
+
PLATFORMS
|
53
|
+
ruby
|
54
|
+
|
55
|
+
DEPENDENCIES
|
56
|
+
bundler (~> 1.6)
|
57
|
+
filetree!
|
58
|
+
guard
|
59
|
+
guard-minitest
|
60
|
+
libnotify
|
61
|
+
minitest
|
62
|
+
minitest-colorize
|
63
|
+
pry
|
64
|
+
rake
|
65
|
+
terminal-notifier-guard
|
data/Guardfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/filetree.gemspec
CHANGED
@@ -1,19 +1,22 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'filetree'
|
4
|
+
|
1
5
|
Gem::Specification.new do |s|
|
2
6
|
s.name = 'filetree'
|
3
|
-
s.version =
|
7
|
+
s.version = FileTree::VERSION
|
4
8
|
s.date = '2013-05-27'
|
5
9
|
s.summary = "A simple ruby library for manipulating filepaths as tree structures"
|
6
10
|
s.description = "A simple tree structure for working with FilePath objects in ruby. I simply took the simple_tree module from https://github.com/ealdent/simple-tree and hacked it into Pathname (http://www.ruby-doc.org/stdlib-2.0/libdoc/pathname/rdoc/Pathname.html) from the std-lib. This means you get all the awesome features of working with Pathname, as well as making it easy to examine a filepath's ancestors and descendants."
|
7
11
|
s.authors = ["Eric West"]
|
8
|
-
s.email = '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
]
|
12
|
+
s.email = 'esw9999@gmail.com'
|
13
|
+
|
14
|
+
s.files = `git ls-files -z`.split("\x0")
|
15
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
16
19
|
s.licenses = ["BSD"]
|
17
20
|
s.homepage =
|
18
21
|
'https://github.com/edubkendo/FileTree'
|
19
|
-
end
|
22
|
+
end
|
data/lib/filetree.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "pathname"
|
2
|
-
|
2
|
+
require_relative "./filetree/simple_tree"
|
3
3
|
|
4
4
|
class Pathname
|
5
5
|
alias :_parent :parent
|
@@ -9,6 +9,8 @@ end
|
|
9
9
|
class FileTree < Pathname
|
10
10
|
include SimpleTree
|
11
11
|
|
12
|
+
VERSION = "1.0.0"
|
13
|
+
|
12
14
|
attr_accessor :name, :id, :identifier
|
13
15
|
|
14
16
|
def name
|
@@ -45,4 +47,10 @@ class FileTree < Pathname
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
|
50
|
+
#
|
51
|
+
# Joins the given pathnames onto self to create a new FileTree object.
|
52
|
+
def join(*args)
|
53
|
+
FileTree.new(super(*args))
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
data/lib/filetree/simple_tree.rb
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
# * The name of Jason M. Adams may not be used to endorse or promote products derived from this software without specific prior written permission.
|
11
11
|
#
|
12
12
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
|
+
|
13
14
|
#
|
14
15
|
# To use this interface, drop it in your current class with +include+.
|
15
16
|
# You must then simply implement the +parent+ and +children+ methods.
|
@@ -183,4 +184,4 @@ module SimpleTree
|
|
183
184
|
outp
|
184
185
|
end
|
185
186
|
|
186
|
-
end
|
187
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filetree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric West
|
@@ -15,17 +15,24 @@ description: A simple tree structure for working with FilePath objects in ruby.
|
|
15
15
|
hacked it into Pathname (http://www.ruby-doc.org/stdlib-2.0/libdoc/pathname/rdoc/Pathname.html)
|
16
16
|
from the std-lib. This means you get all the awesome features of working with Pathname,
|
17
17
|
as well as making it easy to examine a filepath's ancestors and descendants.
|
18
|
-
email:
|
18
|
+
email: esw9999@gmail.com
|
19
19
|
executables: []
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
-
-
|
24
|
-
-
|
23
|
+
- ".gitignore"
|
24
|
+
- Gemfile
|
25
|
+
- Gemfile.lock
|
26
|
+
- Guardfile
|
25
27
|
- LICENSE
|
26
28
|
- README.md
|
29
|
+
- Rakefile
|
27
30
|
- examples/simple_filetree.rb
|
28
31
|
- filetree.gemspec
|
32
|
+
- lib/filetree.rb
|
33
|
+
- lib/filetree/simple_tree.rb
|
34
|
+
- spec/filetree_spec.rb
|
35
|
+
- spec/spec_helper.rb
|
29
36
|
homepage: https://github.com/edubkendo/FileTree
|
30
37
|
licenses:
|
31
38
|
- BSD
|
@@ -36,19 +43,20 @@ require_paths:
|
|
36
43
|
- lib
|
37
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
45
|
requirements:
|
39
|
-
- -
|
46
|
+
- - ">="
|
40
47
|
- !ruby/object:Gem::Version
|
41
48
|
version: '0'
|
42
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
50
|
requirements:
|
44
|
-
- -
|
51
|
+
- - ">="
|
45
52
|
- !ruby/object:Gem::Version
|
46
53
|
version: '0'
|
47
54
|
requirements: []
|
48
55
|
rubyforge_project:
|
49
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.2.2
|
50
57
|
signing_key:
|
51
58
|
specification_version: 4
|
52
59
|
summary: A simple ruby library for manipulating filepaths as tree structures
|
53
|
-
test_files:
|
54
|
-
|
60
|
+
test_files:
|
61
|
+
- spec/filetree_spec.rb
|
62
|
+
- spec/spec_helper.rb
|