yac 1.1.4 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGELOG +2 -0
  2. data/README.rdoc +21 -21
  3. data/Rakefile +1 -1
  4. data/lib/yac.rb +12 -13
  5. data/yac.gemspec +1 -1
  6. metadata +1 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ V1.2.0 <2008-11-9>
2
+ * modify all commands search => -S , add => -a ,edit => -e and so on
1
3
  V1.1.1 <2008-11-8>
2
4
  * $ yac l/oo/t To choose linux/gentoo/install
3
5
  * $ yac add l/oo/t To choose linux/gentoo/ As the directory for file t
data/README.rdoc CHANGED
@@ -19,50 +19,50 @@
19
19
  === To show a cheat sheet:
20
20
  $ yac (show) [cheatsheet] ( you can use * for any chars)
21
21
  Eg:
22
- $ yac show lin*x
23
- $ yac show l/o/a To show linux/gentoo/masked
22
+ $ yac lin*x
23
+ $ yac l/o/a To show linux/gentoo/masked
24
24
 
25
25
  === To edit a cheat sheet
26
- $ yac edit [cheatsheet] (Yes,you can use * for any chars also,then choose one to edit)
26
+ $ yac -e [cheatsheet] (Yes,you can use * for any chars also,then choose one to edit)
27
27
 
28
28
  === To add a cheat sheet
29
- $ yac add [cheatsheet] (OMG,you can also use *)
29
+ $ yac -a [cheatsheet] (OMG,you can also use *)
30
30
  Eg:
31
- $ yac li*x/install
31
+ $ yac -a li*x/install
32
32
  Then will display all directories match /li*x/,feel freely to choose one of them,
33
33
  A new file named install.ch will be added to the directory!
34
- $ yac l/oo/install
34
+ $ yac -a l/oo/install
35
35
  Oh,no,you can choose linux/gentoo as the directory for the install file
36
36
 
37
37
  === To rm a cheat sheet
38
- $ yac rm [cheatsheet] (Sure,you can use *)
38
+ $ yac -r [cheatsheet] (Sure,you can use *)
39
39
 
40
40
  === Search all sheets
41
- $ yac search [keyword] (@@@Take Attention:@@@ You are allowed to use perl-like Regex)
41
+ $ yac -S [keyword] (@@@Take Attention:@@@ You are allowed to use perl-like Regex)
42
42
  Eg:
43
- $ yac search lin.*x
43
+ $ yac -S lin.*x
44
44
  And Even:
45
- $ yac search "r(uby|ails)"
45
+ $ yac -S "r(uby|ails)"
46
46
 
47
47
  === Update repositories
48
- $ yac update main => Update main repository
49
- $ yac update all => Update all repositories
50
- $ yac update => Update private repository
48
+ $ yac -u main => Update main repository
49
+ $ yac -u all => Update all repositories
50
+ $ yac -u => Update private repository
51
51
 
52
52
  === Shell
53
- $ yac sh main => Open the main repository's shell
54
- $ yac sh => Open the private repository's shell
53
+ $ yac -s main => Open the main repository's shell
54
+ $ yac -s => Open the private repository's shell
55
55
 
56
56
  == Repository Push
57
- $ yac push main => Push the main repository
58
- $ yac push all => Push all repositories
59
- $ yac push => Push the private repository
57
+ $ yac -p main => Push the main repository
58
+ $ yac -p all => Push all repositories
59
+ $ yac -p => Push the private repository
60
60
 
61
- == Rename a cheatsheet:
62
- $ yac mv [orign_name] [new_name]
61
+ == Rename/mv a cheatsheet:
62
+ $ yac -m [orign_name] [new_name]
63
63
 
64
64
  === Help (display this file)
65
- $ yac help
65
+ $ yac -h
66
66
 
67
67
  === Documents format
68
68
  All text file add ".ch" as suffix for butter editor highlight
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('yac', '1.1.4') do |p|
5
+ Echoe.new('yac', '1.2.0') do |p|
6
6
  p.description = "Yet Another Cheat: sexy command line tool for cheat sheet."
7
7
  p.url = "http://www.zhangjinzhu.com"
8
8
  p.author = "Jinzhu Zhang"
data/lib/yac.rb CHANGED
@@ -20,20 +20,19 @@ module Yac
20
20
  init unless File.exist?(@main_path) && File.exist?(@pri_path)
21
21
  (help && exit) if args.empty?
22
22
  case args.first
23
- when "show" then show(args[1,args.size])
24
- when "search" then search(args[1,args.size])
25
- when "update" then update(args[1,args.size])
26
- when "push" then push(args[1,args.size])
27
- when "log" then log(args[1,args.size])
28
- when "add" then add(args[1,args.size])
29
- when "edit" then edit(args[1,args.size])
23
+ when "-S" then search(args[1,args.size])
24
+ when "-u" then update(args[1,args.size])
25
+ when "-p" then push(args[1,args.size])
26
+ when "-l" then log(args[1,args.size])
27
+ when "-a" then add(args[1,args.size])
28
+ when "-e" then edit(args[1,args.size])
30
29
  when /^(help|-h|yac|--help)$/ then help
31
- when "sh" then shell(args[1,args.size])
32
- when "rm" then rm(args[1,args.size])
33
- when "mv" then rename(args[1,args.size])
30
+ when "-s" then shell(args[1,args.size])
31
+ when "-r" then rm(args[1,args.size])
32
+ when "-m" then mv(args[1,args.size])
34
33
  else show(args)
35
34
  end
36
- #rescue
35
+ rescue
37
36
  end
38
37
 
39
38
  def init
@@ -118,7 +117,7 @@ module Yac
118
117
  end
119
118
  end
120
119
 
121
- def rename(args)
120
+ def mv(args)
122
121
  (colorful("Usage:\nyac mv [orign_name] [new_name]\n\nTry `yac -h` for more help","warn");exit) unless args.size == 2
123
122
  file = search_name(args[0],"Rename")
124
123
  #You can use $ yac mv linux.ch linux/ to rename linux.ch to linux/linux.ch
@@ -219,7 +218,7 @@ module Yac
219
218
  return file.strip
220
219
  end
221
220
 
222
- def confirm(*msg)control
221
+ def confirm(*msg)
223
222
  colorful("#{msg.to_s}\nAre You Sure (Y/N) (q to quit):","notice",false)
224
223
  return STDIN.gets.to_s =~ /n|q/i ? false : true
225
224
  end
data/yac.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{yac}
5
- s.version = "1.1.4"
5
+ s.version = "1.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jinzhu Zhang"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yac
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jinzhu Zhang