simple_oauth 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,22 +1,4 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
1
+ .bundle
17
2
  coverage
18
- rdoc
19
3
  pkg
20
-
21
- ## PROJECT::SPECIFIC
22
- .bundle
4
+ rdoc
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_oauth (0.1.0)
4
+ simple_oauth (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- mocha (0.9.8)
9
+ mocha (0.9.9)
10
10
  rake
11
11
  rake (0.8.7)
12
12
 
data/Rakefile CHANGED
@@ -1,26 +1,9 @@
1
- require './lib/simple_oauth'
2
- require 'rubygems'
3
1
  require 'rake'
4
2
  require 'rake/testtask'
5
3
  require 'rake/rdoctask'
4
+ require 'bundler'
6
5
 
7
- begin
8
- require 'jeweler'
9
- Jeweler::Tasks.new do |gem|
10
- gem.name = 'simple_oauth'
11
- gem.version = SimpleOAuth::Version::STRING
12
- gem.summary = 'Simply builds and verifies OAuth headers'
13
- gem.description = 'Simply builds and verifies OAuth headers'
14
- gem.email = 'steve.richert@gmail.com'
15
- gem.homepage = 'http://github.com/laserlemon/simple_oauth'
16
- gem.authors = ['Steve Richert']
17
- gem.add_development_dependency 'mocha'
18
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
- end
20
- Jeweler::GemcutterTasks.new
21
- rescue LoadError
22
- puts 'Jeweler is not available. Install it with: gem install jeweler'
23
- end
6
+ Bundler::GemHelper.install_tasks
24
7
 
25
8
  Rake::TestTask.new do |test|
26
9
  test.libs << 'lib' << 'test'
@@ -28,10 +11,16 @@ Rake::TestTask.new do |test|
28
11
  test.verbose = true
29
12
  end
30
13
 
31
- task :test => :check_dependencies
32
-
33
14
  task :default => :test
34
15
 
16
+ Rake::RDocTask.new do |rdoc|
17
+ version = SimpleOAuth::Version::STRING
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.title = "simple_oauth #{version}"
20
+ rdoc.rdoc_files.include('README*')
21
+ rdoc.rdoc_files.include('lib/**/*.rb')
22
+ end
23
+
35
24
  begin
36
25
  require 'rcov/rcovtask'
37
26
  Rcov::RcovTask.new do |rcov|
@@ -46,10 +35,14 @@ rescue LoadError
46
35
  end
47
36
  end
48
37
 
49
- Rake::RDocTask.new do |rdoc|
50
- version = SimpleOAuth::Version::STRING
51
- rdoc.rdoc_dir = 'rdoc'
52
- rdoc.title = "simple_oauth #{version}"
53
- rdoc.rdoc_files.include('README*')
54
- rdoc.rdoc_files.include('lib/**/*.rb')
38
+ def gemspec
39
+ @gemspec ||= begin
40
+ file = File.expand_path('../simple_oauth.gemspec', __FILE__)
41
+ eval(File.read(file), binding, file)
42
+ end
43
+ end
44
+
45
+ desc 'Validate the gemspec'
46
+ task :gemspec do
47
+ gemspec.validate
55
48
  end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
@@ -7,7 +7,7 @@ module SimpleOAuth
7
7
  module Version
8
8
  MAJOR = 0
9
9
  MINOR = 1
10
- PATCH = 1
10
+ PATCH = 2
11
11
  STRING = [MAJOR, MINOR, PATCH].join('.')
12
12
  end
13
13
 
@@ -24,7 +24,7 @@ module SimpleOAuth
24
24
  end
25
25
 
26
26
  def self.encode(value)
27
- URI.encode(value.to_s, /[^\w\-\.\~]/)
27
+ URI.encode(value.to_s, /[^a-z0-9\-\.\_\~]/i)
28
28
  end
29
29
 
30
30
  def self.decode(value)
@@ -67,15 +67,15 @@ module SimpleOAuth
67
67
  valid
68
68
  end
69
69
 
70
+ def signed_attributes
71
+ attributes.merge(:oauth_signature => signature)
72
+ end
73
+
70
74
  private
71
75
  def normalized_attributes
72
76
  signed_attributes.sort_by{|k,v| k.to_s }.map{|k,v| %(#{k}="#{self.class.encode(v)}") }.join(', ')
73
77
  end
74
78
 
75
- def signed_attributes
76
- attributes.merge(:oauth_signature => signature)
77
- end
78
-
79
79
  def attributes
80
80
  ATTRIBUTE_KEYS.inject({}){|a,k| options.key?(k) ? a.merge(:"oauth_#{k}" => options[k]) : a }
81
81
  end
@@ -1,56 +1,19 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/simple_oauth', __FILE__)
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{simple_oauth}
8
- s.version = "0.1.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Steve Richert"]
12
- s.date = %q{2010-10-13}
13
- s.description = %q{Simply builds and verifies OAuth headers}
14
- s.email = %q{steve.richert@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".gitignore",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "init.rb",
27
- "lib/simple_oauth.rb",
28
- "simple_oauth.gemspec",
29
- "test/helper.rb",
30
- "test/rsa_private_key",
31
- "test/simple_oauth_test.rb"
32
- ]
33
- s.homepage = %q{http://github.com/laserlemon/simple_oauth}
34
- s.rdoc_options = ["--charset=UTF-8"]
35
- s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.3.7}
37
- s.summary = %q{Simply builds and verifies OAuth headers}
38
- s.test_files = [
39
- "test/helper.rb",
40
- "test/simple_oauth_test.rb"
41
- ]
42
-
43
- if s.respond_to? :specification_version then
44
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
45
- s.specification_version = 3
46
-
47
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
- s.add_development_dependency(%q<mocha>, [">= 0"])
49
- else
50
- s.add_dependency(%q<mocha>, [">= 0"])
51
- end
52
- else
53
- s.add_dependency(%q<mocha>, [">= 0"])
54
- end
4
+ Gem::Specification.new do |spec|
5
+ spec.add_development_dependency('mocha', '>= 0')
6
+ spec.author = 'Steve Richert'
7
+ spec.description = 'Simply builds and verifies OAuth headers'
8
+ spec.email = 'steve.richert@gmail.com'
9
+ spec.extra_rdoc_files = ['README.rdoc']
10
+ spec.files = `git ls-files`.split("\n")
11
+ spec.homepage = 'http://github.com/laserlemon/simple_oauth'
12
+ spec.name = 'simple_oauth'
13
+ spec.rdoc_options = ['--charset=UTF-8']
14
+ spec.required_ruby_version = '>= 1.8.7'
15
+ spec.required_rubygems_version = '>= 1.2.0'
16
+ spec.summary = 'Simply builds and verifies OAuth headers'
17
+ spec.test_files = `git ls-files -- test/**/*_test.rb`.split("\n")
18
+ spec.version = SimpleOAuth::Version::STRING
55
19
  end
56
-
@@ -1,4 +1,4 @@
1
- require 'test/unit'
2
1
  require 'simple_oauth'
3
2
  require 'rubygems'
4
3
  require 'mocha'
4
+ require 'test/unit'
@@ -30,6 +30,19 @@ class SimpleOAuthTest < Test::Unit::TestCase
30
30
  ['-', '.', '~'].each do |character|
31
31
  assert_equal character, SimpleOAuth::Header.encode(character)
32
32
  end
33
+
34
+ major, minor, patch = RUBY_VERSION.split('.')
35
+ new_ruby = major.to_i >= 2 || major.to_i == 1 && minor.to_i >= 9
36
+ old_kcode = $KCODE if !new_ruby
37
+ begin
38
+ %w(n N e E s S u U).each do |kcode|
39
+ $KCODE = kcode if !new_ruby
40
+ assert_equal '%E3%81%82', SimpleOAuth::Header.encode('あ'), "Failed to correctly escape Japanese under $KCODE = #{kcode}"
41
+ assert_equal '%C3%A9', SimpleOAuth::Header.encode('é'), "Failed to correctly escape e+acute under $KCODE = #{kcode}"
42
+ end
43
+ ensure
44
+ $KCODE = old_kcode if !new_ruby
45
+ end
33
46
  end
34
47
 
35
48
  def test_decode
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_oauth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve Richert
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-13 00:00:00 -04:00
18
+ date: 2010-11-15 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -39,7 +39,6 @@ executables: []
39
39
  extensions: []
40
40
 
41
41
  extra_rdoc_files:
42
- - LICENSE
43
42
  - README.rdoc
44
43
  files:
45
44
  - .gitignore
@@ -48,6 +47,7 @@ files:
48
47
  - LICENSE
49
48
  - README.rdoc
50
49
  - Rakefile
50
+ - VERSION
51
51
  - init.rb
52
52
  - lib/simple_oauth.rb
53
53
  - simple_oauth.gemspec
@@ -68,19 +68,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- hash: 3
71
+ hash: 57
72
72
  segments:
73
- - 0
74
- version: "0"
73
+ - 1
74
+ - 8
75
+ - 7
76
+ version: 1.8.7
75
77
  required_rubygems_version: !ruby/object:Gem::Requirement
76
78
  none: false
77
79
  requirements:
78
80
  - - ">="
79
81
  - !ruby/object:Gem::Version
80
- hash: 3
82
+ hash: 31
81
83
  segments:
84
+ - 1
85
+ - 2
82
86
  - 0
83
- version: "0"
87
+ version: 1.2.0
84
88
  requirements: []
85
89
 
86
90
  rubyforge_project:
@@ -88,6 +92,5 @@ rubygems_version: 1.3.7
88
92
  signing_key:
89
93
  specification_version: 3
90
94
  summary: Simply builds and verifies OAuth headers
91
- test_files:
92
- - test/helper.rb
93
- - test/simple_oauth_test.rb
95
+ test_files: []
96
+