pathutil 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pathutil.rb +4 -4
- data/lib/pathutil/helpers.rb +16 -2
- data/lib/pathutil/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0296ccfb61a8b376943ff027b07020ae2aa277
|
4
|
+
data.tar.gz: 9dc9b709a51f21fb3fa0f9a2ea8830f85b88b4d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d87dce8eb3753bbe1758b128f91ed1316aa15eb5dfe5ccc93351cc097205eac31fbf29ec43472e3e87704b06e7e863a1283575be6b0c5050eb88096212b171
|
7
|
+
data.tar.gz: ba0fcc18801dc104621d3149df0fcc370ebfef24b471384071b5badb6b189bdb6a5ad82a6ffebd0504d065c5b83ccfc175669d617b861d66f1d651f1d6eb99a7
|
data/lib/pathutil.rb
CHANGED
@@ -695,6 +695,10 @@ class Pathutil
|
|
695
695
|
|
696
696
|
# --------------------------------------------------------------------------
|
697
697
|
|
698
|
+
rb_delegate :chmod, :to => :File, :args => { :after => :@path }
|
699
|
+
rb_delegate :lchown, :to => :File, :args => { :after => :@path }
|
700
|
+
rb_delegate :lchmod, :to => :File, :args => { :after => :@path }
|
701
|
+
rb_delegate :chown, :to => :File, :args => { :after => :@path }
|
698
702
|
rb_delegate :basename, :to => :File, :args => :@path, :wrap => true
|
699
703
|
rb_delegate :dirname, :to => :File, :args => :@path, :wrap => true
|
700
704
|
rb_delegate :readlink, :to => :File, :args => :@path, :wrap => true
|
@@ -706,21 +710,17 @@ class Pathutil
|
|
706
710
|
rb_delegate :size, :to => :File, :args => :@path
|
707
711
|
rb_delegate :link, :to => :File, :args => :@path
|
708
712
|
rb_delegate :atime, :to => :File, :args => :@path
|
709
|
-
rb_delegate :chown, :to => :File, :args => :@path
|
710
713
|
rb_delegate :ctime, :to => :File, :args => :@path
|
711
714
|
rb_delegate :lstat, :to => :File, :args => :@path
|
712
715
|
rb_delegate :utime, :to => :File, :args => :@path
|
713
|
-
rb_delegate :lchmod, :to => :File, :args => :@path
|
714
716
|
rb_delegate :sysopen, :to => :File, :args => :@path
|
715
717
|
rb_delegate :birthtime, :to => :File, :args => :@path
|
716
718
|
rb_delegate :mountpoint?, :to => :File, :args => :@path
|
717
719
|
rb_delegate :truncate, :to => :File, :args => :@path
|
718
720
|
rb_delegate :symlink, :to => :File, :args => :@path
|
719
721
|
rb_delegate :extname, :to => :File, :args => :@path
|
720
|
-
rb_delegate :lchown, :to => :File, :args => :@path
|
721
722
|
rb_delegate :zero?, :to => :File, :args => :@path
|
722
723
|
rb_delegate :ftype, :to => :File, :args => :@path
|
723
|
-
rb_delegate :chmod, :to => :File, :args => :@path
|
724
724
|
rb_delegate :mtime, :to => :File, :args => :@path
|
725
725
|
rb_delegate :open, :to => :File, :args => :@path
|
726
726
|
rb_delegate :stat, :to => :File, :args => :@path
|
data/lib/pathutil/helpers.rb
CHANGED
@@ -2,14 +2,28 @@ class Pathutil
|
|
2
2
|
module Helpers
|
3
3
|
extend self
|
4
4
|
|
5
|
+
# ------------------------------------------------------------------------
|
6
|
+
|
7
|
+
def allowed
|
8
|
+
return @allowed ||= begin
|
9
|
+
{
|
10
|
+
:yaml => {
|
11
|
+
:classes => [],
|
12
|
+
:symbols => []
|
13
|
+
}
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
5
18
|
# ------------------------------------------------------------------------
|
6
19
|
# Wraps around YAML and SafeYAML to provide alternatives to Rubies.
|
7
20
|
# Note: We default aliases to yes so we can detect if you explicit true.
|
8
21
|
# ------------------------------------------------------------------------
|
9
22
|
|
10
|
-
def load_yaml(data, safe: true, whitelist_classes: []
|
11
|
-
|
23
|
+
def load_yaml(data, safe: true, whitelist_classes: self.allowed[:yaml][:classes], \
|
24
|
+
whitelist_symbols: self.allowed[:yaml][:symbols], aliases: :yes)
|
12
25
|
|
26
|
+
require "yaml"
|
13
27
|
unless safe
|
14
28
|
return YAML.load(
|
15
29
|
data
|
data/lib/pathutil/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pathutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordon Bedwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forwardable-extended
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.6'
|
27
27
|
description: Like Pathname but a little less insane.
|
28
28
|
email:
|
29
29
|
- jordon@envygeeks.io
|