gemcutter 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/commands/tumble.rb +32 -0
- data/lib/rubygems_plugin.rb +2 -4
- metadata +9 -5
- data/lib/commands/downgrade.rb +0 -15
- data/lib/commands/upgrade.rb +0 -19
@@ -0,0 +1,32 @@
|
|
1
|
+
class Gem::Commands::TumbleCommand < Gem::Command
|
2
|
+
def description
|
3
|
+
'Enable or disable Gemcutter as your primary gem source.'
|
4
|
+
end
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super 'tumble', description
|
8
|
+
end
|
9
|
+
|
10
|
+
def execute
|
11
|
+
say "Thanks for using Gemcutter!"
|
12
|
+
tumble
|
13
|
+
show_sources
|
14
|
+
end
|
15
|
+
|
16
|
+
def tumble
|
17
|
+
if Gem.sources.include?(URL)
|
18
|
+
Gem.sources.delete URL
|
19
|
+
Gem.configuration.write
|
20
|
+
else
|
21
|
+
Gem.sources.unshift URL
|
22
|
+
Gem.configuration.write
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def show_sources
|
27
|
+
puts "Your gem sources are now:"
|
28
|
+
Gem.sources.each do |source|
|
29
|
+
puts "- #{source}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -2,12 +2,10 @@ $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
|
|
2
2
|
|
3
3
|
require 'rubygems/command_manager'
|
4
4
|
|
5
|
-
require 'commands/downgrade'
|
6
5
|
require 'commands/push'
|
7
|
-
require 'commands/
|
6
|
+
require 'commands/tumble'
|
8
7
|
|
9
|
-
Gem::CommandManager.instance.register_command :downgrade
|
10
8
|
Gem::CommandManager.instance.register_command :push
|
11
|
-
Gem::CommandManager.instance.register_command :
|
9
|
+
Gem::CommandManager.instance.register_command :tumble
|
12
10
|
|
13
11
|
URL = "http://gemcutter.org" unless defined?(URL)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemcutter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Quaranto
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-28 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,16 +22,20 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README.textile
|
24
24
|
files:
|
25
|
-
- lib/commands/downgrade.rb
|
26
25
|
- lib/commands/push.rb
|
27
|
-
- lib/commands/
|
26
|
+
- lib/commands/tumble.rb
|
28
27
|
- lib/rubygems_plugin.rb
|
29
28
|
- README.textile
|
30
29
|
has_rdoc: true
|
31
30
|
homepage: http://github.com/qrush/gemcutter
|
32
31
|
licenses: []
|
33
32
|
|
34
|
-
post_install_message:
|
33
|
+
post_install_message: |+
|
34
|
+
|
35
|
+
=======================================================================
|
36
|
+
Thanks for installing Gemcutter! To get started, please run: gem tumble
|
37
|
+
=======================================================================
|
38
|
+
|
35
39
|
rdoc_options:
|
36
40
|
- --charset=UTF-8
|
37
41
|
require_paths:
|
data/lib/commands/downgrade.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
class Gem::Commands::DowngradeCommand < Gem::Command
|
2
|
-
def description
|
3
|
-
'Return to using RubyForge as your primary gem source'
|
4
|
-
end
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
super 'downgrade', description
|
8
|
-
end
|
9
|
-
|
10
|
-
def execute
|
11
|
-
say "Your primary gem source is now gems.rubyforge.org"
|
12
|
-
Gem.sources.delete URL
|
13
|
-
Gem.configuration.write
|
14
|
-
end
|
15
|
-
end
|
data/lib/commands/upgrade.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
class Gem::Commands::UpgradeCommand < Gem::Command
|
2
|
-
def description
|
3
|
-
'Upgrade your gem source to Gemcutter'
|
4
|
-
end
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
super 'upgrade', description
|
8
|
-
end
|
9
|
-
|
10
|
-
def execute
|
11
|
-
if Gem.sources.include?(URL)
|
12
|
-
say "Gemcutter is already your primary gem source. Please use `gem downgrade` if you wish to no longer use Gemcutter."
|
13
|
-
else
|
14
|
-
Gem.sources.unshift URL
|
15
|
-
Gem.configuration.write
|
16
|
-
say "Your primary gem source is now gemcutter.org"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|