sogoumap2pdf 0.0.8 → 0.0.9

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.
@@ -15,3 +15,6 @@
15
15
  * 1 bug fixed:
16
16
  * Page size error
17
17
 
18
+ == 0.0.9 2008-08-19
19
+ * 1 minor enhancement:
20
+ * add command sogoumap2disk
@@ -5,6 +5,7 @@ PostInstall.txt
5
5
  README.txt
6
6
  Rakefile
7
7
  bin/sogoumap2pdf
8
+ bin/sogoumap2disk
8
9
  config/hoe.rb
9
10
  config/requirements.rb
10
11
  lib/sogoumap2pdf.rb
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created on 2008-8-19.
4
+ # Copyright (c) 2008. All rights reserved.
5
+
6
+ begin
7
+ require 'rubygems'
8
+ rescue LoadError
9
+ # no rubygems to load, so we fail silently
10
+ end
11
+
12
+ require 'optparse'
13
+ require 'sogoumap2pdf'
14
+ include Sogoumap2pdf
15
+ # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
16
+
17
+ OPTIONS = {
18
+ :path => '~'
19
+ }
20
+ MANDATORY_OPTIONS = %w( )
21
+
22
+ parser = OptionParser.new do |opts|
23
+ opts.banner = <<BANNER
24
+ This application is wonderful because...
25
+
26
+ Usage: #{File.basename($0)} [options]
27
+
28
+ Options are:
29
+ BANNER
30
+ opts.separator ""
31
+ opts.on("-p", "--path=PATH", String,
32
+ "The root path for selecting files",
33
+ "Default: ~") { |OPTIONS[:path]| }
34
+ opts.on("-h", "--help",
35
+ "Show this help message.") { puts opts; exit }
36
+ opts.parse!(ARGV)
37
+
38
+ if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
39
+ puts opts; exit
40
+ end
41
+ end
42
+
43
+ path = OPTIONS[:path]
44
+
45
+ # do stuff
46
+ #
47
+ # guangzhou: ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/792/504/105/100899_21033.JPG 0 0 30 30 guangzhou.pdf sp
48
+ # guangzhou: ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/792/504/105/100899_21033.JPG 0x0 30x30 guangzhou.pdf sp
49
+ link=ARGV[0]
50
+ option=ARGV[4]
51
+ x,y=ARGV[1].split("x")
52
+ r,c=ARGV[2].split("x")
53
+ g=SogouMapImage.new(link, option)
54
+ gmpdf=ImageToPdf.new(".JPG",x,y)
55
+ xres, yres = gmpdf.perfect_fit(x.to_i,y.to_i,r.to_i,c.to_i)
56
+ g.fill_map(xres,yres)
57
+ #gmpdf.front_page(g)
58
+ #gmpdf.create_pages(g)
59
+ #gmpdf.save(ARGV[3])
@@ -2,7 +2,7 @@ module Sogoumap2pdf
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -35,7 +35,7 @@
35
35
  <h1>sogoumap2pdf</h1>
36
36
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sogoumap2pdf"; return false'>
37
37
  <p>Get Version</p>
38
- <a href="http://rubyforge.org/projects/sogoumap2pdf" class="numbers">0.0.8</a>
38
+ <a href="http://rubyforge.org/projects/sogoumap2pdf" class="numbers">0.0.9</a>
39
39
  </div>
40
40
  <h2>What</h2>
41
41
  <p>download map from map.sogou.com and convert to pdf</p>
@@ -73,8 +73,10 @@ rake install_gem</pre>
73
73
  <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
74
74
  <h2>Contact</h2>
75
75
  <p>Comments are welcome. Send an email to <a href="mailto:ruanwz@gmail.com">David Ruan</a></p>
76
+ <h2>Screencast</h2>
77
+ <object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/SxEZ1lhUDH4"> </param> <embed src="http://www.youtube.com/v/SxEZ1lhUDH4" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object>
76
78
  <p class="coda">
77
- <a href="mailto:ruanwz@gmail.com">David Ruan</a>, 26th August 2008<br>
79
+ <a href="mailto:ruanwz@gmail.com">David Ruan</a>, 22nd August 2008<br>
78
80
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
79
81
  </p>
80
82
  </div>
@@ -38,6 +38,8 @@
38
38
  <a href="<%= download %>" class="numbers"><%= version %></a>
39
39
  </div>
40
40
  <%= body %>
41
+ <h2>Screencast</h2>
42
+ <object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/SxEZ1lhUDH4"> </param> <embed src="http://www.youtube.com/v/SxEZ1lhUDH4" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object>
41
43
  <p class="coda">
42
44
  <a href="mailto:ruanwz@gmail.com">David Ruan</a>, <%= modified.pretty %><br>
43
45
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sogoumap2pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ruan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-26 00:00:00 +08:00
12
+ date: 2008-09-02 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ email:
47
47
  - ruanwz@gmail.com
48
48
  executables:
49
49
  - sogoumap2pdf
50
+ - sogoumap2disk
50
51
  extensions: []
51
52
 
52
53
  extra_rdoc_files:
@@ -64,6 +65,7 @@ files:
64
65
  - README.txt
65
66
  - Rakefile
66
67
  - bin/sogoumap2pdf
68
+ - bin/sogoumap2disk
67
69
  - config/hoe.rb
68
70
  - config/requirements.rb
69
71
  - lib/sogoumap2pdf.rb