sogoumap2pdf 0.0.9 → 0.0.10
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/History.txt +4 -0
- data/Manifest.txt +2 -0
- data/TODO +1 -0
- data/bin/sogoumap2pdf_from_disk +59 -0
- data/lib/sogoumap2pdf/version.rb +1 -1
- data/website/index.html +1 -2
- data/website/index.txt +0 -2
- metadata +5 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -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])
|
data/lib/sogoumap2pdf/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -59,7 +59,6 @@ sogoumap2pdf link x_pixels x y_pixels row x column save_file.pdf <s|sp|m>
|
|
59
59
|
<li><a href="http://rubyforge.org/frs/download.php/41583/guangzhou.pdf">Example map</a></li>
|
60
60
|
</ul>
|
61
61
|
<p>The trunk repository is <code>git://rubyforge.org/sogoumap2pdf.git</code> for anonymous access.</p>
|
62
|
-
<p><span class="caps">OOOORRRR</span></p>
|
63
62
|
<p>You can fetch the source from:</p>
|
64
63
|
<ul>
|
65
64
|
<li>rubyforge: <a href="http://rubyforge.org/scm/?group_id=6825">http://rubyforge.org/scm/?group_id=6825</a></li>
|
@@ -76,7 +75,7 @@ rake install_gem</pre>
|
|
76
75
|
<h2>Screencast</h2>
|
77
76
|
<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>
|
78
77
|
<p class="coda">
|
79
|
-
<a href="mailto:ruanwz@gmail.com">David Ruan</a>,
|
78
|
+
<a href="mailto:ruanwz@gmail.com">David Ruan</a>, 2nd September 2008<br>
|
80
79
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
81
80
|
</p>
|
82
81
|
</div>
|
data/website/index.txt
CHANGED
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.
|
4
|
+
version: 0.0.10
|
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-09-
|
12
|
+
date: 2008-09-09 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -48,6 +48,7 @@ email:
|
|
48
48
|
executables:
|
49
49
|
- sogoumap2pdf
|
50
50
|
- sogoumap2disk
|
51
|
+
- sogoumap2pdf_from_disk
|
51
52
|
extensions: []
|
52
53
|
|
53
54
|
extra_rdoc_files:
|
@@ -64,8 +65,10 @@ files:
|
|
64
65
|
- PostInstall.txt
|
65
66
|
- README.txt
|
66
67
|
- Rakefile
|
68
|
+
- TODO
|
67
69
|
- bin/sogoumap2pdf
|
68
70
|
- bin/sogoumap2disk
|
71
|
+
- bin/sogoumap2pdf_from_disk
|
69
72
|
- config/hoe.rb
|
70
73
|
- config/requirements.rb
|
71
74
|
- lib/sogoumap2pdf.rb
|