twitter-request-headers 0.0.10 → 0.0.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7eb6fec8fecbd186132ee9ead43797f2b47c525d
4
- data.tar.gz: 642a343866131b6bffd11e3c0fab3f8f98f339e0
3
+ metadata.gz: c0095a9ef3721e90ceff67651b3144a478573e08
4
+ data.tar.gz: 395b48f6271732cca021fb789297421875018252
5
5
  SHA512:
6
- metadata.gz: 34535137f9df376819d1c3f6908b20c45254b68bc40e69f839db21067b71ac5a6f93f018f9277edcf165389f150bf6360bef0b172e1ee5fd0e52cbc26eb882a6
7
- data.tar.gz: 0bcf733afc3a6bb3a6c56cc6743985c49e95d83a6cfca4dfe102581967a6495435099afb70fa812840a14a1e96ada6b873f88f9e06b9e195295c524c72b0756b
6
+ metadata.gz: 2346565020978c2ca0a3fcc5c7ffdbe78684960ca25dcb9ff98e1b832f60779072e92889c3d2420976b6fecc5af608e18e8c7b9e862cff354ebd5222e15aa602
7
+ data.tar.gz: cd0b704a3e0201b6b325f2375f6ca85afdf79efa3efde4601ce4c0767a8e2cdb348401df92e1a3a9011734754434e24cceda08b41b0c9ecad0ee9cf4bf5c2e07
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem/
data/README.md CHANGED
@@ -35,6 +35,14 @@ TwitterRequestHeaders.new(
35
35
  ).header
36
36
  ```
37
37
 
38
+
39
+ ## Minitest
40
+
41
+ ```sh
42
+ bundle install
43
+ rake test
44
+ ```
45
+
38
46
  ## License
39
47
 
40
48
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -26,6 +26,12 @@ class EscapeUriString
26
26
  private
27
27
 
28
28
  def validate
29
+ # true/false can be converted to it's string form clearly
30
+ if @string.kind_of?(TrueClass) || @string.kind_of?(FalseClass)
31
+ return true
32
+ end
33
+
34
+ # we shouldn't deal with arrays, hashes and e.g.
29
35
  unless @string.kind_of?(String)
30
36
  fail ArgumentError, 'Attempt to escape non-string'
31
37
  end
@@ -37,7 +43,7 @@ class EscapeUriString
37
43
 
38
44
  def escape_uri(string)
39
45
  begin
40
- URI::escape(string, RESERVED_CHARACTERS)
46
+ URI::escape(string.to_s, RESERVED_CHARACTERS)
41
47
  rescue ArgumentError
42
48
  rescue
43
49
  end
@@ -1,3 +1,8 @@
1
+ =begin
2
+ Formats HTTP Authorization header.
3
+ https://dev.twitter.com/oauth/overview/authorizing-requests
4
+ =end
5
+
1
6
  class Header
2
7
  require 'twitter_request_headers'
3
8
  require 'escape_uri_string'
@@ -1,3 +1,8 @@
1
+ =begin
2
+ Creates signature of request parameters.
3
+ https://dev.twitter.com/oauth/overview/creating-signatures
4
+ =end
5
+
1
6
  class Signature
2
7
  require 'securerandom'
3
8
  require 'base64'
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "twitter-request-headers"
7
- spec.version = '0.0.10'
7
+ spec.version = '0.0.11'
8
8
  spec.authors = ["Dmitrii Komaritckii"]
9
9
  spec.email = ["lochnessathome@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-request-headers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitrii Komaritckii