tiny_http 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.
- checksums.yaml +7 -0
- data/lib/tiny_http.rb +10 -1
- metadata +7 -8
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 5c61d89381da55631d0871ab541592e974346a32
         | 
| 4 | 
            +
              data.tar.gz: 1528f723a405464e537fc7041f9949c4634b7b72
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 507278b3f150d0641f24935c2f01e5838f9521b6625e7c3a108e8dd604a070e8a1c11230e45f4c437223f48407317cf759b267cf655ca09587c956dee78ad4e1
         | 
| 7 | 
            +
              data.tar.gz: 1679c69dffd4c9fc9301dc378a172843e6928a1034df1bb5d0dc7f998a37f4e0feb15b6be81155be9243c1cba3e52bc7f2c2cc33bf13457e98a0424f777c4548
         | 
    
        data/lib/tiny_http.rb
    CHANGED
    
    | @@ -2,9 +2,11 @@ require 'net/http' | |
| 2 2 |  | 
| 3 3 | 
             
            class TinyHttp
         | 
| 4 4 |  | 
| 5 | 
            +
              Error = Class.new(StandardError)
         | 
| 6 | 
            +
             | 
| 5 7 | 
             
              def get(url)
         | 
| 6 8 | 
             
                uri = URI.parse(url)
         | 
| 7 | 
            -
                request = Net::HTTP::Get.new(uri. | 
| 9 | 
            +
                request = Net::HTTP::Get.new(uri.request_uri)
         | 
| 8 10 |  | 
| 9 11 | 
             
                response = send_request(uri, request)
         | 
| 10 12 | 
             
              end
         | 
| @@ -22,6 +24,13 @@ class TinyHttp | |
| 22 24 | 
             
                http.use_ssl = true if uri.scheme == "https"
         | 
| 23 25 |  | 
| 24 26 | 
             
                response = http.start { |http| http.request(request) }
         | 
| 27 | 
            +
              rescue SocketError => e
         | 
| 28 | 
            +
                e = Error.new(e.message)
         | 
| 29 | 
            +
                e.set_backtrace(e.backtrace)
         | 
| 30 | 
            +
                raise e
         | 
| 25 31 | 
             
              end
         | 
| 26 32 |  | 
| 27 33 | 
             
            end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            # require 'tiny_http'
         | 
| 36 | 
            +
            # TinyHttp.new.get('http://lubawayy.com')
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tiny_http
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: 0.1.2
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Josh Lubaway
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 11 | 
            +
            date: 2013-09-01 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies: []
         | 
| 14 13 | 
             
            description: The smallest http library I need.
         | 
| 15 14 | 
             
            email: dontneedmoreemail@example.com
         | 
| @@ -20,26 +19,26 @@ files: | |
| 20 19 | 
             
            - lib/tiny_http.rb
         | 
| 21 20 | 
             
            homepage: http://github.com/jish/tiny_http
         | 
| 22 21 | 
             
            licenses: []
         | 
| 22 | 
            +
            metadata: {}
         | 
| 23 23 | 
             
            post_install_message: 
         | 
| 24 24 | 
             
            rdoc_options: []
         | 
| 25 25 | 
             
            require_paths:
         | 
| 26 26 | 
             
            - lib
         | 
| 27 27 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 28 | 
            -
              none: false
         | 
| 29 28 | 
             
              requirements:
         | 
| 30 | 
            -
              - -  | 
| 29 | 
            +
              - - '>='
         | 
| 31 30 | 
             
                - !ruby/object:Gem::Version
         | 
| 32 31 | 
             
                  version: '0'
         | 
| 33 32 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 34 | 
            -
              none: false
         | 
| 35 33 | 
             
              requirements:
         | 
| 36 | 
            -
              - -  | 
| 34 | 
            +
              - - '>='
         | 
| 37 35 | 
             
                - !ruby/object:Gem::Version
         | 
| 38 36 | 
             
                  version: '0'
         | 
| 39 37 | 
             
            requirements: []
         | 
| 40 38 | 
             
            rubyforge_project: 
         | 
| 41 | 
            -
            rubygems_version:  | 
| 39 | 
            +
            rubygems_version: 2.0.2
         | 
| 42 40 | 
             
            signing_key: 
         | 
| 43 41 | 
             
            specification_version: 3
         | 
| 44 42 | 
             
            summary: tiny http
         | 
| 45 43 | 
             
            test_files: []
         | 
| 44 | 
            +
            has_rdoc: 
         |