fspath 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 24453324aa20066ac43d90e423d410d039b3a6c5
4
- data.tar.gz: ada2095a627c2435835da929aa502d68d73f3873
2
+ SHA256:
3
+ metadata.gz: f7fba619fd6872e5b2a0e2cc5d86b6dff13eb70c708ea34aa5c23f393543aaad
4
+ data.tar.gz: 8a72a6294ba51d2ed8c1c69869a395779dff59543cf9a6ce8a4f73d163eb5bf5
5
5
  SHA512:
6
- metadata.gz: 6504c1b0e7e3e17d41938bc77a8c90f0736bacbcbf7ce004fcb70a17ab030c751d58031177d1cc5010c5d401424282e5a2bd0f9f0f5ef080affa69576cdd37a8
7
- data.tar.gz: eb41f49e89b0f9d4b41501aca5b2752597cea4014dec67f7e126479e7f3f4c8c83539091773e276e3d286f80eaefdbc94f5da75e7d90b524543ca162371dc953
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
- Lint/EndAlignment:
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
- MaxLineLength: 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/TrailingCommaInLiteral:
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.6'
11
- - '2.3.3'
12
- - '2.4.0'
13
- - 'jruby-1.7.26'
14
- - 'jruby-9.0.5.0'
15
- - 'jruby-9.1.5.0'
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.4.0'
22
+ rvm: '2.6.3'
21
23
  script: bundle exec rubocop
22
24
  - env: CHECK_RUBIES=✓
23
- rvm: '2.4.0'
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 RUBY_VERSION >= '2.0'
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2017 Ivan Kuchin
1
+ Copyright (c) 2010-2019 Ivan Kuchin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.markdown CHANGED
@@ -1,8 +1,8 @@
1
1
  [![Gem Version](https://img.shields.io/gem/v/fspath.svg?style=flat)](https://rubygems.org/gems/fspath)
2
2
  [![Build Status](https://img.shields.io/travis/toy/fspath/master.svg?style=flat)](https://travis-ci.org/toy/fspath)
3
3
  [![AppVeyor Status](https://img.shields.io/appveyor/ci/toy/fspath/master.svg?style=flat&label=windows)](https://ci.appveyor.com/project/toy/fspath)
4
- [![Code Climate](https://img.shields.io/codeclimate/github/toy/fspath.svg?style=flat)](https://codeclimate.com/github/toy/fspath)
5
- [![Dependency Status](https://img.shields.io/gemnasium/toy/fspath.svg?style=flat)](https://gemnasium.com/toy/fspath)
4
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/fspath.svg?style=flat)](https://codeclimate.com/github/toy/fspath)
5
+ [![Depfu](https://badges.depfu.com/badges/713ede61b82ee98a3e86a374b5278d28/overview.svg)](https://depfu.com/github/toy/image_optim_rails)
6
6
  [![Inch CI](https://inch-ci.org/github/toy/fspath.svg?branch=master&style=flat)](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-2017 Ivan Kuchin. See LICENSE.txt for details.
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.0'
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.0'
20
- s.add_development_dependency 'rubocop', '~> 0.47'
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fspath'
2
4
 
3
5
  describe FSPath do
@@ -8,7 +10,7 @@ describe FSPath do
8
10
  File.symlink '', ''
9
11
  rescue NotImplementedError, Errno::EACCES
10
12
  false
11
- rescue
13
+ rescue Errno::ENOENT
12
14
  true
13
15
  end
14
16
 
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.0
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: 2017-03-19 00:00:00.000000000 Z
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.47'
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.47'
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
- rubyforge_project: fspath
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