yac 1.1.0 → 1.1.1
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.
- data/CHANGELOG +10 -0
- data/README.rdoc +5 -2
- data/lib/yac.rb +7 -5
- data/yac.gemspec +2 -2
- metadata +2 -1
data/CHANGELOG
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
V1.1.1 <2008-11-8>
|
2
|
+
* $ yac l/oo/t To choose linux/gentoo/install
|
3
|
+
* $ yac add l/oo/t To choose linux/gentoo/ As the directory for file t
|
4
|
+
|
5
|
+
V1.1.0 <2008-11-8>
|
6
|
+
* Don't need schacon-git anymore
|
7
|
+
* When Choose files You can Just press enter to choose the first one
|
8
|
+
* When Confirm You can Just press enter to answer Yes
|
9
|
+
|
10
|
+
Version Below V1.1.0 Please See README
|
data/README.rdoc
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
== Install
|
11
11
|
Make sure you have ruby,git in your system . then:
|
12
|
-
$ (sudo) gem install yac
|
12
|
+
$ (sudo) gem install yac
|
13
13
|
|
14
14
|
== How To Use
|
15
15
|
|
@@ -20,6 +20,7 @@
|
|
20
20
|
$ yac (show) [cheatsheet] ( you can use * for any chars)
|
21
21
|
Eg:
|
22
22
|
$ yac show lin*x
|
23
|
+
$ yac show l/o/a To show linux/gentoo/masked
|
23
24
|
|
24
25
|
=== To edit a cheat sheet
|
25
26
|
$ yac edit [cheatsheet] (Yes,you can use * for any chars also,then choose one to edit)
|
@@ -30,6 +31,8 @@
|
|
30
31
|
$ yac li*x/install
|
31
32
|
Then will display all directories match /li*x/,feel freely to choose one of them,
|
32
33
|
A new file named install.ch will be added to the directory!
|
34
|
+
$ yac l/oo/install
|
35
|
+
Oh,no,you can choose linux/gentoo as the directory for the install file
|
33
36
|
|
34
37
|
=== To rm a cheat sheet
|
35
38
|
$ yac rm [cheatsheet] (Sure,you can use *)
|
@@ -82,8 +85,8 @@
|
|
82
85
|
|
83
86
|
== REQUIREMENTS:
|
84
87
|
* Ruby
|
88
|
+
* Git
|
85
89
|
* rubygems
|
86
|
-
* git
|
87
90
|
|
88
91
|
== LICENSE:
|
89
92
|
|
data/lib/yac.rb
CHANGED
@@ -143,14 +143,16 @@ module Yac
|
|
143
143
|
|
144
144
|
def add_file(args,suffix = ".ch")
|
145
145
|
if args.include?('/') && args =~ /(@?)(?:(.*)\/)(.+)/ #choose directory
|
146
|
-
|
146
|
+
prefix,path_name,file_name = $1,$2,$3
|
147
|
+
path = prefix.empty? ? @pri_path : @main_path #choose git path
|
148
|
+
# Yes,you can use 'l/e' to choose 'linux/gentoo'
|
147
149
|
all_path = %x{
|
148
|
-
find #{path} -type d -iwholename '#{path}*#{
|
149
|
-
}.to_a.map(&:strip).concat([
|
150
|
+
find #{path} -type d -iwholename '#{path}*#{path_name.gsub(/\//,'*/*')}*' -not -iwholename '*.git*'| sed 's/^.*\\/\\(private\\|main\\)\\//#{prefix}/'
|
151
|
+
}.to_a.map(&:strip).concat([prefix+path_name]).uniq
|
150
152
|
|
151
153
|
colorful("Which directory do you want to use:","notice")
|
152
154
|
choosed_path = choose_one(all_path)
|
153
|
-
return full_path(choosed_path + "/" +
|
155
|
+
return full_path(choosed_path + "/" + file_name + suffix) if choosed_path
|
154
156
|
else
|
155
157
|
return full_path(args+suffix)
|
156
158
|
end
|
@@ -180,7 +182,7 @@ module Yac
|
|
180
182
|
path = (args =~ /^(@)/) ? [@main_path] : [@main_path , @pri_path]
|
181
183
|
result = []
|
182
184
|
path.each do |x|
|
183
|
-
result.concat(`find "#{x}" -type f -iwholename '#{x}*#{args.sub(/^@/,'').strip}*' -not -iwholename '*.git*'| sed 's/^.*\\/\\(private\\|main\\)\\//#{x=~/main/ ? '@':'' }/'`.to_a)
|
185
|
+
result.concat(`find "#{x}" -type f -iwholename '#{x}*#{args.gsub(/\//,'*/*').sub(/^@/,'').strip}*' -not -iwholename '*.git*'| sed 's/^.*\\/\\(private\\|main\\)\\//#{x=~/main/ ? '@':'' }/'`.to_a)
|
184
186
|
end
|
185
187
|
|
186
188
|
return result.empty? ? (colorful("Nothing Found About < #{args} >","warn")) :
|
data/yac.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
GEM = "yac"
|
2
|
-
VER = "1.1.
|
2
|
+
VER = "1.1.1"
|
3
3
|
DATE = %q{2008-10-28}
|
4
4
|
AUTHOR = "Jinzhu Zhang"
|
5
5
|
EMAIL = "wosmvp@gmail.com"
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.autorequire = 'yac'
|
26
26
|
s.executables = ["yac"]
|
27
27
|
|
28
|
-
s.files = %w[README.rdoc yac.gemspec resources/yacrc bin/yac lib/yac.rb lib/format.rb lib/git.rb]
|
28
|
+
s.files = %w[README.rdoc CHANGELOG yac.gemspec resources/yacrc bin/yac lib/yac.rb lib/format.rb lib/git.rb]
|
29
29
|
|
30
30
|
#s.has_rdoc = true
|
31
31
|
s.rdoc_options = ["--quiet", "--title", "YAC => Yet Another Cheat", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
|
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
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jinzhu Zhang
|
@@ -32,6 +32,7 @@ extra_rdoc_files:
|
|
32
32
|
- README.rdoc
|
33
33
|
files:
|
34
34
|
- README.rdoc
|
35
|
+
- CHANGELOG
|
35
36
|
- yac.gemspec
|
36
37
|
- resources/yacrc
|
37
38
|
- bin/yac
|