mate 3.3.0 → 3.4.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
  SHA256:
3
- metadata.gz: '086f85d6296cda6a2f0bbf9c2b522ebc60bdc18b3f37ae6356f99001c88483d1'
4
- data.tar.gz: e5fe5e12bf8654d276e409d28b6ba565582c8a0f86ec7d369bc4b21350565967
3
+ metadata.gz: 57edcd852f4c781570e83875da708f1822a4923207e488736cd665b9a3a9c46c
4
+ data.tar.gz: 5ff71bc554ff2bf90ef20dcd52db44665f59539fa66f065ae30cc81732592acc
5
5
  SHA512:
6
- metadata.gz: 983ef85fe34b3f5145ea5143756927c007890f75996b95eaf45e855145e1c3625711462265258d94a896980b8e4b4c5a711a5a013223152648c67fe985896944
7
- data.tar.gz: dde6f73ec56a90351a6d4558b99926341ae95038278b1c4e56da215edae51b5c11da0f673510fc39015649f347884a2e5185ad4af67a2775059b9650ff84cf4c
6
+ metadata.gz: 8de1eff9270941f130fda33f04beedf547c1b419ecca5cd5362a46d995e9b05438405e94208540bfdda98d4b20d045c37c3c2865f20f1cf43918dd0bc6c9c83c
7
+ data.tar.gz: 552ef5cdf18ec815ff7a6573bd7a1ecece2e4890e071d0b54500612ad1094d47127ad81df1376de2aa91c77b6f6d993b9bc5c132f9119f9274c4112e89b18151
data/bin/tm2 CHANGED
@@ -17,8 +17,9 @@ end.order!
17
17
  args = ARGV.flat_map do |arg|
18
18
  if File.directory?(arg)
19
19
  Mate::TmProperties.create(arg, options)
20
- elsif !File.file?(arg) && (m = /\A(.*):(\d+)\z/.match(arg))
21
- %W[-l #{$2} #{$1}]
20
+ arg
21
+ elsif !File.file?(arg) && /\A(?<path>.*):(?<line>\d+)\z/ =~ arg
22
+ %W[-l #{line} #{path}]
22
23
  else
23
24
  arg
24
25
  end
@@ -16,6 +16,13 @@ module Mate
16
16
  end
17
17
 
18
18
  def save
19
+ if @file.exist?
20
+ return warn("#{@file} is not writable, skipping") unless @file.writable?
21
+ else
22
+ return warn("#{@dir} is not writable, not creating #{@file.basename}") unless @dir.writable?
23
+ return warn("#{@dir} is not traversable, not creating #{@file.basename}") unless @dir.executable?
24
+ end
25
+
19
26
  ignores = Ignores.new(@dir, @options)
20
27
 
21
28
  write(ignores.lines + @other_lines)
@@ -37,6 +44,8 @@ module Mate
37
44
  @file.open('w') do |f|
38
45
  f.puts lines
39
46
  end
47
+ rescue Errno::EISDIR, Errno::EACCES => e
48
+ warn "failed writing #{@file}: #{e}"
40
49
  end
41
50
  end
42
51
  end
data/mate.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'mate'
5
- s.version = '3.3.0'
5
+ s.version = '3.4.0'
6
6
  s.summary = %q{TextMate 2 properties builder using git ignores for exclusions}
7
7
  s.homepage = "https://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
@@ -28,7 +28,7 @@ licenses:
28
28
  - MIT
29
29
  metadata:
30
30
  bug_tracker_uri: https://github.com/toy/mate/issues
31
- documentation_uri: https://www.rubydoc.info/gems/mate/3.3.0
31
+ documentation_uri: https://www.rubydoc.info/gems/mate/3.4.0
32
32
  source_code_uri: https://github.com/toy/mate
33
33
  rdoc_options: []
34
34
  require_paths: