Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adds snapshot command to gem. This command allow import/export of gems.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 features
Octocat-spinner-32 guides
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 tasks
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rubygems_snapshot.gemspec
README.textile

Snapshot: A Rubygems plugin

Export and Import your gems.
Snapshot, copy your current gems in a single file, providing a fast and secure way to import your gems anywhere.

Tested with:

  • ruby-1.8.6-p399 [ i386 ]
  • ruby-1.8.7-p249 [ i386 ]
  • 1.3.6 gem version

Version 1 was based on Import/Export Patch from Peer Allan.

Install/Usage

gem install rubygems_snapshot

After install, you can use:

gem snapshot export gems.tar to export your gems

gem snapshot import gems.tar to import (install) gems.

Important: When importing, don’t forget to use sudo if necessary and pay attention to errors relative to native build.
I don’t know how to deal with that yet! :X
Hosted at Gemcutter

Others formats

Nowadays, it supports two formats:

  • tar (default)
  • yml

You can chose the format, using -f parameter. For example:

gem snapshot export gems.yml -f yml
gem snapshot import gems.yml -f yml

For aditional help, execute:
gem help snapshot

How it Works?

It’s very simple.
When exporting, get all gems (like “gem list”), puts in a yml file.
If gem file exists at cache folder from rubygems, copy to tar file too. (tar format)

When importing, copy all gems to rubygems cache folder.
Read the yml file, install the gem file from cache folder or do a simple “gem install” if gem file does not exists.

For Developers

Using as API

require "rubygems"
GemsSnapshot::Exporter.export("example.tar", :format => :tar)

require "rubygems"
GemsSnapshot::Importer.import("example.tar", :format => :tar)

Use the sources Luke!

If you want help to improve Snapshot, after git clone, you’ll need the following gems:

  • rake
  • rspec
  • cucumber

Use “rake -T” to see the available tasks.
I highly recomend using RVM during development.
Anything, questions, suggestions etc., send me message or leave a issue.

License

(The MIT License)

Copyright © 2009 Roger Leite

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
‘Software’), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
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.

Something went wrong with that request. Please try again.