un 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/un.rb +5 -3
  3. data/un.gemspec +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d078bdacd95fd4ec259a706d8bfb3ce83778ca8b1982f58f803c31f86143035a
4
- data.tar.gz: 9e6bcbe036e2868c42fd7887ee8877115139f107d1d4ecf8103360176cb34cc6
3
+ metadata.gz: d8c8d915490e45125d7b38a47b0aeb67b28b9ab530c7fba21839a05f8343e34d
4
+ data.tar.gz: 7017890ba253218048086124b79a493885bcc6bc6441023faf1a58ec82e32075
5
5
  SHA512:
6
- metadata.gz: dc9b3b8c54478d2e04cd18042458c4d3382b6ed263ada916239591814d73f12c341ca72fb978310693b83b9dc084211fc7a772bb5636be1f938b95de2417138b
7
- data.tar.gz: c8f31f13962e5f0abc6804183fe331067553c8980866dac9e4a9dd651c3c8f43cf2584761b25f4092a901a380b534131b57675f6d4341ba1f055968de6d0e060
6
+ metadata.gz: f579ec63b6cbc2c69a29df7b4d90c897b44384a807f13714895f7505696dbe742aee8825602010e3a0aefe1a4a53cad5b2480c4e31d43c2081ea6425d1262e3f
7
+ data.tar.gz: efd61b8e25c638735bd9349eec4098ab0d5aed956b1ec6ca5fa9847a63ac9fc6625f97bc661d1d44b2ab546362c759514caa3dde6ea227cb461ccb284b7d512e
data/lib/un.rb CHANGED
@@ -79,13 +79,15 @@ end
79
79
  #
80
80
  # -p preserve file attributes if possible
81
81
  # -r copy recursively
82
+ # -l make hard link instead of copying (implies -r)
82
83
  # -v verbose
83
84
  #
84
85
 
85
86
  def cp
86
- setup("pr") do |argv, options|
87
+ setup("prl") do |argv, options|
87
88
  cmd = "cp"
88
89
  cmd += "_r" if options.delete :r
90
+ cmd = "cp_lr" if options.delete :l
89
91
  options[:preserve] = true if options.delete :p
90
92
  dest = argv.pop
91
93
  argv = argv[0] if argv.size == 1
@@ -254,7 +256,7 @@ def wait_writable
254
256
  wait = (wait = options[:w]) ? Float(wait) : 0.2
255
257
  argv.each do |file|
256
258
  begin
257
- open(file, "r+b")
259
+ File.open(file, "r+b") {}
258
260
  rescue Errno::ENOENT
259
261
  break
260
262
  rescue Errno::EACCES => e
@@ -420,7 +422,7 @@ module UN # :nodoc:
420
422
  messages = {}
421
423
  store = proc {|msg| messages[cmd] = msg}
422
424
  end
423
- open(__FILE__) do |me|
425
+ File.open(__FILE__) do |me|
424
426
  while me.gets("##\n")
425
427
  if help = me.gets("\n\n")
426
428
  if all or argv.include?(cmd = help[/^#\s*ruby\s.*-e\s+(\w+)/, 1])
data/un.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "un"
5
- spec.version = "0.2.0"
5
+ spec.version = "0.2.1"
6
6
  spec.authors = ["WATANABE Hirofumi"]
7
7
  spec.email = ["eban@ruby-lang.org"]
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - WATANABE Hirofumi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Utilities to replace common UNIX commands
14
14
  email:
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  requirements: []
51
- rubygems_version: 3.2.22
51
+ rubygems_version: 3.4.0.dev
52
52
  signing_key:
53
53
  specification_version: 4
54
54
  summary: Utilities to replace common UNIX commands