utils 0.0.98 → 0.0.99

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: e8aba9ff08875a4c4f0e5a6adbc33fa33e144ee0
4
- data.tar.gz: 23903ed4b48c0e49c792f3742bb9a12290187116
3
+ metadata.gz: 67939ce99b900f52e390e0a417750092cc04877f
4
+ data.tar.gz: acfd86203297a5c4a7e2a216035d37c34c0b2457
5
5
  SHA512:
6
- metadata.gz: 9841a84dc148b4b4b4128921a99bcf7a4df1c0231e60dca6fbc4b50ec91b86c03ba8b301232fc8089ec9c70619276d12e927a70735597b21ee434f5ed7d15caf
7
- data.tar.gz: 24a4cda691688b31e4fb0c42b3b24c18b51e68c96533ba9bcbe2f9ebcb47190a0af7df0139f2660f1a97815073f54531808ab8b367697cd562bffda01d4896da
6
+ metadata.gz: 76e4fa870b13bce0fe920dea5516c57ad42b1e9a8f5ac0e27e74193c6b269d9e7e62abf3091b925348bb940a65b88b41bb6ea29d13635358fa695c6951a78efe
7
+ data.tar.gz: 090fcc6f5f80202a1225abef6f87103a67acc17b9173742a72012403d975cc69a7f6735ac743e9b3368835d596c369000e304ce80465e37b0c5b5333ce58b1bf
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.98
1
+ 0.0.99
@@ -32,33 +32,41 @@ end
32
32
  args = go 'I:h'
33
33
  args['h'] and usage
34
34
 
35
- paths = ARGV.empty? ? %w[.] : ARGV
36
- paths = paths.map { |p| File.expand_path(p) }
35
+ unless ARGV.empty?
36
+ paths = ARGV.map { |p| File.expand_path(p) }
37
+ end
37
38
 
38
39
  suffix = args['I'].ask_and_send(:split, /[\s,]+/).to_a
39
40
 
40
41
  config = Utils::Config::ConfigFile.new
41
42
  config.configure_from_paths
42
43
 
43
- find(*(paths + [ { :suffix => suffix} ])) do |filename|
44
- bn, s = File.basename(filename), File.stat(filename)
45
- s.symlink? and next
46
- if s.directory?
47
- config.strip_spaces.prune?(bn) and prune
48
- next
49
- end
50
- s.file? or next
51
- config.strip_spaces.skip?(bn) and next
52
- File.ascii?(filename) or next
53
- STDOUT.puts "Stripping spaces from #{filename.inspect}."
54
- secure_write(filename) do |output|
55
- File.open(filename) do |file|
56
- old_mode = file.stat.mode
57
- file.each do |line|
58
- line.gsub!(/[ \t\v]+$/, '')
59
- output.write line
44
+ if paths
45
+ find(*(paths + [ { :suffix => suffix} ])) do |filename|
46
+ bn, s = File.basename(filename), File.stat(filename)
47
+ s.symlink? and next
48
+ if s.directory?
49
+ config.strip_spaces.prune?(bn) and prune
50
+ next
51
+ end
52
+ s.file? or next
53
+ config.strip_spaces.skip?(bn) and next
54
+ File.ascii?(filename) or next
55
+ STDOUT.puts "Stripping spaces from #{filename.inspect}."
56
+ secure_write(filename) do |output|
57
+ File.open(filename) do |file|
58
+ old_mode = file.stat.mode
59
+ file.each do |line|
60
+ line.gsub!(/[ \t\v]+$/, '')
61
+ output.write line
62
+ end
63
+ File.chmod old_mode, output.path
60
64
  end
61
- File.chmod old_mode, output.path
62
65
  end
63
66
  end
67
+ else
68
+ for line in STDIN
69
+ line.gsub!(/[ \t\v]+$/, '')
70
+ STDOUT.write line
71
+ end
64
72
  end
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.0.98'
3
+ VERSION = '0.0.99'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.0.98 ruby lib
2
+ # stub: utils 0.0.99 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils"
6
- s.version = "0.0.98"
6
+ s.version = "0.0.99"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Florian Frank"]
10
- s.date = "2013-10-01"
10
+ s.date = "2013-10-09"
11
11
  s.description = "This ruby gem provides some useful command line utilities"
12
12
  s.email = "flori@ping.de"
13
13
  s.executables = ["brakeman2err", "chroot-exec", "chroot-libs", "classify", "create_tags", "discover", "edit", "edit_wait", "enum", "errf", "git-empty", "irb_connect", "myex", "number_files", "on_change", "path", "probe", "remote_copy", "same_files", "search", "sedit", "ssh-tunnel", "strip_spaces", "unquarantine_apps", "untest", "utils-install-config", "utils-utilsrc", "vacuum_firefox_sqlite", "xmp"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.98
4
+ version: 0.0.99
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2013-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar