export 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +9 -0
- data/README.markdown +8 -0
- data/Rakefile +35 -0
- data/VERSION +1 -0
- data/lib/rubygems/commands/export_command.rb +35 -0
- data/rubygems_plugin.rb +2 -0
- data/test/export_command_test.rb +16 -0
- metadata +70 -0
data/CHANGELOG.rdoc
ADDED
data/README.markdown
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |s|
|
8
|
+
s.name = "export"
|
9
|
+
s.summary = "Gem Command to export installed gems to a YAML file."
|
10
|
+
s.description = <<-DESC
|
11
|
+
Export installed gems to a YAML file.
|
12
|
+
DESC
|
13
|
+
s.email = "thewoolleyman@gmail.com"
|
14
|
+
s.homepage = "http://export.rubyforge.org"
|
15
|
+
s.rubyforge_project = "export"
|
16
|
+
s.authors = ["Chad Woolley"]
|
17
|
+
s.has_rdoc = false
|
18
|
+
s.files = FileList["CHANGELOG.rdoc","lib/rubygems/commands/export_command.rb","Rakefile","README.markdown","rubygems_plugin.rb","test/export_command_test.rb","VERSION"]
|
19
|
+
|
20
|
+
# Testings
|
21
|
+
s.test_files = FileList["test/**/*_test.rb"]
|
22
|
+
s.add_development_dependency 'mocha', '~> 0.9.5'
|
23
|
+
end
|
24
|
+
|
25
|
+
rescue LoadError
|
26
|
+
puts "Jeweler not available. Install it for jeweler-related tasks with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
27
|
+
end
|
28
|
+
|
29
|
+
Rake::TestTask.new do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
task :default => :test
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'geminstaller'
|
2
|
+
|
3
|
+
class Gem::Commands::ExportCommand < Gem::Command
|
4
|
+
#new, #execute, #arguments, #defaults_str, #description and #usage
|
5
|
+
|
6
|
+
def initialize # :nodoc:
|
7
|
+
super 'export', 'Export installed gems to a yaml file format'
|
8
|
+
end
|
9
|
+
|
10
|
+
def execute # :nodoc:
|
11
|
+
puts "Exporting to gems.yml"
|
12
|
+
# TODO: This is a huge hack to work with current version of GemInstaller. Need to modify
|
13
|
+
# geminstaller to have a proper --export [FILE] option to export all installed gems
|
14
|
+
# to a specified yaml file, with no required input geminstaller.yml file
|
15
|
+
system('touch /tmp/gems-to-exclude.yml') || raise
|
16
|
+
output = `geminstaller --print-rogue-gems --config=/tmp/gems-to-exclude.yml`
|
17
|
+
File.open('gems.yml', 'w') {|f| f.write(output) }
|
18
|
+
end
|
19
|
+
|
20
|
+
def arguments # :nodoc:
|
21
|
+
""
|
22
|
+
end
|
23
|
+
|
24
|
+
def description # :nodoc:
|
25
|
+
<<-EOF
|
26
|
+
Exports all installed gems to a YAML file
|
27
|
+
EOF
|
28
|
+
end
|
29
|
+
|
30
|
+
def usage # :nodoc:
|
31
|
+
"#{program_name}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Gem::CommandManager.instance.register_command :export
|
data/rubygems_plugin.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'mocha'
|
4
|
+
|
5
|
+
require 'rubygems/commands/export_command'
|
6
|
+
require 'rubygems/exceptions'
|
7
|
+
|
8
|
+
class ExportCommandTest < Test::Unit::TestCase
|
9
|
+
def test_export__really_lame_test__needs_rewrite
|
10
|
+
command = Gem::Commands::ExportCommand.new
|
11
|
+
|
12
|
+
command.expects(:execute)
|
13
|
+
|
14
|
+
command.invoke
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: export
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chad Woolley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-11 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: mocha
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.9.5
|
24
|
+
version:
|
25
|
+
description: " Export installed gems to a YAML file.\n"
|
26
|
+
email: thewoolleyman@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.markdown
|
33
|
+
files:
|
34
|
+
- CHANGELOG.rdoc
|
35
|
+
- README.markdown
|
36
|
+
- Rakefile
|
37
|
+
- VERSION
|
38
|
+
- lib/rubygems/commands/export_command.rb
|
39
|
+
- rubygems_plugin.rb
|
40
|
+
- test/export_command_test.rb
|
41
|
+
has_rdoc: true
|
42
|
+
homepage: http://export.rubyforge.org
|
43
|
+
licenses: []
|
44
|
+
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options:
|
47
|
+
- --charset=UTF-8
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project: export
|
65
|
+
rubygems_version: 1.3.3
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Gem Command to export installed gems to a YAML file.
|
69
|
+
test_files:
|
70
|
+
- test/export_command_test.rb
|