Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


added functionality to permit get the latest version of a gem #29

merged 1 commit into from

2 participants


I had an issue when using stickler with puppet trying to get puppet to install the latest version of a gem, with this feature i can get the latest version of a gem a get it to be installed by puppet.

I think is a useful functionality to use with puppet.


This sounds reasonable, and i'm trying to understand your use case. You are using stickler last-version <gemname> as test in puppet to see what the latest version is so you can see if puppet should install a new version of the gem? Could you get the same effect if you just used gem list -r <gemname> and parsed the output?


Yeah the gem list -r <gemname> gives the same result but not like the stickler last-version <gemname> it will need some parsing. The problem is that puppet doesn't know how to get the latest version if you don't specify it manually like 0.0.12, if you use ensure => latest in puppet it something get you versions like '' .


Alright, sounds reasonable, I'll merge this in soon.


Great, thanks :)


this will go into the next version

@copiousfreetime copiousfreetime merged commit fee2a53 into copiousfreetime:master

I did some mucking around with this to bring it in line the other commands and normalized it to 'latest-version'


this is now included with the released 2.4 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  bin/stickler
@@ -56,5 +56,7 @@ when "config" ARGV ).run
when "list" ARGV ).run
+when "last-version"
1  lib/stickler/client.rb
@@ -49,3 +49,4 @@ def remote_repo_for( opts )
require 'stickler/client/push'
require 'stickler/client/unyank'
require 'stickler/client/yank'
+require 'stickler/client/last-version'
33 lib/stickler/client/last-version.rb
@@ -0,0 +1,33 @@
+module Stickler
+ class Client
+ class Version < Stickler::Client
+ def self.banner
+ <<-_
+List the gems in the stickler server with repository information.
+Usage: stickler list
+ Options:
+ _
+ end
+ def run
+ begin
+ raise Stickler::Repository::Error, 'last-version option needs an argument (gem name)' if self.argv.first.nil?
+ opts = parse(self.argv)
+ repo = remote_repo_for(opts)
+ hashversions = {}
+ repo.specs_list.each do |name, version|
+, "#{version}")
+ end
+ lastversion = hashversions[self.argv.first]
+ raise Stickler::Repository::Error, 'Gem doesn\'t exist in the server.' if lastversion.nil?
+ puts lastversion
+ return lastversion
+ rescue Stickler::Repository::Error => e
+ $stdout.puts "ERROR: #{e.message}"
+ end
+ end
+ end
+ end
3  man/stickler.1.ronn
@@ -45,6 +45,9 @@ COMMANDS
Put a gem that was _yanked_ back into the gemserver index. This reverses a
+ Prints the latest version of a gem
These are the options for all commands. Not all options apply to all commands.
Something went wrong with that request. Please try again.