Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed README.rdoc content

  • Loading branch information...
commit 21029aaff1f1ae2c7320c4e1d344c08a25af9f31 1 parent 040230a
@bearmini authored
View
1  .gitignore
@@ -1 +1,2 @@
+pkg/
snapshot.png
View
4 PostInstall.txt
@@ -1,7 +1,3 @@
For more information on websnapshot, see http://websnapshot.rubyforge.org
-NOTE: Change this information in PostInstall.txt
-You can also delete it if you don't want it.
-
-
View
22 README.rdoc
@@ -1,26 +1,34 @@
= websnapshot
-* http://github.com/#{github_username}/#{project_name}
+* http://github.com/bearmini/websnapshot
== DESCRIPTION:
-FIX (describe your package)
+This is an application and a library to capture images of web pages.
== FEATURES/PROBLEMS:
-* FIX (list of features or problems)
+* You can take a snapshot image of an web page.
+* You can specify dimensions of an artifact image.
+* You can specify delay before taking a snapshot. (not implemented yet. planed)
== SYNOPSIS:
- FIX (code sample of usage)
+ $ websnapshot http://google.com
== REQUIREMENTS:
-* FIX (list of requirements)
+* For Ubuntu
+ $ sudo apt-get install ruby-gnome2-dev webkit-1.0 libgtk2.0-dev
+
+* For Mac OS X
+ $ sudo port install rb-gnome webkit-gtk
+ (You may be need Xcode installed)
+
== INSTALL:
-* FIX (sudo gem install, anything else)
+* sudo gem install websnapshot
== LICENSE:
@@ -45,4 +53,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2  Rakefile
@@ -14,7 +14,7 @@ $hoe = Hoe.spec 'websnapshot' do
self.developer 'Takashi Oguma', 'bear.mini@gmail.com'
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
self.rubyforge_name = self.name # TODO this is default value
- # self.extra_deps = [['activesupport','>= 2.0.2']]
+ self.extra_deps = [['gtk2','>= 0.90.8']]
end
View
53 lib/websnapshot/cli.rb
@@ -7,41 +7,48 @@ module Websnapshot
class CLI
def self.execute(stdout, arguments=[])
- # NOTE: the option -p/--path= is given as an example, and should be replaced in your application.
-
options = {
- #:path => '~'
+ :max_width => 960,
+ :max_height => 640,
}
mandatory_options = %w( )
parser = OptionParser.new do |opts|
- #opts.banner = <<-BANNER.gsub(/^ /,'')
- # This application is wonderful because...
- #
- # Usage: #{File.basename($0)} [options]
- #
- # Options are:
- #BANNER
- #opts.separator ""
- #opts.on("-p", "--path PATH", String,
- # "This is a sample message.",
- # "For multiple lines, add more strings.",
- # "Default: ~") { |arg| options[:path] = arg }
- #opts.on("-h", "--help",
- # "Show this help message.") { stdout.puts opts; exit }
+ opts.banner = <<-BANNER.gsub(/^ /,'')
+ This is an application to capture snapshot images of web pages.
+
+ Usage: #{File.basename($0)} [options] [URL]...
+
+ Options are:
+ BANNER
+ opts.separator ""
+ opts.on("-x", "--max-width WIDTH", Integer,
+ "Maximum width (in pixels) of an artifact image.",
+ "If the page you want to take an snapshot image has ",
+ "width less than the specified value, the original size",
+ "will be preserved.",
+ "Default: 960") { |arg| options[:max_width] = arg }
+ opts.on("-y", "--max-height HEIGHT", Integer,
+ "Maximum height (in pixels) of an artifact image.",
+ "If the page you want to take an snapshot image has ",
+ "height less than the specified value, the original size",
+ "will be preserved.",
+ "Default: 640") { |arg| options[:max_height] = arg }
+ opts.on("-h", "--help",
+ "Show this help message.") { stdout.puts opts; exit }
+ opts.on("-v", "--version",
+ "Show the version number of this application.") { stdout.puts Websnapshot::VERSION; exit }
opts.parse!(arguments)
- if mandatory_options && mandatory_options.find { |option| options[option.to_sym].nil? }
+ if (mandatory_options && mandatory_options.find { |option| options[option.to_sym].nil? }) || arguments.length == 0
stdout.puts opts; exit
end
end
- path = options[:path]
-
# do stuff
- #stdout.puts "To update this executable, look in lib/websnapshot/cli.rb"
-
- Websnapshot::take(arguments[0])
+ arguments.each do |url|
+ Websnapshot::take(url, options)
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.