Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lock dependency on activesupport to 2.3.x

  • Loading branch information...
commit 99633b936cdaf877f1b753eaff06cb0f4cd90913 1 parent ee6f7e9
@reagent reagent authored
Showing with 17 additions and 15 deletions.
  1. +1 −1  Rakefile
  2. +16 −14 lib/fleakr.rb
View
2  Rakefile
@@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test}/**/*")
s.add_dependency('hpricot', '>= 0.6.164')
- s.add_dependency('activesupport', '>= 2.0')
+ s.add_dependency('activesupport', '~> 2.3.0')
s.add_dependency('loggable', '>= 0.2.0')
end
View
30 lib/fleakr.rb
@@ -1,5 +1,7 @@
$:.unshift(File.dirname(__FILE__))
+gem 'activesupport', '~> 2.3.0'
+
require 'uri'
require 'cgi'
require 'net/http'
@@ -36,7 +38,7 @@
# == Quick Start
#
# Getting started is easy, just make sure you have a valid API key from Flickr and you can
-# then start making any non-authenticated request to pull back data for yours and others'
+# then start making any non-authenticated request to pull back data for yours and others'
# photostreams, sets, contacts, groups, etc...
#
# For now, all activity originates from a single user which you can find by username or
@@ -57,10 +59,10 @@
# user.groups
#
# To see what other associations and attributes are available, see the Fleakr::Objects::User class
-#
+#
# == Authentication
#
-# If you want to do something more than just retrieve public photos (like upload your own),
+# If you want to do something more than just retrieve public photos (like upload your own),
# you'll need to generate an authentication token to use across requests and sessions.
#
# Assuming you've already applied for a key, go back and make sure you have the right settings
@@ -71,7 +73,7 @@
# 1. The value for 'Mobile Permissions' is set to either 'write' or 'delete'
#
# Once this is set, you'll see your Authentication URL on the key details page (it will look
-# something like http://www.flickr.com/auth-534525246245). Paste this URL into your browser and
+# something like http://www.flickr.com/auth-534525246245). Paste this URL into your browser and
# confirm access to get your mini-token. Now you're ready to make authenticated requests:
#
# require 'rubygems'
@@ -83,7 +85,7 @@
#
# Fleakr.upload('/path/to/my/photo.jpg')
# Fleakr.token.value # => "34132412341235-12341234ef34"
-#
+#
# Once you use the mini-token once, it is no longer available. To use the generated auth_token
# for future requests, just set Fleakr.auth_token to the generated value.
#
@@ -103,7 +105,7 @@ class ApiError < StandardError; end
# Fleakr.user('user@host.com')
# Fleakr.user('http://www.flickr.com/photos/the_decapitator/')
#
-
+
# TODO: Use User.find_by_identifier for some of this
def self.user(user_data, options = {})
user = nil
@@ -114,7 +116,7 @@ def self.user(user_data, options = {})
end
user
end
-
+
# Search all photos on the Flickr site. By default, this searches based on text, but you can pass
# different search parameters (passed as hash keys):
#
@@ -129,7 +131,7 @@ def self.search(params)
params = {:text => params} unless params.is_a?(Hash)
Objects::Search.new(params).results
end
-
+
# Upload one or more files to your Flickr account (requires authentication). Simply provide
# a filename or a pattern to upload one or more files:
#
@@ -137,13 +139,13 @@ def self.search(params)
# Fleakr.upload('/User/Pictures/Party/*.jpg')
#
# Additionally, options can be supplied as part of the upload that will apply to all files
- # that are matched by the pattern passed to <tt>glob</tt>. For a full list, see
+ # that are matched by the pattern passed to <tt>glob</tt>. For a full list, see
# Fleakr::Objects::Photo.
#
def self.upload(glob, options = {})
Dir[glob].map {|file| Fleakr::Objects::Photo.upload(file, options) }
end
-
+
# Get all contacts for the currently authenticated user. The provided contact type can be
# one of the following:
#
@@ -161,11 +163,11 @@ def self.contacts(contact_type = nil, additional_options = {})
options = {}
options.merge!(:filter => contact_type) unless contact_type.nil?
options.merge!(additional_options)
-
+
Fleakr::Objects::Contact.find_all(options)
end
- # Generate an authorization URL to redirect users to. This defaults to
+ # Generate an authorization URL to redirect users to. This defaults to
# 'read' permission, but others are available when passed to this method:
#
# * :read - permission to read private information (default)
@@ -183,7 +185,7 @@ def self.authorization_url(permissions = :read)
def self.token_from_frob(frob)
Fleakr::Objects::AuthenticationToken.from_frob(frob)
end
-
+
# Exchange a mini token for an authentication token.
#
def self.token_from_mini_token(mini_token)
@@ -197,7 +199,7 @@ def self.user_for_token(auth_token)
token = Fleakr::Objects::AuthenticationToken.from_auth_token(auth_token)
token.user
end
-
+
def self.resource_from_url(url)
Fleakr::Objects::Url.new(url).resource
end
Please sign in to comment.
Something went wrong with that request. Please try again.