forked from oauth-xx/oauth-ruby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of http://github.com/oauth/oauth-ruby into oaut…
…h-ruby Conflicts: HISTORY Rakefile lib/oauth/helper.rb lib/oauth/signature/plaintext.rb oauth.gemspec test/test_action_controller_request_proxy.rb test/test_signature.rb
- Loading branch information
Showing
59 changed files
with
1,636 additions
and
2,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pkg/* | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
%w[rubygems rake rake/clean fileutils].each { |f| require f } | ||
%w[rubygems rake rake/clean rake/testtask fileutils].each { |f| require f } | ||
$LOAD_PATH << File.dirname(__FILE__) + '/lib' | ||
require 'oauth' | ||
require 'oauth/version' | ||
|
||
begin | ||
require 'hoe' | ||
require 'newgem' | ||
require 'rubigen' | ||
|
||
# Generate all the Rake tasks | ||
# Run 'rake -T' to see list of generated tasks (from gem root directory) | ||
$hoe = Hoe.new('oauth', OAuth::VERSION) do |p| | ||
p.author = ['Pelle Braendgaard','Blaine Cook','Larry Halff','Jesse Clark','Jon Crosby', 'Seth Fitzsimmons'] | ||
p.email = "oauth-ruby@googlegroups.com" | ||
p.description = "OAuth Core Ruby implementation" | ||
p.summary = p.description | ||
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n") | ||
p.rubyforge_name = p.name # TODO this is default value | ||
p.url = "http://oauth.rubyforge.org" | ||
|
||
p.extra_deps = [ | ||
['ruby-hmac','>= 0.3.1'] | ||
] | ||
p.extra_dev_deps = [ | ||
['newgem', ">= #{::Newgem::VERSION}"], | ||
['actionpack'], | ||
['rack'] | ||
] | ||
|
||
p.clean_globs |= %w[**/.DS_Store tmp *.log **/.*.sw? *.gem .config **/.DS_Store] | ||
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}" | ||
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc') | ||
p.rsync_args = '-av --delete --ignore-errors' | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |s| | ||
s.name = %q{oauth} | ||
s.version = OAuth::VERSION | ||
s.authors = ["Pelle Braendgaard", "Blaine Cook", "Larry Halff", "Jesse Clark", "Jon Crosby", "Seth Fitzsimmons", "Matt Sanford", "Aaron Quint"] | ||
s.email = "oauth-ruby@googlegroups.com" | ||
s.description = "OAuth Core Ruby implementation" | ||
s.summary = s.description | ||
s.rubyforge_project = %q{oauth} | ||
s.add_development_dependency(%q<actionpack>, [">= 2.2.0", "<2.3.0"]) | ||
s.add_development_dependency(%q<rack>, [">= 1.0.0"]) | ||
s.add_development_dependency(%q<mocha>, [">= 0.9.8"]) | ||
s.add_development_dependency(%q<typhoeus>, [">= 0.1.13"]) | ||
s.add_development_dependency(%q<em-http-request>) | ||
s.add_development_dependency(%q<curb>, [">= 0.6.6.0"]) | ||
end | ||
|
||
require 'newgem/tasks' # load /tasks/*.rake | ||
Jeweler::GemcutterTasks.new | ||
rescue LoadError | ||
puts "hoe not available" | ||
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" | ||
end | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << "test" | ||
t.test_files = FileList['test/*test*.rb'] | ||
t.verbose = true | ||
end | ||
|
||
Dir['tasks/**/*.rake'].each { |t| load t } | ||
|
||
# TODO - want other tests/tasks run by default? Add them to the list | ||
# task :default => [:spec, :features] | ||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env ruby -w -rubygems | ||
#!/usr/bin/env ruby | ||
|
||
require "oauth/cli" | ||
|
||
OAuth::CLI.execute(STDOUT, STDIN, STDERR, ARGV) | ||
OAuth::CLI.execute(STDOUT, STDIN, STDERR, ARGV) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# = digest/hmac.rb | ||
# | ||
# An implementation of HMAC keyed-hashing algorithm | ||
# | ||
# == Overview | ||
# | ||
# This library adds a method named hmac() to Digest classes, which | ||
# creates a Digest class for calculating HMAC digests. | ||
# | ||
# == Examples | ||
# | ||
# require 'digest/hmac' | ||
# | ||
# # one-liner example | ||
# puts Digest::HMAC.hexdigest("data", "hash key", Digest::SHA1) | ||
# | ||
# # rather longer one | ||
# hmac = Digest::HMAC.new("foo", Digest::RMD160) | ||
# | ||
# buf = "" | ||
# while stream.read(16384, buf) | ||
# hmac.update(buf) | ||
# end | ||
# | ||
# puts hmac.bubblebabble | ||
# | ||
# == License | ||
# | ||
# Copyright (c) 2006 Akinori MUSHA <knu@iDaemons.org> | ||
# | ||
# Documentation by Akinori MUSHA | ||
# | ||
# All rights reserved. You can redistribute and/or modify it under | ||
# the same terms as Ruby. | ||
# | ||
# $Id: hmac.rb 14881 2008-01-04 07:26:14Z akr $ | ||
# | ||
|
||
require 'digest' | ||
|
||
unless defined?(Digest::HMAC) | ||
module Digest | ||
class HMAC < Digest::Class | ||
def initialize(key, digester) | ||
@md = digester.new | ||
|
||
block_len = @md.block_length | ||
|
||
if key.bytesize > block_len | ||
key = @md.digest(key) | ||
end | ||
|
||
ipad = Array.new(block_len).fill(0x36) | ||
opad = Array.new(block_len).fill(0x5c) | ||
|
||
key.bytes.each_with_index { |c, i| | ||
ipad[i] ^= c | ||
opad[i] ^= c | ||
} | ||
|
||
@key = key.freeze | ||
@ipad = ipad.inject('') { |s, c| s << c.chr }.freeze | ||
@opad = opad.inject('') { |s, c| s << c.chr }.freeze | ||
@md.update(@ipad) | ||
end | ||
|
||
def initialize_copy(other) | ||
@md = other.instance_eval { @md.clone } | ||
end | ||
|
||
def update(text) | ||
@md.update(text) | ||
self | ||
end | ||
alias << update | ||
|
||
def reset | ||
@md.reset | ||
@md.update(@ipad) | ||
self | ||
end | ||
|
||
def finish | ||
d = @md.digest! | ||
@md.update(@opad) | ||
@md.update(d) | ||
@md.digest! | ||
end | ||
private :finish | ||
|
||
def digest_length | ||
@md.digest_length | ||
end | ||
|
||
def block_length | ||
@md.block_length | ||
end | ||
|
||
def inspect | ||
sprintf('#<%s: key=%s, digest=%s>', self.class.name, @key.inspect, @md.inspect.sub(/^\#<(.*)>$/) { $1 }); | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.