gatchaman 0.1.0 → 0.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 CHANGED
@@ -1,3 +1,7 @@
1
- 2013-01-11 maruyama shinpei <shinpeim@maruyama-no-MacBook-Pro.local>
1
+ 2013-01-11 maruyama shinpei <shinpeim@gmail.com>
2
2
 
3
3
  * release version 0.1.0
4
+
5
+ 2013-01-11 maruyama shinpei <shinpeim@gmail.com>
6
+
7
+ * bin/gatchan prettify error message
data/README.md CHANGED
@@ -12,6 +12,11 @@ Gatchaman is a gem to replace src values in HTML documents with data URI scheme
12
12
 
13
13
  $ gatchan input_file [-r document_root] [-c current_directory]
14
14
 
15
+ or
16
+
17
+ gatchaman = Gatchaman.new(document_root, current_directory)
18
+ gatchaman.data_uri_schemize(html_string)
19
+
15
20
  ## Contributing
16
21
 
17
22
  1. Fork it
@@ -13,8 +13,18 @@ def parse_options
13
13
  options
14
14
  end
15
15
 
16
+ def help
17
+ warn "usage: #{$0} input_file [-r document_root] [-c current_directory]"
18
+ exit 1
19
+ end
20
+
16
21
  options = parse_options
17
- input_file = ARGV.shift or raise "usage #{$0} input_file"
22
+ input_file = ARGV.shift or help
18
23
 
19
- print Gatchaman.new(options[:document_root], options[:current_directory] || File.dirname(input_file)).
20
- data_uri_schemize(IO.read(input_file))
24
+ begin
25
+ print Gatchaman.new(options[:document_root], options[:current_directory] || File.dirname(input_file)).
26
+ data_uri_schemize(IO.read(input_file))
27
+ rescue => e
28
+ warn e.message
29
+ exit 2
30
+ end
@@ -1,3 +1,3 @@
1
1
  class Gatchaman
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatchaman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-11 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri