yac 1.3.0 → 1.3.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/lib/format.rb +6 -6
- data/lib/yac.rb +1 -1
- data/resources/yacrc +18 -17
- data/yac.gemspec +1 -1
- metadata +1 -1
data/lib/format.rb
CHANGED
@@ -14,9 +14,9 @@ module Format
|
|
14
14
|
colorful(file,"filename") if file
|
15
15
|
case `file "#{file}" 2>/dev/null`
|
16
16
|
when / PDF document/
|
17
|
-
|
17
|
+
colorful(Pdf_Error,'warn') unless system("#{Yac::CONFIG["pdf_command"]||'evince'} '#{file}' 2>/dev/null")
|
18
18
|
when /( image )|(\.svg)/
|
19
|
-
|
19
|
+
colorful(Image_Error,'warn') unless system("#{Yac::CONFIG["image_command"]||'eog'} '#{file}' 2>/dev/null")
|
20
20
|
when /Office Document/
|
21
21
|
open_office(file)
|
22
22
|
else
|
@@ -45,9 +45,9 @@ module Format
|
|
45
45
|
def edit_file(file)
|
46
46
|
case `file "#{file}" 2>/dev/null`
|
47
47
|
when / PDF /
|
48
|
-
|
48
|
+
colorful(Pdf_Error,'warn') unless system("#{Yac::CONFIG["pdf_edit_command"]||'ooffice'} '#{file}' 2>/dev/null")
|
49
49
|
when /( image )|(\.svg)/
|
50
|
-
|
50
|
+
colorful(Image_Error,'warn') unless system("#{Yac::CONFIG["image_edit_command"]||'gimp'} '#{file}' 2>/dev/null")
|
51
51
|
when /Office Document/
|
52
52
|
open_office(file)
|
53
53
|
else
|
@@ -60,12 +60,12 @@ module Format
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def open_office(file)
|
63
|
-
|
63
|
+
colorful(Office_Error,'warn') unless system("#{Yac::CONFIG["office_command"]||'ooffice'} '#{file}' 2>/dev/null")
|
64
64
|
end
|
65
65
|
|
66
66
|
def edit_text(file)
|
67
67
|
prepare_dir(file)
|
68
|
-
|
68
|
+
colorful(Doc_Error,'warn') unless system("#{Yac::CONFIG["editor"] || ENV['EDITOR'] ||'vim'} '#{file}' 2>/dev/null")
|
69
69
|
end
|
70
70
|
|
71
71
|
def colorful(stuff,level="text",line_break = true)
|
data/lib/yac.rb
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH << File.dirname(__FILE__)
|
|
4
4
|
module Yac
|
5
5
|
include Format
|
6
6
|
extend self
|
7
|
-
VERSION = '1.3.
|
7
|
+
VERSION = '1.3.1'
|
8
8
|
YACRC = File.join("#{ENV['HOME']}",".yacrc")
|
9
9
|
|
10
10
|
FileUtils.cp(File.join(File.dirname(__FILE__), "..","resources","yacrc"), YACRC) unless File.exist?(YACRC)
|
data/resources/yacrc
CHANGED
@@ -8,12 +8,28 @@ private:
|
|
8
8
|
# push-to:
|
9
9
|
|
10
10
|
pdf_command: evince
|
11
|
-
|
11
|
+
office_command: ooffice
|
12
|
+
#image_command: evince
|
12
13
|
#editor: vim
|
13
14
|
#pdf_edit_command: ooffice
|
14
15
|
#image_edit_command: gimp
|
15
16
|
|
16
|
-
|
17
|
+
head1: "1;31"
|
18
|
+
head2: "1;36"
|
19
|
+
head3: "1;33"
|
20
|
+
head4: "1;32"
|
21
|
+
head5: "1;34"
|
22
|
+
head6: "1;35"
|
23
|
+
head7: "1;37"
|
24
|
+
|
25
|
+
warn: "31"
|
26
|
+
notice: "33"
|
27
|
+
empha: "31;43"
|
28
|
+
filename: "34"
|
29
|
+
line_number: "32"
|
30
|
+
text:
|
31
|
+
|
32
|
+
# How To Set Color
|
17
33
|
#1 - Change text to hicolor (bold) mode
|
18
34
|
#4 - " " " Underline
|
19
35
|
#5 - " " " Blink
|
@@ -36,18 +52,3 @@ pdf_command: evince
|
|
36
52
|
#47 - " " " White
|
37
53
|
#0 - Turn off all attributes.
|
38
54
|
#7 - Change to Black text on a White background
|
39
|
-
|
40
|
-
head1: 1;31
|
41
|
-
head2: 1;36
|
42
|
-
head3: 1;33
|
43
|
-
head4: 1;32
|
44
|
-
head5: 1;34
|
45
|
-
head6: 1;35
|
46
|
-
head7: 1;37
|
47
|
-
|
48
|
-
warn: 31
|
49
|
-
notice: 33
|
50
|
-
empha: 31;43
|
51
|
-
filename: 34
|
52
|
-
line_number: 32
|
53
|
-
text:
|
data/yac.gemspec
CHANGED