fspath 3.1.0 → 3.1.1
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 +5 -5
- data/.appveyor.yml +11 -1
- data/.rubocop.yml +29 -32
- data/.travis.yml +12 -10
- data/Gemfile +5 -1
- data/LICENSE.txt +1 -1
- data/README.markdown +3 -3
- data/fspath.gemspec +9 -3
- data/lib/fspath.rb +8 -2
- data/spec/fspath_spec.rb +3 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f7fba619fd6872e5b2a0e2cc5d86b6dff13eb70c708ea34aa5c23f393543aaad
|
4
|
+
data.tar.gz: 8a72a6294ba51d2ed8c1c69869a395779dff59543cf9a6ce8a4f73d163eb5bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a617488913a32266b8f34c169c5d1a7eb7f1339ff344a52dfd0e74b2ab4af177d0578cfc9ce780d3e1e904ffb8e4b528db8c01757bab645000d7584f7b04693
|
7
|
+
data.tar.gz: e6ebe011147e831b4b101a347be150ffd32f9e8ed91462a35f6893dcac3ced5dc5880acd6e0bc651dbd1f6b0d4a08e291cd0303a1fa3e87c6a34b9c3eba388fe
|
data/.appveyor.yml
CHANGED
@@ -1,14 +1,24 @@
|
|
1
1
|
version: '{build}-{branch}'
|
2
2
|
install:
|
3
|
+
- set PATH=C:\Ruby25-x64\bin;%PATH%
|
4
|
+
- ruby --version
|
5
|
+
- gem --version
|
6
|
+
- bundle package --all
|
3
7
|
build: off
|
4
8
|
test_script:
|
5
9
|
- ps: |
|
6
10
|
$path = $env:Path
|
7
11
|
$rubypaths = ls -Path C:\Ruby*\bin
|
8
12
|
foreach ($rubypath in $rubypaths) {
|
9
|
-
echo "################################################################################"
|
10
13
|
$env:Path = "$rubypath;" + $path
|
14
|
+
ruby -e "abort unless RUBY_VERSION > '2.3'"
|
15
|
+
if ($LASTEXITCODE -gt 0) {
|
16
|
+
continue
|
17
|
+
}
|
18
|
+
|
19
|
+
echo "################################ $rubypath ################################"
|
11
20
|
ruby --version
|
21
|
+
gem --version
|
12
22
|
bundle package --all
|
13
23
|
bundle install --local -j4
|
14
24
|
bundle exec rspec
|
data/.rubocop.yml
CHANGED
@@ -2,9 +2,32 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- '*.gemspec'
|
4
4
|
|
5
|
-
|
5
|
+
Layout/AccessModifierIndentation:
|
6
|
+
EnforcedStyle: outdent
|
7
|
+
|
8
|
+
Layout/CaseIndentation:
|
9
|
+
EnforcedStyle: end
|
10
|
+
|
11
|
+
Layout/DotPosition:
|
12
|
+
EnforcedStyle: trailing
|
13
|
+
|
14
|
+
Layout/EndAlignment:
|
6
15
|
EnforcedStyleAlignWith: variable
|
7
16
|
|
17
|
+
Layout/IndentFirstHashElement:
|
18
|
+
EnforcedStyle: consistent
|
19
|
+
|
20
|
+
Layout/SpaceBeforeBlockBraces:
|
21
|
+
EnforcedStyle: no_space
|
22
|
+
EnforcedStyleForEmptyBraces: no_space
|
23
|
+
|
24
|
+
Layout/SpaceInsideHashLiteralBraces:
|
25
|
+
EnforcedStyle: no_space
|
26
|
+
|
27
|
+
Lint/AmbiguousBlockAssociation:
|
28
|
+
Exclude:
|
29
|
+
- spec/**/*_spec.rb
|
30
|
+
|
8
31
|
Metrics/BlockLength:
|
9
32
|
Exclude:
|
10
33
|
- spec/**/*_spec.rb
|
@@ -15,59 +38,33 @@ Metrics/ClassLength:
|
|
15
38
|
Metrics/MethodLength:
|
16
39
|
Max: 15
|
17
40
|
|
18
|
-
Style/AccessModifierIndentation:
|
19
|
-
EnforcedStyle: outdent
|
20
|
-
|
21
41
|
Style/BracesAroundHashParameters:
|
22
42
|
Enabled: false
|
23
43
|
|
24
|
-
Style/CaseIndentation:
|
25
|
-
EnforcedStyle: end
|
26
|
-
|
27
|
-
Style/DotPosition:
|
28
|
-
EnforcedStyle: trailing
|
29
|
-
|
30
44
|
Style/DoubleNegation:
|
31
45
|
Enabled: false
|
32
46
|
|
33
|
-
Style/Encoding:
|
34
|
-
EnforcedStyle: when_needed
|
35
|
-
|
36
47
|
Style/HashSyntax:
|
37
48
|
EnforcedStyle: hash_rockets
|
38
49
|
|
39
50
|
Style/IfUnlessModifier:
|
40
|
-
|
41
|
-
|
42
|
-
Style/IndentHash:
|
43
|
-
EnforcedStyle: consistent
|
51
|
+
Enabled: false
|
44
52
|
|
45
53
|
Style/MultilineIfModifier:
|
46
54
|
Exclude:
|
47
55
|
- spec/**/*_spec.rb
|
48
56
|
|
49
|
-
Style/OpMethod: # leave name in `def ~(name = nil)`
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
Style/PercentLiteralDelimiters:
|
53
|
-
PreferredDelimiters:
|
54
|
-
'%w': '[]'
|
55
|
-
'%W': '[]'
|
56
|
-
|
57
57
|
Style/Semicolon:
|
58
58
|
AllowAsExpressionSeparator: true
|
59
59
|
|
60
60
|
Style/SignalException:
|
61
61
|
EnforcedStyle: semantic
|
62
62
|
|
63
|
-
Style/SpaceBeforeBlockBraces:
|
64
|
-
EnforcedStyle: no_space
|
65
|
-
|
66
|
-
Style/SpaceInsideHashLiteralBraces:
|
67
|
-
EnforcedStyle: no_space
|
68
|
-
|
69
63
|
Style/TrailingCommaInArguments:
|
70
64
|
EnforcedStyleForMultiline: no_comma
|
71
65
|
|
72
|
-
Style/
|
66
|
+
Style/TrailingCommaInArrayLiteral:
|
67
|
+
EnforcedStyleForMultiline: comma
|
68
|
+
|
69
|
+
Style/TrailingCommaInHashLiteral:
|
73
70
|
EnforcedStyleForMultiline: comma
|
data/.travis.yml
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
-
before_install:
|
4
|
-
- if [[ $TRAVIS_RUBY_VERSION =~ ^2\.[34] ]]; then gem update --system; fi
|
5
3
|
rvm:
|
6
4
|
- '1.8.7-p371'
|
7
5
|
- '1.9.3-p551'
|
8
6
|
- '2.0.0-p648'
|
9
7
|
- '2.1.10'
|
10
|
-
- '2.2.
|
11
|
-
- '2.3.
|
12
|
-
- '2.4.
|
13
|
-
- '
|
14
|
-
- '
|
15
|
-
- 'jruby-9.1.
|
8
|
+
- '2.2.10'
|
9
|
+
- '2.3.8'
|
10
|
+
- '2.4.6'
|
11
|
+
- '2.5.5'
|
12
|
+
- '2.6.3'
|
13
|
+
- 'jruby-9.1.9.0'
|
14
|
+
before_install:
|
15
|
+
- gem install rubygems-update || gem install rubygems-update --version '< 3'
|
16
|
+
- gem update --system
|
17
|
+
- gem install bundler || gem install bundler --version '< 2'
|
16
18
|
script: bundle exec rspec
|
17
19
|
matrix:
|
18
20
|
include:
|
19
21
|
- env: RUBOCOP=✓
|
20
|
-
rvm: '2.
|
22
|
+
rvm: '2.6.3'
|
21
23
|
script: bundle exec rubocop
|
22
24
|
- env: CHECK_RUBIES=✓
|
23
|
-
rvm: '2.
|
25
|
+
rvm: '2.6.3'
|
24
26
|
script: bundle exec travis_check_rubies
|
data/Gemfile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
5
|
-
if
|
7
|
+
if ENV['CHECK_RUBIES']
|
6
8
|
gem 'travis_check_rubies', '~> 0.2'
|
7
9
|
end
|
10
|
+
|
11
|
+
gem 'rspec-expectations', '!= 3.8.3' # https://github.com/rspec/rspec-expectations/issues/1113
|
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
[](https://rubygems.org/gems/fspath)
|
2
2
|
[](https://travis-ci.org/toy/fspath)
|
3
3
|
[](https://ci.appveyor.com/project/toy/fspath)
|
4
|
-
[](https://codeclimate.com/github/toy/fspath)
|
5
|
+
[](https://depfu.com/github/toy/image_optim_rails)
|
6
6
|
[](https://inch-ci.org/github/toy/fspath)
|
7
7
|
|
8
8
|
# fspath
|
@@ -90,4 +90,4 @@ Basename and extension:
|
|
90
90
|
|
91
91
|
## Copyright
|
92
92
|
|
93
|
-
Copyright (c) 2010-
|
93
|
+
Copyright (c) 2010-2019 Ivan Kuchin. See LICENSE.txt for details.
|
data/fspath.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'fspath'
|
5
|
-
s.version = '3.1.
|
5
|
+
s.version = '3.1.1'
|
6
6
|
s.summary = %q{Better than Pathname}
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
@@ -10,13 +10,19 @@ Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
s.rubyforge_project = s.name
|
12
12
|
|
13
|
+
s.metadata = {
|
14
|
+
'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
|
15
|
+
'documentation_uri' => "https://www.rubydoc.info/gems/#{s.name}/#{s.version}",
|
16
|
+
'source_code_uri' => "https://github.com/toy/#{s.name}",
|
17
|
+
}
|
18
|
+
|
13
19
|
s.files = `git ls-files`.split("\n")
|
14
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
22
|
s.require_paths = %w[lib]
|
17
23
|
|
18
24
|
s.add_development_dependency 'rspec', '~> 3.0'
|
19
|
-
if RUBY_VERSION >= '2.
|
20
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
25
|
+
if RUBY_VERSION >= '2.2' && !Gem.win_platform?
|
26
|
+
s.add_development_dependency 'rubocop', '~> 0.59'
|
21
27
|
end
|
22
28
|
end
|
data/lib/fspath.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pathname'
|
2
4
|
require 'tempfile'
|
3
5
|
require 'tmpdir'
|
@@ -12,6 +14,7 @@ class FSPath < Pathname
|
|
12
14
|
unless path_klass.is_a?(Class)
|
13
15
|
fail ArgumentError, "#{path_klass.inspect} is not a class"
|
14
16
|
end
|
17
|
+
|
15
18
|
@path_klass = path_klass
|
16
19
|
super(*args)
|
17
20
|
end
|
@@ -48,6 +51,7 @@ class FSPath < Pathname
|
|
48
51
|
# Returns common dir for paths
|
49
52
|
def common_dir(*paths)
|
50
53
|
fail ArgumentError, 'At least one path is required' if paths.empty?
|
54
|
+
|
51
55
|
paths.map do |path|
|
52
56
|
new(path).dirname.ascendants
|
53
57
|
end.inject(:&).first
|
@@ -198,6 +202,7 @@ class FSPath < Pathname
|
|
198
202
|
while (r = chop_basename(path))
|
199
203
|
path = r.first
|
200
204
|
break if path.empty?
|
205
|
+
|
201
206
|
paths << self.class.new(del_trailing_separator(path))
|
202
207
|
end
|
203
208
|
paths
|
@@ -336,7 +341,7 @@ private
|
|
336
341
|
Fcntl::O_CREAT | Fcntl::O_WRONLY | Fcntl::O_TRUNC
|
337
342
|
end
|
338
343
|
|
339
|
-
open(mode) do |f|
|
344
|
+
File.open(@path, mode) do |f|
|
340
345
|
f.binmode if binmode
|
341
346
|
f.seek(offset) if offset
|
342
347
|
f.write(data)
|
@@ -346,9 +351,10 @@ end
|
|
346
351
|
|
347
352
|
# Add FSPath method as alias to FSPath.new
|
348
353
|
module Kernel
|
354
|
+
private # rubocop:disable Layout/IndentationWidth
|
355
|
+
|
349
356
|
# FSPath(path) method
|
350
357
|
define_method :FSPath do |path|
|
351
358
|
FSPath.new(path)
|
352
359
|
end
|
353
|
-
private :FSPath
|
354
360
|
end
|
data/spec/fspath_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fspath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Kuchin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.59'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.59'
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
executables: []
|
@@ -57,7 +57,10 @@ files:
|
|
57
57
|
homepage: http://github.com/toy/fspath
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
|
-
metadata:
|
60
|
+
metadata:
|
61
|
+
bug_tracker_uri: https://github.com/toy/fspath/issues
|
62
|
+
documentation_uri: https://www.rubydoc.info/gems/fspath/3.1.1
|
63
|
+
source_code_uri: https://github.com/toy/fspath
|
61
64
|
post_install_message:
|
62
65
|
rdoc_options: []
|
63
66
|
require_paths:
|
@@ -73,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
76
|
- !ruby/object:Gem::Version
|
74
77
|
version: '0'
|
75
78
|
requirements: []
|
76
|
-
|
77
|
-
rubygems_version: 2.6.10
|
79
|
+
rubygems_version: 3.0.3
|
78
80
|
signing_key:
|
79
81
|
specification_version: 4
|
80
82
|
summary: Better than Pathname
|