utils 0.0.40 → 0.0.41

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.40
1
+ 0.0.41
data/bin/probe CHANGED
@@ -48,6 +48,13 @@ when :rspec
48
48
  cmd "rspec", '-I', $config.probe.include_dirs_argument, '-l', linenumber,
49
49
  *args, *testrunner_args
50
50
  else
51
+ args = args.map do |a|
52
+ if Utils::Editor::FILE_LINENUMBER_REGEXP =~ a
53
+ $~.captures * ':'
54
+ else
55
+ a
56
+ end
57
+ end
51
58
  cmd "rspec", '-I', $config.probe.include_dirs_argument, *args, *testrunner_args
52
59
  end
53
60
  when :'test-unit'
data/bin/strip_spaces CHANGED
@@ -20,6 +20,7 @@ stripped.
20
20
 
21
21
  Options are
22
22
 
23
+ -I SUFFIXES list of suffixes
23
24
  -h display this help
24
25
 
25
26
  Version is #{File.basename($0)} #{Utils::VERSION}.
@@ -27,16 +28,18 @@ Version is #{File.basename($0)} #{Utils::VERSION}.
27
28
  exit 1
28
29
  end
29
30
 
30
- args = go 'h'
31
+ args = go 'I:h'
31
32
  args['h'] and usage
32
33
 
33
34
  pathes = ARGV.empty? ? %w[.] : ARGV
34
35
  pathes = pathes.map { |p| File.expand_path(p) }
35
36
 
37
+ suffix = args['I'].ask_and_send(:split, /[\s,]+/).to_a
38
+
36
39
  config = Utils::Config::ConfigFile.new
37
40
  config.parse_config_file File.expand_path('~/.utilsrc')
38
41
 
39
- find(*pathes) do |filename|
42
+ find(*pathes, :suffix => suffix) do |filename|
40
43
  bn, s = File.basename(filename), File.stat(filename)
41
44
  s.symlink? and next
42
45
  if s.directory?
data/lib/utils/find.rb CHANGED
@@ -11,9 +11,9 @@ module Utils
11
11
  begin
12
12
  file = @finder.get_file(self)
13
13
  if file
14
- file.closed? and file.reopen
14
+ file.closed? and file.reopen(file.path, 'rb')
15
15
  else
16
- file = File.new(self)
16
+ file = File.new(self, 'rb')
17
17
  @finder.add_file self, file
18
18
  end
19
19
  return file
data/lib/utils/finder.rb CHANGED
@@ -52,7 +52,8 @@ class Utils::Finder
52
52
 
53
53
  def search
54
54
  pathes = []
55
- find(*@roots) do |filename|
55
+ suffixes = @args['I'].ask_and_send(:split, /[\s,]+/).to_a
56
+ find(*@roots, suffix: suffixes) do |filename|
56
57
  begin
57
58
  bn, s = filename.pathname.basename, filename.stat
58
59
  if s.directory? && @config.discover.prune?(bn)
@@ -70,11 +71,7 @@ class Utils::Finder
70
71
  end
71
72
  pathes.uniq!
72
73
  pathes.map! { |p| a = File.split(p) ; a.unshift(p) ; a }
73
- @suffixes = @args['I'].ask_and_send(:split, /[\s,]+/).to_a
74
74
  pathes = pathes.map! do |path, dir, file|
75
- if @suffixes.full?
76
- @suffixes.include?(path.suffix) or next
77
- end
78
75
  if do_match = attempt_match?(path) and $DEBUG
79
76
  warn "Attempt match of #{path.inspect}"
80
77
  end
data/lib/utils/grepper.rb CHANGED
@@ -148,12 +148,10 @@ class Utils::Grepper
148
148
  end
149
149
 
150
150
  def search
151
- @suffixes = @args['I'].ask_and_send(:split, /[\s,]+/).to_a
151
+ suffixes = @args['I'].ask_and_send(:split, /[\s,]+/).to_a
152
152
  for dir in @roots
153
- find(dir) do |filename|
154
- if @suffixes.empty? || @suffixes.include?(filename.suffix)
155
- match(filename)
156
- end
153
+ find(dir, suffix: suffixes) do |filename|
154
+ match(filename)
157
155
  end
158
156
  end
159
157
  if @args['L'] or @args['e']
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.0.40'
3
+ VERSION = '0.0.41'
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:
data/utils.gemspec CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "utils"
5
- s.version = "0.0.40"
5
+ s.version = "0.0.41"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Florian Frank"]
9
- s.date = "2012-04-16"
9
+ s.date = "2012-04-17"
10
10
  s.description = "This ruby gem provides some useful command line utilities"
