rubygems_snapshot 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +16 -2
- data/lib/commands/snapshot_command.rb +6 -1
- data/lib/rubygems_plugin.rb +0 -2
- metadata +2 -2
data/README.textile
CHANGED
@@ -1,17 +1,31 @@
|
|
1
1
|
h1. rubygems_snapshot
|
2
2
|
|
3
|
-
Adds snapshot command to gem. This command allow import/export
|
3
|
+
Adds snapshot command to gem. This command allow import/export gems.
|
4
4
|
|
5
5
|
h2. Description
|
6
6
|
|
7
7
|
This gem is a plugin for rubygems.
|
8
8
|
Based on ["Import/Export Patch":http://rubyforge.org/tracker/?atid=577&group_id=126&func=browse] from ["Peer Allan":http://rubyforge.org/users/pallan].
|
9
9
|
|
10
|
+
h2. Install/Usage
|
11
|
+
|
12
|
+
@gem install rubygems_snapshot@
|
13
|
+
Hosted at ["Gemcutter":http://gemcutter.org/gems/rubygems_snapshot]
|
14
|
+
|
15
|
+
After install, you can use:
|
16
|
+
|
17
|
+
@gem snapshot export result_file.yml@ to export your gems
|
18
|
+
|
19
|
+
@gem snapshot import file_exported.yml@ to import (install) gems.
|
20
|
+
|
21
|
+
*Important*: When importing, don't forget to use sudo if necessary.
|
22
|
+
*Important(2)*: When importing, pay attention to errors relative to native build. I don't know how to deal with that. :X
|
23
|
+
|
10
24
|
h2. License
|
11
25
|
|
12
26
|
(The MIT License)
|
13
27
|
|
14
|
-
Copyright (c)
|
28
|
+
Copyright (c) 2009 Roger Leite
|
15
29
|
|
16
30
|
Permission is hereby granted, free of charge, to any person obtaining
|
17
31
|
a copy of this software and associated documentation files (the
|
@@ -136,7 +136,7 @@ Describe here what snapshot does.
|
|
136
136
|
if action == "export"
|
137
137
|
filename = args[1] || "gems_#{Time.now.strftime("%Y%m%d_%H%M")}.yml"
|
138
138
|
filename = filename.downcase
|
139
|
-
filename.concat(".yml") unless
|
139
|
+
filename.concat(".yml") unless end_with?(filename, ".yml")
|
140
140
|
else
|
141
141
|
filename = args[1]
|
142
142
|
raise Gem::CommandLineError, "Snapshot needs an filename argument for import action.\nUsage:\n#{usage}" if filename.nil? or filename.empty?
|
@@ -146,5 +146,10 @@ Describe here what snapshot does.
|
|
146
146
|
[action, filename]
|
147
147
|
end
|
148
148
|
|
149
|
+
def end_with?(target, suffix)
|
150
|
+
suffix = suffix.to_s
|
151
|
+
target[-suffix.length, suffix.length] == suffix
|
152
|
+
end
|
153
|
+
|
149
154
|
end
|
150
155
|
|
data/lib/rubygems_plugin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems_snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Leite
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-05 00:00:00 -02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|