g5gem 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGELOG +5 -0
  2. data/README +7 -0
  3. data/bin/g5gem +22 -1
  4. data/lib/g5gem/version.rb +1 -1
  5. data/lib/g5gem.rb +12 -0
  6. metadata +5 -4
data/CHANGELOG ADDED
@@ -0,0 +1,5 @@
1
+ == 0.1.1
2
+ Added `yank` support
3
+
4
+ == 0.1.0
5
+ Initial Release
data/README CHANGED
@@ -1 +1,8 @@
1
1
  g5gem - making it easier to deploy our gems
2
+
3
+
4
+ Install:
5
+ gem install g5gem
6
+
7
+ Usage
8
+ g5gem release <path/to/.gem/file>
data/bin/g5gem CHANGED
@@ -4,16 +4,37 @@ require 'g5gem'
4
4
  require 'thor'
5
5
 
6
6
  class App < Thor
7
+ #helpers
8
+ no_tasks do
9
+ def is_gem?(name)
10
+ name[-3,3] == 'gem'
11
+ end
12
+ end
13
+
7
14
  desc "release GEM", "release gem to uranus"
8
15
  method_options :force => :boolean
9
16
  def release(name)
10
- if name[-3,3] == 'gem'
17
+ if is_gem?(name)
11
18
  G5gem.transer_file_to_server(name)
12
19
  G5gem.rebuild_index
13
20
  say "#{name} deployed", :green
14
21
  else
15
22
  say "Sorry dude. Needs to be a gem", :red
16
23
  end
24
+ end
25
+
26
+ desc "yank GEM", "yank gem from uranus"
27
+ def yank(name)
28
+ if is_gem?(name)
29
+ G5gem.yank_gem_from_server(name)
30
+ #Rebuild just in case the index got f'd up
31
+ G5gem.rebuild_index
32
+ say "#{name} removed\n", :green
33
+ say "Gems on server:", :green
34
+ G5gem.list_gems
35
+ else
36
+ say "Sorry dude. Needs to be a gem", :red
37
+ end
17
38
  end
18
39
  end
19
40
  App.start
data/lib/g5gem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module G5gem
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/g5gem.rb CHANGED
@@ -13,4 +13,16 @@ module G5gem
13
13
  ssh.exec "/usr/bin/gem generate_index -d /shared/gems"
14
14
  end
15
15
  end
16
+
17
+ def self.list_gems
18
+ Net::SSH.start("util1", "g5search") do |ssh|
19
+ ssh.exec "ls -1 /shared/gems/gems"
20
+ end
21
+ end
22
+
23
+ def self.yank_gem_from_server(gem)
24
+ Net::SSH.start("util1", "g5search") do |ssh|
25
+ ssh.exec "rm /shared/gems/gems/#{gem}"
26
+ end
27
+ end
16
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5gem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mark Turner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-26 00:00:00 -08:00
18
+ date: 2011-01-28 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - .gitignore
64
64
  - .rvmrc
65
+ - CHANGELOG
65
66
  - Gemfile
66
67
  - README
67
68
  - Rakefile