sogoumap2pdf 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +1 -0
- data/bin/sogoumap2disk +59 -0
- data/lib/sogoumap2pdf/version.rb +1 -1
- data/website/index.html +4 -2
- data/website/template.html.erb +2 -0
- metadata +4 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/bin/sogoumap2disk
ADDED
@@ -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
@@ -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.
|
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>,
|
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>
|
data/website/template.html.erb
CHANGED
@@ -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.
|
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-
|
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
|