pathutil 0.6.0 → 0.7.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0379be022c3075e3a84b161087c637460dadf4d
4
- data.tar.gz: 835f3036a786ac0096522886b66f11d9b5584e66
3
+ metadata.gz: 6b0296ccfb61a8b376943ff027b07020ae2aa277
4
+ data.tar.gz: 9dc9b709a51f21fb3fa0f9a2ea8830f85b88b4d7
5
5
  SHA512:
6
- metadata.gz: f2e6321fbcbb23807bc9de1a166c20a3566d481c39240ae48aa6d898834f8d17aeefd206e624061ea0a2d514ad3b688374b9b566c4c348b1dfa9f5a67384c6c0
7
- data.tar.gz: be5897bdcdf38edf0494f4dadb9963345c33cb40aa10f73807861702d593660afa74b7352169695ec6e68e6ecf3ee4bee6aedef674524fca80bc33c12a55eef8
6
+ metadata.gz: e0d87dce8eb3753bbe1758b128f91ed1316aa15eb5dfe5ccc93351cc097205eac31fbf29ec43472e3e87704b06e7e863a1283575be6b0c5050eb88096212b171
7
+ data.tar.gz: ba0fcc18801dc104621d3149df0fcc370ebfef24b471384071b5badb6b189bdb6a5ad82a6ffebd0504d065c5b83ccfc175669d617b861d66f1d651f1d6eb99a7
@@ -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
@@ -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: [], whitelist_symbols: [], aliases: :yes)
11
- require "yaml"
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
@@ -5,5 +5,5 @@
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
7
  class Pathutil
8
- VERSION = "0.6.0"
8
+ VERSION = "0.7.0"
9
9
  end
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.6.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-03-19 00:00:00.000000000 Z
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.5'
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.5'
26
+ version: '2.6'
27
27
  description: Like Pathname but a little less insane.
28
28
  email:
29
29
  - jordon@envygeeks.io