11
11
  s.email = "flori@ping.de"
12
- s.executables = ["chroot-exec", "chroot-libs", "classify", "discover", "edit", "edit_wait", "enum", "errf", "git-empty", "myex", "number_files", "path", "probe", "same_files", "search", "sedit", "sshscreen", "strip_spaces", "unquarantine_apps", "untest", "utils-install-config", "utils-utilsrc", "vacuum_firefox_sqlite", "xmp"]
13
- s.extra_rdoc_files = ["README.rdoc", "lib/utils/config/config_file.rb", "lib/utils/config.rb", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/find.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/version.rb", "lib/utils.rb"]
12
+ s.executables = ["untest", "chroot-libs", "edit_wait", "chroot-exec", "number_files", "search", "strip_spaces", "path", "enum", "edit", "git-empty", "classify", "utils-install-config", "xmp", "discover", "sshscreen", "myex", "probe", "errf", "same_files", "utils-utilsrc", "unquarantine_apps", "vacuum_firefox_sqlite", "sedit"]
13
+ s.extra_rdoc_files = ["README.rdoc", "lib/utils/config/config_file.rb", "lib/utils/finder.rb", "lib/utils/version.rb", "lib/utils/irb.rb", "lib/utils/find.rb", "lib/utils/config.rb", "lib/utils/editor.rb", "lib/utils/grepper.rb", "lib/utils/file_xt.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils.rb"]
14
14
  s.files = [".gitignore", "COPYING", "Gemfile", "README.rdoc", "Rakefile", "TODO", "VERSION", "bin/chroot-exec", "bin/chroot-libs", "bin/classify", "bin/discover", "bin/edit", "bin/edit_wait", "bin/enum", "bin/errf", "bin/git-empty", "bin/myex", "bin/number_files", "bin/path", "bin/probe", "bin/same_files", "bin/search", "bin/sedit", "bin/sshscreen", "bin/strip_spaces", "bin/unquarantine_apps", "bin/untest", "bin/utils-install-config", "bin/utils-utilsrc", "bin/vacuum_firefox_sqlite", "bin/xmp", "lib/utils.rb", "lib/utils/config.rb", "lib/utils/config/config_file.rb", "lib/utils/config/gdb/asm", "lib/utils/config/gdb/ruby", "lib/utils/config/gdbinit", "lib/utils/config/irbrc", "lib/utils/config/rdebugrc", "lib/utils/config/rvmrc", "lib/utils/config/screenrc", "lib/utils/config/utilsrc", "lib/utils/config/vim/autoload/Align.vim", "lib/utils/config/vim/autoload/AlignMaps.vim", "lib/utils/config/vim/autoload/rails.vim", "lib/utils/config/vim/autoload/rubycomplete.vim", "lib/utils/config/vim/autoload/sqlcomplete.vim", "lib/utils/config/vim/autoload/vimball.vim", "lib/utils/config/vim/colors/flori.vim", "lib/utils/config/vim/compiler/eruby.vim", "lib/utils/config/vim/compiler/ruby.vim", "lib/utils/config/vim/compiler/rubyunit.vim", "lib/utils/config/vim/ftdetect/ragel.vim", "lib/utils/config/vim/ftdetect/ruby.vim", "lib/utils/config/vim/ftplugin/eruby.vim", "lib/utils/config/vim/ftplugin/ruby.vim", "lib/utils/config/vim/ftplugin/xml.vim", "lib/utils/config/vim/indent/IndentAnything_html.vim", "lib/utils/config/vim/indent/eruby.vim", "lib/utils/config/vim/indent/javascript.vim", "lib/utils/config/vim/indent/ruby.vim", "lib/utils/config/vim/plugin/AlignMapsPlugin.vim", "lib/utils/config/vim/plugin/AlignPlugin.vim", "lib/utils/config/vim/plugin/Decho.vim", "lib/utils/config/vim/plugin/IndentAnything.vim", "lib/utils/config/vim/plugin/bufexplorer.vim", "lib/utils/config/vim/plugin/cecutil.vim", "lib/utils/config/vim/plugin/fugitive.vim", "lib/utils/config/vim/plugin/lusty-explorer.vim", "lib/utils/config/vim/plugin/rails.vim", "lib/utils/config/vim/plugin/rubyextra.vim", "lib/utils/config/vim/plugin/surround.vim", "lib/utils/config/vim/plugin/taglist.vim", "lib/utils/config/vim/plugin/test/IndentAnything/test.js", "lib/utils/config/vim/plugin/vimballPlugin.vim", "lib/utils/config/vim/syntax/Decho.vim", "lib/utils/config/vim/syntax/eruby.vim", "lib/utils/config/vim/syntax/javascript.vim", "lib/utils/config/vim/syntax/ragel.vim", "lib/utils/config/vim/syntax/ruby.vim", "lib/utils/config/vimrc", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/find.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/version.rb", "utils.gemspec"]
15
15
  s.homepage = "http://github.com/flori/utils"
16
16
  s.rdoc_options = ["--title", "Utils - Some useful command line utilities", "--main", "README.rdoc"]
17
17
  s.require_paths = ["lib"]
18
- s.rubygems_version = "1.8.21"
18
+ s.rubygems_version = "1.8.22"
19
19
  s.summary = "Some useful command line utilities"
20
20
 
21
21
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.40
4
+ version: 0.0.41
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-16 00:00:00.000000000 Z
12
+ date: 2012-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gem_hadar
@@ -94,55 +94,55 @@ dependencies:
94
94
  description: This ruby gem provides some useful command line utilities
95
95
  email: flori@ping.de
96
96
  executables:
97
- - chroot-exec
97
+ - untest
98
98
  - chroot-libs
99
- - classify
100
- - discover
101
- - edit
102
99
  - edit_wait
100
+ - chroot-exec
101
+ - number_files
102
+ - search
103
+ - strip_spaces
104
+ - path
103
105
  - enum
104
- - errf
106
+ - edit
105
107
  - git-empty
108
+ - classify
109
+ - utils-install-config
110
+ - xmp
111
+ - discover
112
+ - sshscreen
106
113
  - myex
107
- - number_files
108
- - path
109
114
  - probe
115
+ - errf
110
116
  - same_files
111
- - search
112
- - sedit
113
- - sshscreen
114
- - strip_spaces
115
- - unquarantine_apps
116
- - untest
117
- - utils-install-config
118
117
  - utils-utilsrc
118
+ - unquarantine_apps
119
119
  - vacuum_firefox_sqlite
120
- - xmp
120
+ - sedit
121
121
  extensions: []
122
122
  extra_rdoc_files:
123
123
  - README.rdoc
124
124
  - !binary |-
125
125
  bGliL3V0aWxzL2NvbmZpZy9jb25maWdfZmlsZS5yYg==
126
126
  - !binary |-
127
- bGliL3V0aWxzL2NvbmZpZy5yYg==
127
+ bGliL3V0aWxzL2ZpbmRlci5yYg==
128
128
  - !binary |-
129
- bGliL3V0aWxzL2VkaXRvci5yYg==
129
+ bGliL3V0aWxzL3ZlcnNpb24ucmI=
130
130
  - !binary |-
131
- bGliL3V0aWxzL2ZpbGVfeHQucmI=
131
+ bGliL3V0aWxzL2lyYi5yYg==
132
132
  - !binary |-
133
133
  bGliL3V0aWxzL2ZpbmQucmI=
134
134
  - !binary |-
135
- bGliL3V0aWxzL2ZpbmRlci5yYg==
135
+ bGliL3V0aWxzL2NvbmZpZy5yYg==
136
+ - !binary |-
137
+ bGliL3V0aWxzL2VkaXRvci5yYg==
136
138
  - !binary |-
137
139
  bGliL3V0aWxzL2dyZXBwZXIucmI=
138
140
  - !binary |-
139
- bGliL3V0aWxzL2lyYi5yYg==
141
+ bGliL3V0aWxzL2ZpbGVfeHQucmI=
140
142
  - !binary |-
141
143
  bGliL3V0aWxzL21kNS5yYg==
142
144
  - !binary |-
143
145
  bGliL3V0aWxzL3BhdHRlcm5zLnJi
144
- - !binary |-
145
- bGliL3V0aWxzL3ZlcnNpb24ucmI=
146
146
  - !binary |-
147
147
  bGliL3V0aWxzLnJi
148
148
  files:
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  segments:
257
257
  - 0
258
- hash: 3221497719596509954
258
+ hash: -4136706955377516720
259
259
  required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  none: false
261
261
  requirements:
@@ -264,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  requirements: []
266
266
  rubyforge_project:
267
- rubygems_version: 1.8.21
267
+ rubygems_version: 1.8.22
268
268
  signing_key:
269
269
  specification_version: 3
270
270
  summary: Some useful command line utilities