yac 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/lib/format.rb +6 -6
  2. data/lib/yac.rb +1 -1
  3. data/resources/yacrc +18 -17
  4. data/yac.gemspec +1 -1
  5. metadata +1 -1
@@ -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
- puts Pdf_Error unless system("#{Yac::CONFIG["pdf_command"]||'evince'} '#{file}' 2>/dev/null")
17
+ colorful(Pdf_Error,'warn') unless system("#{Yac::CONFIG["pdf_command"]||'evince'} '#{file}' 2>/dev/null")
18
18
  when /( image )|(\.svg)/
19
- puts Image_Error unless system("#{Yac::CONFIG["image_command"]||'eog'} '#{file}' 2>/dev/null")
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
- puts Pdf_Error unless system("#{Yac::CONFIG["pdf_edit_command"]||'ooffice'} '#{file}' 2>/dev/null")
48
+ colorful(Pdf_Error,'warn') unless system("#{Yac::CONFIG["pdf_edit_command"]||'ooffice'} '#{file}' 2>/dev/null")
49
49
  when /( image )|(\.svg)/
50
- puts Image_Error unless system("#{Yac::CONFIG["image_edit_command"]||'gimp'} '#{file}' 2>/dev/null")
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
- puts Office_Error unless system("#{Yac::CONFIG["office_command"]||'ooffice'} '#{file}' 2>/dev/null")
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
- puts Doc_Error unless system("#{Yac::CONFIG["editor"] || ENV['EDITOR'] ||'vim'} '#{file}' 2>/dev/null")
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.0'
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)
@@ -8,12 +8,28 @@ private:
8
8
  # push-to:
9
9
 
10
10
  pdf_command: evince
11
- #image_command: eog
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
- #Set Color
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:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{yac}
5
- s.version = "1.3.0"
5
+ s.version = "1.3.1"
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.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jinzhu Zhang