Permalink
Browse files

Add activity methods

  • Loading branch information...
1 parent 1bfed8d commit 68a5484278cb9ad9deb3702d954dbc8ac8316ae7 @sferik sferik committed Feb 18, 2012
Showing with 2,527 additions and 0 deletions.
  1. +25 −0 lib/gems/client.rb
  2. +1,376 −0 spec/fixtures/just_updated.yaml
  3. +1,098 −0 spec/fixtures/latest.yaml
  4. +28 −0 spec/gems/client_spec.rb
View
@@ -260,5 +260,30 @@ def unyank(gem_name, gem_version=nil, options={})
gem_version ||= info(gem_name)['version']
put("/api/v1/gems/unyank", options.merge(:gem_name => gem_name, :version => gem_version))
end
+
+ # Pulls the 50 gems most recently added to RubyGems.org (for the first time). Returns an array of the XML or JSON representation of the gems
+ #
+ # @authenticated false
+ # @param options [Hash] A customizable set of options.
+ # @return [Array]
+ # @example
+ # Gem.latest
+ def latest(options={})
+ response = get("/api/v1/activity/latest.yaml", options)
+ YAML.load(response)
+ end
+
+ # Pulls the 50 most recently updated gems. Returns an array of the XML or JSON representation of the gem versions
+ #
+ # @authenticated false
+ # @param options [Hash] A customizable set of options.
+ # @return [Array]
+ # @example
+ # Gem.just_updated
+ def just_updated(options={})
+ response = get("/api/v1/activity/just_updated.yaml", options)
+ YAML.load(response)
+ end
+
end
end
Oops, something went wrong.

0 comments on commit 68a5484

Please sign in to comment.