utils 0.0.30 → 0.0.31

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.30
1
+ 0.0.31
data/bin/classify CHANGED
@@ -4,15 +4,32 @@ require 'tins/go'
4
4
  include Tins::GO
5
5
  require 'tins/xt/string'
6
6
 
7
- opts = go 'bd'
7
+ $opts = go 'bdts'
8
8
 
9
9
  string = ARGV.shift or fail "need a class/filepath/filename"
10
10
 
11
- if opts['d']
12
- string = string.sub(/.*::/, '') if opts['b']
13
- print string.underscore + '.rb'
14
- else
15
- string = File.basename(string) if opts['b']
11
+ def underscore(string)
12
+ string = string.sub(/.*::/, '') if $opts['b']
13
+ string = string.underscore
14
+ $opts['s'] and string << '.rb'
15
+ print string
16
+ end
17
+
18
+ def camelize(string)
19
+ string = File.basename(string) if $opts['b']
16
20
  string = string.gsub(/#{Regexp.quote(File.extname(string))}\Z/, '')
17
21
  print string.camelize
18
22
  end
23
+
24
+ case
25
+ when $opts['t']
26
+ if string[0, 1] =~ /[A-Z]/
27
+ underscore string
28
+ else
29
+ camelize string
30
+ end
31
+ when $opts['d']
32
+ underscore string
33
+ else
34
+ camelize string
35
+ end
@@ -179,6 +179,8 @@ map <leader>t :tabe <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<C
179
179
  map <leader>s :split <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
180
180
  map <leader>c :cd <C-R>=substitute(expand("%:p:h") . "/", " ", "\\\\ ", "g")<CR>
181
181
  map <leader>K :%s/\([^:]\):\([^:'" ]\{1,\}\) *=>/\1\2:/g<CR>
182
+ map <leader>C :call Ccamelunderscore()<CR>
183
+
182
184
  " Switch of search highlighting
183
185
  map <silent> <F9> :nohlsearch<CR>
184
186
  if has("fullscreen")
@@ -203,11 +205,11 @@ endfunction
203
205
  nnoremap <silent> <F12> :call Ctoggle()<CR>
204
206
 
205
207
  " Switch Windows
206
- map <C-j> <C-W>j<C-W>_
207
- map <C-k> <C-W>k<C-W>_
208
+ map <A-j> <C-W>j<C-W>_
209
+ map <A-k> <C-W>k<C-W>_
208
210
  " Switch Buffers
209
- map <C-l> <ESC>:bn<CR>
210
- map <C-h> <ESC>:bp<CR>
211
+ map <A-l> <ESC>:bn<CR>
212
+ map <A-h> <ESC>:bp<CR>
211
213
  " Configure navigation keys
212
214
  noremap <Up> <Nop>
213
215
  noremap <Down> <Nop>
@@ -222,10 +224,10 @@ noremap <PageDown> <Nop>
222
224
  cnoremap <C-0> <Home>
223
225
  cnoremap <C-^> <Home>
224
226
  cnoremap <C-$> <End>
225
- cnoremap <C-H> <Left>
226
- cnoremap <C-L> <Right>
227
- cnoremap <C-K> <Up>
228
- cnoremap <C-J> <Down>
227
+ cnoremap <C-h> <Left>
228
+ cnoremap <C-l> <Right>
229
+ cnoremap <C-k> <Up>
230
+ cnoremap <C-j> <Down>
229
231
  vnoremap < <gv
230
232
  vnoremap > >gv
231
233
  " Marks
@@ -461,8 +463,15 @@ function! Cdeclassify(...)
461
463
  else
462
464
  let args = copy(a:000)
463
465
  endif
464
- let output = system("classify -d " . join(map(copy(args), 'shellescape(v:val)'), ' '))
465
- execute "normal a" . output
466
+ let output = system("classify -s -d " . join(map(copy(args), 'shellescape(v:val)'), ' '))
467
+ exec "normal a" . output
468
+ endfunction
469
+
470
+ function! Ccamelunderscore(...)
471
+ exec 'w'
472
+ let name = expand('<cWORD>')
473
+ let output = system('classify -t ' . name)
474
+ exec "normal ciW" . output
466
475
  endfunction
467
476
 
468
477
  comclear
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.0.30'
3
+ VERSION = '0.0.31'
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,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "utils"
5
- s.version = "0.0.30"
5
+ s.version = "0.0.31"
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 = "2011-12-18"
9
+ s.date = "2011-12-19"
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/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/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/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/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"]
@@ -22,18 +22,18 @@ Gem::Specification.new do |s|
22
22
  s.specification_version = 3
23
23
 
24
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<gem_hadar>, ["~> 0.1.1"])
25
+ s.add_development_dependency(%q<gem_hadar>, ["~> 0.1.4"])
26
26
  s.add_runtime_dependency(%q<tins>, ["~> 0.3"])
27
27
  s.add_runtime_dependency(%q<term-ansicolor>, ["~> 1.0"])
28
28
  s.add_runtime_dependency(%q<dslkit>, ["~> 0.2"])
29
29
  else
30
- s.add_dependency(%q<gem_hadar>, ["~> 0.1.1"])
30
+ s.add_dependency(%q<gem_hadar>, ["~> 0.1.4"])
31
31
  s.add_dependency(%q<tins>, ["~> 0.3"])
32
32
  s.add_dependency(%q<term-ansicolor>, ["~> 1.0"])
33
33
  s.add_dependency(%q<dslkit>, ["~> 0.2"])
34
34
  end
35
35
  else
36
- s.add_dependency(%q<gem_hadar>, ["~> 0.1.1"])
36
+ s.add_dependency(%q<gem_hadar>, ["~> 0.1.4"])
37
37
  s.add_dependency(%q<tins>, ["~> 0.3"])
38
38
  s.add_dependency(%q<term-ansicolor>, ["~> 1.0"])
39
39
  s.add_dependency(%q<dslkit>, ["~> 0.2"])
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.30
4
+ version: 0.0.31
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-18 00:00:00.000000000 Z
12
+ date: 2011-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gem_hadar
16
- requirement: &2152045300 !ruby/object:Gem::Requirement
16
+ requirement: &83163010 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.1.1
21
+ version: 0.1.4
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152045300
24
+ version_requirements: *83163010
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tins
27
- requirement: &2152044860 !ruby/object:Gem::Requirement
27
+ requirement: &83162760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152044860
35
+ version_requirements: *83162760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: term-ansicolor
38
- requirement: &2152044440 !ruby/object:Gem::Requirement
38
+ requirement: &83239640 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152044440
46
+ version_requirements: *83239640
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: dslkit
49
- requirement: &2152044020 !ruby/object:Gem::Requirement
49
+ requirement: &83239400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,47 +54,47 @@ dependencies:
54
54
  version: '0.2'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152044020
57
+ version_requirements: *83239400
58
58
  description: This ruby gem provides some useful command line utilities
59
59
  email: flori@ping.de
60
60
  executables:
61
- - chroot-exec
61
+ - untest
62
62
  - chroot-libs
63
- - classify
64
- - discover
65
- - edit
66
63
  - edit_wait
64
+ - chroot-exec
65
+ - number_files
66
+ - search
67
+ - strip_spaces
68
+ - path
67
69
  - enum
68
- - errf
70
+ - edit
69
71
  - git-empty
72
+ - classify
73
+ - utils-install-config
74
+ - xmp
75
+ - discover
76
+ - sshscreen
70
77
  - myex
71
- - number_files
72
- - path
73
78
  - probe
79
+ - errf
74
80
  - same_files
75
- - search
76
- - sedit
77
- - sshscreen
78
- - strip_spaces
79
- - unquarantine_apps
80
- - untest
81
- - utils-install-config
82
81
  - utils-utilsrc
82
+ - unquarantine_apps
83
83
  - vacuum_firefox_sqlite
84
- - xmp
84
+ - sedit
85
85
  extensions: []
86
86
  extra_rdoc_files:
87
87
  - README.rdoc
88
88
  - lib/utils/config/config_file.rb
89
+ - lib/utils/finder.rb
90
+ - lib/utils/version.rb
91
+ - lib/utils/find.rb
89
92
  - lib/utils/config.rb
90
93
  - lib/utils/editor.rb
91
- - lib/utils/file_xt.rb
92
- - lib/utils/find.rb
93
- - lib/utils/finder.rb
94
94
  - lib/utils/grepper.rb
95
+ - lib/utils/file_xt.rb
95
96
  - lib/utils/md5.rb
96
97
  - lib/utils/patterns.rb
97
- - lib/utils/version.rb
98
98
  - lib/utils.rb
99
99
  files:
100
100
  - .gitignore