coloration 0.2.3 → 0.2.4

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.
@@ -6,11 +6,15 @@ module Coloration
6
6
 
7
7
  def self.process_cmd_line
8
8
  if ARGV.size > 0
9
- converter = self.new
10
- converter.feed(File.read(ARGV[0]))
11
- out_filename = ARGV[1] || ARGV[0].gsub(/\.#{@in_theme_ext}$/, ".#{@out_theme_ext}")
12
- converter.convert!
13
- File.open(out_filename, "w") { |f| f.write(converter.result) }
9
+ begin
10
+ converter = self.new
11
+ converter.feed(File.read(ARGV[0]))
12
+ out_filename = ARGV[1] || ARGV[0].gsub(/\.#{@in_theme_ext}$/, ".#{@out_theme_ext}")
13
+ converter.convert!
14
+ File.open(out_filename, "w") { |f| f.write(converter.result) }
15
+ rescue Coloration::Readers::TextMateThemeReader::InvalidThemeError
16
+ STDERR.puts "Err: given file doesn't look like xml plist file containing Textmate theme"
17
+ end
14
18
  else
15
19
  puts "#{File.basename($0)} <in #{@in_theme_type} theme> [out #{@out_theme_type} theme]"
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module Coloration
2
- VERSION = "0.2.3".freeze
2
+ VERSION = "0.2.4".freeze
3
3
  end
@@ -82,7 +82,7 @@ module Coloration
82
82
  #"Structure" => [],
83
83
  "Tag" => "entity.name.tag",
84
84
  "Title" => Style.new(:fg => @ui["foreground"], :bold => true),
85
- "Todo" => @items["comment"].clone.tap { |c| c.inverse = true; c.bold = true },
85
+ "Todo" => (@items["comment"] || default_style).clone.tap { |c| c.inverse = true; c.bold = true },
86
86
  "Type" => "entity.name.type",
87
87
  #"Typedef" => [],
88
88
  "Underlined" => Style.new(:underline => true),
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marcin Kulik
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-29 00:00:00 +02:00
17
+ date: 2010-08-17 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency