yac 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Manifest +10 -0
  2. data/README.rdoc +0 -3
  3. data/Rakefile +13 -0
  4. data/lib/yac.rb +7 -9
  5. data/yac.gemspec +28 -31
  6. metadata +23 -28
data/Manifest ADDED
@@ -0,0 +1,10 @@
1
+ CHANGELOG
2
+ resources/yacrc
3
+ bin/yac
4
+ Rakefile
5
+ yac.gemspec
6
+ lib/git.rb
7
+ lib/format.rb
8
+ lib/yac.rb
9
+ README.rdoc
10
+ Manifest
data/README.rdoc CHANGED
@@ -64,9 +64,6 @@
64
64
  === Help (display this file)
65
65
  $ yac help
66
66
 
67
- === Version
68
- $ yac -v | version
69
-
70
67
  === Documents format
71
68
  All text file add ".ch" as suffix for butter editor highlight
72
69
  (A very very simple vim script can be found here : http://www.vim.org/scripts/script.php?script_id=2399)
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('yac', '1.1.4') do |p|
6
+ p.description = "Yet Another Cheat: sexy command line tool for cheat sheet."
7
+ p.url = "http://www.zhangjinzhu.com"
8
+ p.author = "Jinzhu Zhang"
9
+ p.email = "wosmvp@gmail.com"
10
+ p.ignore_pattern = ["TODO"]
11
+ p.development_dependencies = []
12
+ end
13
+
data/lib/yac.rb CHANGED
@@ -31,11 +31,9 @@ module Yac
31
31
  when "sh" then shell(args[1,args.size])
32
32
  when "rm" then rm(args[1,args.size])
33
33
  when "mv" then rename(args[1,args.size])
34
- when /^version|-v$/ then
35
- load File.join(File.dirname(__FILE__), "..", "yac.gemspec");colorful("yac, version: " + VER,"notice")
36
34
  else show(args)
37
35
  end
38
- rescue
36
+ #rescue
39
37
  end
40
38
 
41
39
  def init
@@ -190,16 +188,16 @@ module Yac
190
188
  end
191
189
 
192
190
  def search_content(args)
193
- args.sub!(/^"(.*)"/,'\1') #Remove the " for input Regex
194
- result = `cd "#{@pri_path}" && grep -n -i -P '#{args}' -R *.ch 2>/dev/null`.to_a
195
- result.concat(`cd "#{@main_path}" && grep -n -i -P '#{args}' -R *.ch 2>/dev/null | sed 's/^/@/g'`.to_a)
191
+ result = `find "#{@pri_path}" -iname '*.ch' -not -iwholename '*.git*' -exec grep -HniP '#{args}' '{}' \\;`.to_a
192
+ result.concat(`find "#{@main_path}" -iname '*.ch' -not -iwholename '*.git*' -exec grep -HniP '#{args}' '{}' \\; | sed 's/^/@/g'`.to_a)
196
193
  all_result = []
197
194
  result.each do |x|
198
195
  stuff = x.split(':',3)
199
- colorful(stuff[0],"filename",false)
196
+ filename = stuff[0].sub(/(@?).*\/(?:main|private)\/(.*)/,'\1'+'\2')
197
+ colorful(filename,"filename",false)
200
198
  colorful(stuff[1],"line_number",false)
201
199
  format_section(empha(stuff[2],nil,/((#{args}))/i),true)
202
- all_result.concat(stuff[0].to_a)
200
+ all_result.concat(filename.to_a)
203
201
  end
204
202
  all_result.uniq!
205
203
  loop do
@@ -221,7 +219,7 @@ module Yac
221
219
  return file.strip
222
220
  end
223
221
 
224
- def confirm(*msg)
222
+ def confirm(*msg)control
225
223
  colorful("#{msg.to_s}\nAre You Sure (Y/N) (q to quit):","notice",false)
226
224
  return STDIN.gets.to_s =~ /n|q/i ? false : true
227
225
  end
data/yac.gemspec CHANGED
@@ -1,36 +1,33 @@
1
- GEM = "yac"
2
- VER = "1.1.3"
3
- DATE = %q{2008-10-28}
4
- AUTHOR = "Jinzhu Zhang"
5
- EMAIL = "wosmvp@gmail.com"
6
- HOMEPAGE = "http://www.zhangjinzhu.com"
7
- SUMMARY = "Yet Another Cheat: sexy command line tool for cheat sheet"
8
-
9
- Gem::Specification.new do |s|
1
+ # -*- encoding: utf-8 -*-
10
2
 
11
- s.specification_version = 2 if s.respond_to? :specification_version=
12
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{yac}
5
+ s.version = "1.1.4"
13
6
 
14
- s.rubyforge_project = 'yac'
15
- s.name = GEM
16
- s.version = VER
17
- s.author = AUTHOR
18
- s.date = DATE
19
- s.email = EMAIL
20
- s.platform = Gem::Platform::RUBY
21
- s.homepage = HOMEPAGE
22
- s.summary = SUMMARY
23
- s.description = s.summary
24
-
25
- s.require_path = 'lib'
26
- s.autorequire = 'yac'
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Jinzhu Zhang"]
9
+ s.date = %q{2008-11-18}
10
+ s.default_executable = %q{yac}
11
+ s.description = %q{Yet Another Cheat: sexy command line tool for cheat sheet.}
12
+ s.email = %q{wosmvp@gmail.com}
27
13
  s.executables = ["yac"]
28
-
29
- s.files = %w[README.rdoc CHANGELOG yac.gemspec resources/yacrc bin/yac lib/yac.rb lib/format.rb lib/git.rb]
14
+ s.extra_rdoc_files = ["CHANGELOG", "bin/yac", "lib/git.rb", "lib/format.rb", "lib/yac.rb", "README.rdoc"]
15
+ s.files = ["CHANGELOG", "resources/yacrc", "bin/yac", "Rakefile", "yac.gemspec", "lib/git.rb", "lib/format.rb", "lib/yac.rb", "README.rdoc", "Manifest"]
16
+ s.has_rdoc = true
17
+ s.homepage = %q{http://www.zhangjinzhu.com}
18
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Yac", "--main", "README.rdoc"]
19
+ s.require_paths = ["lib"]
20
+ s.rubyforge_project = %q{yac}
21
+ s.rubygems_version = %q{1.3.1}
22
+ s.summary = %q{Yet Another Cheat: sexy command line tool for cheat sheet.}
23
+
24
+ if s.respond_to? :specification_version then
25
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
+ s.specification_version = 2
30
27
 
31
- #s.has_rdoc = true
32
- s.rdoc_options = ["--quiet", "--title", "YAC => Yet Another Cheat", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
33
- s.extra_rdoc_files = "README.rdoc"
34
-
35
- s.add_dependency("schacon-git", ">1.0.0")
28
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
+ else
30
+ end
31
+ else
32
+ end
36
33
  end
metadata CHANGED
@@ -1,57 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yac
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jinzhu Zhang
8
- autorequire: yac
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-28 00:00:00 +08:00
12
+ date: 2008-11-18 00:00:00 +08:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: schacon-git
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 1.0.0
24
- version:
25
- description: "Yet Another Cheat: sexy command line tool for cheat sheet"
14
+ dependencies: []
15
+
16
+ description: "Yet Another Cheat: sexy command line tool for cheat sheet."
26
17
  email: wosmvp@gmail.com
27
18
  executables:
28
19
  - yac
29
20
  extensions: []
30
21
 
31
22
  extra_rdoc_files:
23
+ - CHANGELOG
24
+ - bin/yac
25
+ - lib/git.rb
26
+ - lib/format.rb
27
+ - lib/yac.rb
32
28
  - README.rdoc
33
29
  files:
34
- - README.rdoc
35
30
  - CHANGELOG
36
- - yac.gemspec
37
31
  - resources/yacrc
38
32
  - bin/yac
39
- - lib/yac.rb
40
- - lib/format.rb
33
+ - Rakefile
34
+ - yac.gemspec
41
35
  - lib/git.rb
42
- has_rdoc: false
36
+ - lib/format.rb
37
+ - lib/yac.rb
38
+ - README.rdoc
39
+ - Manifest
40
+ has_rdoc: true
43
41
  homepage: http://www.zhangjinzhu.com
44
42
  post_install_message:
45
43
  rdoc_options:
46
- - --quiet
47
- - --title
48
- - YAC => Yet Another Cheat
49
- - --opname
50
- - index.html
51
44
  - --line-numbers
45
+ - --inline-source
46
+ - --title
47
+ - Yac
52
48
  - --main
53
49
  - README.rdoc
54
- - --inline-source
55
50
  require_paths:
56
51
  - lib
57
52
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -64,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
59
  requirements:
65
60
  - - ">="
66
61
  - !ruby/object:Gem::Version
67
- version: "0"
62
+ version: "1.2"
68
63
  version:
69
64
  requirements: []
70
65
 
@@ -72,6 +67,6 @@ rubyforge_project: yac
72
67
  rubygems_version: 1.3.1
73
68
  signing_key:
74
69
  specification_version: 2
75
- summary: "Yet Another Cheat: sexy command line tool for cheat sheet"
70
+ summary: "Yet Another Cheat: sexy command line tool for cheat sheet."
76
71
  test_files: []
77
72