simple_oauth 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - rbx-18mode
4
+ - rbx-19mode
5
+ - jruby-18mode
6
+ - jruby-19mode
3
7
  - 1.8.7
4
8
  - 1.9.2
5
9
  - 1.9.3
6
10
  - ruby-head
7
- - jruby-18mode
8
- - jruby-19mode
9
- - rbx-18mode
10
- - rbx-19mode
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Steve Richert, Erik Michaels-Ober
1
+ Copyright (c) 2010 Steve Richert, Erik Michaels-Ober
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Simply builds and verifies OAuth headers
4
4
 
5
- ## <a name="pulls"></a>Contributing
5
+ ## Contributing
6
6
  1. Fork the project.
7
7
  2. Create a topic branch.
8
8
  3. Add failing tests.
@@ -11,7 +11,7 @@ Simply builds and verifies OAuth headers
11
11
  6. Commit and push your changes.
12
12
  7. Submit a pull request. Please do not include changes to the gemspec.
13
13
 
14
- ## <a name="rubies"></a>Supported Rubies
14
+ ## Supported Rubies
15
15
  This library aims to support and is [tested
16
16
  against](http://travis-ci.org/laserlemon/simple_oauth) the following Ruby
17
17
  implementations:
@@ -19,7 +19,7 @@ implementations:
19
19
  * Ruby 1.8.7
20
20
  * Ruby 1.9.2
21
21
  * Ruby 1.9.3
22
- # Ruby head
22
+ * Ruby head
23
23
  * [JRuby](http://www.jruby.org/)
24
24
  * [Rubinius](http://rubini.us/)
25
25
 
@@ -37,6 +37,6 @@ implementation, you will be personally responsible for providing patches in a
37
37
  timely fashion. If critical issues for a particular implementation exist at the
38
38
  time of a major release, support for that Ruby version may be dropped.
39
39
 
40
- ## <a name="copyright"></a>Copyright
40
+ ## Copyright
41
41
  Copyright (c) 2010 Steve Richert, Erik Michaels-Ober.
42
42
  See [LICENSE](https://github.com/laserlemon/simple_oauth/blob/master/LICENSE) for details.
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env rake
2
-
3
1
  require 'bundler/gem_tasks'
4
2
  require 'rspec/core/rake_task'
5
3
 
@@ -25,7 +25,7 @@ module SimpleOAuth
25
25
  end
26
26
 
27
27
  def self.parse(header)
28
- header.to_s.sub(/^OAuth\s/, '').split(', ').inject({}) do |attributes, pair|
28
+ header.to_s.sub(/^OAuth\s/, '').split(/,\s*/).inject({}) do |attributes, pair|
29
29
  match = pair.match(/^(\w+)\=\"([^\"]*)\"$/)
30
30
  attributes.merge(match[1].sub(/^oauth_/, '').to_sym => decode(match[2]))
31
31
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'simple_oauth'
5
- gem.version = '0.1.7'
5
+ gem.version = '0.1.8'
6
6
 
7
7
  gem.authors = ["Steve Richert", "Erik Michaels-Ober"]
8
8
  gem.email = ['steve.richert@gmail.com', 'sferik@gmail.com']
@@ -86,6 +86,24 @@ describe SimpleOAuth::Header do
86
86
  parsed_options.should have_key(:signature)
87
87
  parsed_options[:signature].should_not be_nil
88
88
  end
89
+
90
+ it 'should handle optional "linear white space"' do
91
+ parsed_header_with_spaces = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
92
+ parsed_header_with_spaces.should be_a_kind_of(Hash)
93
+ parsed_header_with_spaces.keys.size.should eq 7
94
+
95
+ parsed_header_with_tabs = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
96
+ parsed_header_with_tabs.should be_a_kind_of(Hash)
97
+ parsed_header_with_tabs.keys.size.should eq 7
98
+
99
+ parsed_header_with_spaces_and_tabs = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
100
+ parsed_header_with_spaces_and_tabs.should be_a_kind_of(Hash)
101
+ parsed_header_with_spaces_and_tabs.keys.size.should eq 7
102
+
103
+ parsed_header_without_spaces = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd",oauth_nonce="oLKtec51GQy",oauth_signature="efgh%26mnop",oauth_signature_method="PLAINTEXT",oauth_timestamp="1286977095",oauth_token="ijkl",oauth_version="1.0"'
104
+ parsed_header_without_spaces.should be_a_kind_of(Hash)
105
+ parsed_header_without_spaces.keys.size.should eq 7
106
+ end
89
107
  end
90
108
 
91
109
  describe '#initialize' do
@@ -1,6 +1,8 @@
1
1
  unless ENV['CI']
2
2
  require 'simplecov'
3
- SimpleCov.start
3
+ SimpleCov.start do
4
+ add_filter 'spec'
5
+ end
4
6
  end
5
7
 
6
8
  require 'simple_oauth'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-23 00:00:00.000000000 Z
13
+ date: 2012-05-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -103,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 1.8.21
106
+ rubygems_version: 1.8.24
107
107
  signing_key:
108
108
  specification_version: 3
109
109
  summary: Simply builds and verifies OAuth headers
110
110
  test_files: []
111
- has_rdoc: