fspath 3.0.2 → 3.0.3

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: 4bad6a1d976a04a791ec8be82565503c0e3262d9
4
- data.tar.gz: d36e0a34a2a4d3b039e7932df9bddcfa6a110e73
3
+ metadata.gz: 26721162b01f79487fb1b452b3e00563c8c02428
4
+ data.tar.gz: c39238fa94c0decd977c58c7d54b1c6b01b2d933
5
5
  SHA512:
6
- metadata.gz: 673f88c2ee8feb4dc32fdb750f6d9429886e4230f7dcb0d2f204bc5028c8e1d277669dfea0f76b81cf307c8fd9ab593714fd5167f3ab87966d907612ed4b51a0
7
- data.tar.gz: 79021400b1af61648417a3559e33ca9303335a77fb3d728a274a525072a6adc12284558530c81ffe523d20fcf9ae249367dbf21aee4af2f2eb9027cc32ddb87a
6
+ metadata.gz: 5870e1c093ef606e6dfb714212866627208795690083e5e4a9ec2b6b8d2cd1289f8510716f150aa976f5cca9d10e7a4b4ad6a1d28c89438d5d636f8c0b8948d3
7
+ data.tar.gz: be026afeedaa9d37879a808cfa6c76fab9374c39bc240357103eb0c881de60e6c842e7d641d337abcc980dda3277556e0fa08cfc6753fc401922840a1084da73
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.0.2'
5
+ s.version = '3.0.3'
6
6
  s.summary = %q{Better than Pathname}
7
7
  s.homepage = "http://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
data/lib/fspath.rb CHANGED
@@ -47,8 +47,9 @@ class FSPath < Pathname
47
47
 
48
48
  # Returns common dir for paths
49
49
  def common_dir(*paths)
50
+ fail ArgumentError, 'At least one path is required' if paths.empty?
50
51
  paths.map do |path|
51
- new(path).ascendants.drop(1)
52
+ new(path).dirname.ascendants
52
53
  end.inject(:&).first
53
54
  end
54
55
 
data/spec/fspath_spec.rb CHANGED
@@ -49,6 +49,10 @@ describe FSPath do
49
49
  it 'returns nil if there is no common path' do
50
50
  expect(FSPath.common_dir('../a', './b')).to be_nil
51
51
  end
52
+
53
+ it 'returns nil if called without parameters' do
54
+ expect{ FSPath.common_dir }.to raise_error(ArgumentError)
55
+ end
52
56
  end
53
57
 
54
58
  describe '.temp_file' do
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.0.2
4
+ version: 3.0.3
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-02-09 00:00:00.000000000 Z
11
+ date: 2017-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project: fspath
77
- rubygems_version: 2.6.10
77
+ rubygems_version: 2.6.8
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Better than Pathname