tweetsentiments 0.1.1
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/.document +5 -0
 - data/.rspec +1 -0
 - data/Gemfile +25 -0
 - data/Gemfile.lock +55 -0
 - data/LICENSE.txt +20 -0
 - data/README.rdoc +64 -0
 - data/Rakefile +52 -0
 - data/autotest/discover.rb +1 -0
 - data/lib/faraday/raise_http_4xx.rb +47 -0
 - data/lib/faraday/raise_http_5xx.rb +31 -0
 - data/lib/tweetsentiments.rb +15 -0
 - data/lib/tweetsentiments/api.rb +17 -0
 - data/lib/tweetsentiments/client.rb +21 -0
 - data/lib/tweetsentiments/configuration.rb +37 -0
 - data/lib/tweetsentiments/connection.rb +30 -0
 - data/lib/tweetsentiments/error.rb +54 -0
 - data/lib/tweetsentiments/request.rb +34 -0
 - data/lib/tweetsentiments/version.rb +3 -0
 - data/spec/fixtures/analyze.json +0 -0
 - data/spec/fixtures/analyze.xml +0 -0
 - data/spec/fixtures/classify.json +0 -0
 - data/spec/fixtures/classify.xml +0 -0
 - data/spec/fixtures/classify_simple.json +0 -0
 - data/spec/fixtures/classify_simple.xml +0 -0
 - data/spec/fixtures/search.json +0 -0
 - data/spec/fixtures/search.xml +0 -0
 - data/spec/spec_helper.rb +25 -0
 - data/spec/tweetsentiments/client_spec.rb +85 -0
 - data/spec/tweetsentiments_spec.rb +19 -0
 - data/tweetsentiments.gemspec +112 -0
 - metadata +329 -0
 
    
        data/.document
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --color
         
     | 
    
        data/Gemfile
    ADDED
    
    | 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            source "http://rubygems.org"
         
     | 
| 
      
 2 
     | 
    
         
            +
            # Add dependencies required to use your gem here.
         
     | 
| 
      
 3 
     | 
    
         
            +
            # Example:
         
     | 
| 
      
 4 
     | 
    
         
            +
            #   gem "activesupport", ">= 2.3.5"
         
     | 
| 
      
 5 
     | 
    
         
            +
            gem "faraday"
         
     | 
| 
      
 6 
     | 
    
         
            +
            gem "faraday_middleware"
         
     | 
| 
      
 7 
     | 
    
         
            +
            gem "multi_xml"
         
     | 
| 
      
 8 
     | 
    
         
            +
            gem "multi_json"
         
     | 
| 
      
 9 
     | 
    
         
            +
            gem "hashie"
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            # Add dependencies to develop your gem here.
         
     | 
| 
      
 12 
     | 
    
         
            +
            # Include everything needed to run rake, tests, features, etc.
         
     | 
| 
      
 13 
     | 
    
         
            +
            group :development do
         
     | 
| 
      
 14 
     | 
    
         
            +
              gem "json"
         
     | 
| 
      
 15 
     | 
    
         
            +
              gem "ZenTest"
         
     | 
| 
      
 16 
     | 
    
         
            +
              gem "rake"
         
     | 
| 
      
 17 
     | 
    
         
            +
              gem "rspec"
         
     | 
| 
      
 18 
     | 
    
         
            +
              gem "bundler", ">= 1.0.0"
         
     | 
| 
      
 19 
     | 
    
         
            +
              gem "jeweler", ">= 1.5.1"
         
     | 
| 
      
 20 
     | 
    
         
            +
              gem "rcov", ">= 0"
         
     | 
| 
      
 21 
     | 
    
         
            +
              gem "faraday"
         
     | 
| 
      
 22 
     | 
    
         
            +
              gem "faraday_middleware"
         
     | 
| 
      
 23 
     | 
    
         
            +
              gem "webmock"
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
    
        data/Gemfile.lock
    ADDED
    
    | 
         @@ -0,0 +1,55 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: http://rubygems.org/
         
     | 
| 
      
 3 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 4 
     | 
    
         
            +
                ZenTest (4.6.2)
         
     | 
| 
      
 5 
     | 
    
         
            +
                addressable (2.2.6)
         
     | 
| 
      
 6 
     | 
    
         
            +
                crack (0.3.1)
         
     | 
| 
      
 7 
     | 
    
         
            +
                diff-lcs (1.1.3)
         
     | 
| 
      
 8 
     | 
    
         
            +
                faraday (0.7.5)
         
     | 
| 
      
 9 
     | 
    
         
            +
                  addressable (~> 2.2.6)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  multipart-post (~> 1.1.3)
         
     | 
| 
      
 11 
     | 
    
         
            +
                  rack (>= 1.1.0, < 2)
         
     | 
| 
      
 12 
     | 
    
         
            +
                faraday_middleware (0.7.0)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  faraday (~> 0.7.3)
         
     | 
| 
      
 14 
     | 
    
         
            +
                git (1.2.5)
         
     | 
| 
      
 15 
     | 
    
         
            +
                hashie (1.1.0)
         
     | 
| 
      
 16 
     | 
    
         
            +
                jeweler (1.6.4)
         
     | 
| 
      
 17 
     | 
    
         
            +
                  bundler (~> 1.0)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  git (>= 1.2.5)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  rake
         
     | 
| 
      
 20 
     | 
    
         
            +
                json (1.6.1)
         
     | 
| 
      
 21 
     | 
    
         
            +
                multi_json (1.0.3)
         
     | 
| 
      
 22 
     | 
    
         
            +
                multi_xml (0.4.1)
         
     | 
| 
      
 23 
     | 
    
         
            +
                multipart-post (1.1.3)
         
     | 
| 
      
 24 
     | 
    
         
            +
                rack (1.3.4)
         
     | 
| 
      
 25 
     | 
    
         
            +
                rake (0.9.2)
         
     | 
| 
      
 26 
     | 
    
         
            +
                rcov (0.9.11)
         
     | 
| 
      
 27 
     | 
    
         
            +
                rspec (2.6.0)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  rspec-core (~> 2.6.0)
         
     | 
| 
      
 29 
     | 
    
         
            +
                  rspec-expectations (~> 2.6.0)
         
     | 
| 
      
 30 
     | 
    
         
            +
                  rspec-mocks (~> 2.6.0)
         
     | 
| 
      
 31 
     | 
    
         
            +
                rspec-core (2.6.4)
         
     | 
| 
      
 32 
     | 
    
         
            +
                rspec-expectations (2.6.0)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  diff-lcs (~> 1.1.2)
         
     | 
| 
      
 34 
     | 
    
         
            +
                rspec-mocks (2.6.0)
         
     | 
| 
      
 35 
     | 
    
         
            +
                webmock (1.7.6)
         
     | 
| 
      
 36 
     | 
    
         
            +
                  addressable (~> 2.2, > 2.2.5)
         
     | 
| 
      
 37 
     | 
    
         
            +
                  crack (>= 0.1.7)
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 40 
     | 
    
         
            +
              ruby
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 43 
     | 
    
         
            +
              ZenTest
         
     | 
| 
      
 44 
     | 
    
         
            +
              bundler (>= 1.0.0)
         
     | 
| 
      
 45 
     | 
    
         
            +
              faraday
         
     | 
| 
      
 46 
     | 
    
         
            +
              faraday_middleware
         
     | 
| 
      
 47 
     | 
    
         
            +
              hashie
         
     | 
| 
      
 48 
     | 
    
         
            +
              jeweler (>= 1.5.1)
         
     | 
| 
      
 49 
     | 
    
         
            +
              json
         
     | 
| 
      
 50 
     | 
    
         
            +
              multi_json
         
     | 
| 
      
 51 
     | 
    
         
            +
              multi_xml
         
     | 
| 
      
 52 
     | 
    
         
            +
              rake
         
     | 
| 
      
 53 
     | 
    
         
            +
              rcov
         
     | 
| 
      
 54 
     | 
    
         
            +
              rspec
         
     | 
| 
      
 55 
     | 
    
         
            +
              webmock
         
     | 
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2010 Yong Gu
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 4 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 5 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 6 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 7 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 8 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 9 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 12 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 15 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 16 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 17 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 18 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 19 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 20 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.rdoc
    ADDED
    
    | 
         @@ -0,0 +1,64 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            = tweetsentiments
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Ruby Gem to access the tweetsentiments.com API.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            == Install
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              gem install tweetsentiments
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            == Usage
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              require 'tweetsentiments'
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              Tweetsentiments.analyze "I am happy"
         
     | 
| 
      
 14 
     | 
    
         
            +
              => {"sentiment"=>{"value"=>1, "name"=>"Positive"}} 
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              Tweetsentiments.analyze "I am sad"
         
     | 
| 
      
 17 
     | 
    
         
            +
              => {"sentiment"=>{"value"=>-1, "name"=>"Negative"}}
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              Tweetsentiments.analyze "I am going to work"
         
     | 
| 
      
 20 
     | 
    
         
            +
              => {"sentiment"=>{"value"=>0, "name"=>"Neutral"}}
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              res = Tweetsentiments.search :topic => "comcast"
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              res["sentiment_index"]
         
     | 
| 
      
 25 
     | 
    
         
            +
              => 47.0 
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
              res["negative"]
         
     | 
| 
      
 28 
     | 
    
         
            +
              => 32
         
     | 
| 
      
 29 
     | 
    
         
            +
             
         
     | 
| 
      
 30 
     | 
    
         
            +
              res["positive"]
         
     | 
| 
      
 31 
     | 
    
         
            +
              => 26
         
     | 
| 
      
 32 
     | 
    
         
            +
             
         
     | 
| 
      
 33 
     | 
    
         
            +
              res["neutral"]
         
     | 
| 
      
 34 
     | 
    
         
            +
              => 42 
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
              res["results"][0]["sentiment"]
         
     | 
| 
      
 37 
     | 
    
         
            +
              => -1
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
              Tweetsentiments.search :user => "cnnbrk"
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              Tweetsentiments.lang_detect "this is a test"
         
     | 
| 
      
 42 
     | 
    
         
            +
              => {"lang"=>"en"} 
         
     | 
| 
      
 43 
     | 
    
         
            +
              
         
     | 
| 
      
 44 
     | 
    
         
            +
              Tweetsentiments.lang_detect "中文"
         
     | 
| 
      
 45 
     | 
    
         
            +
              => {"lang"=>"zh-cn"} 
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
              Tweetsentiments.lang_detect "ひらがな"
         
     | 
| 
      
 48 
     | 
    
         
            +
              => {"lang"=>"ja"}
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            == Contributing to tweetsentiments
         
     | 
| 
      
 51 
     | 
    
         
            +
             
         
     | 
| 
      
 52 
     | 
    
         
            +
            * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
         
     | 
| 
      
 53 
     | 
    
         
            +
            * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
         
     | 
| 
      
 54 
     | 
    
         
            +
            * Fork the project
         
     | 
| 
      
 55 
     | 
    
         
            +
            * Start a feature/bugfix branch
         
     | 
| 
      
 56 
     | 
    
         
            +
            * Commit and push until you are happy with your contribution
         
     | 
| 
      
 57 
     | 
    
         
            +
            * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
         
     | 
| 
      
 58 
     | 
    
         
            +
            * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            == Copyright
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            Copyright (c) 2011 Intridea. See LICENSE.txt for
         
     | 
| 
      
 63 
     | 
    
         
            +
            further details.
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,52 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'bundler'
         
     | 
| 
      
 3 
     | 
    
         
            +
            begin
         
     | 
| 
      
 4 
     | 
    
         
            +
              Bundler.setup(:default, :development)
         
     | 
| 
      
 5 
     | 
    
         
            +
            rescue Bundler::BundlerError => e
         
     | 
| 
      
 6 
     | 
    
         
            +
              $stderr.puts e.message
         
     | 
| 
      
 7 
     | 
    
         
            +
              $stderr.puts "Run `bundle install` to install missing gems"
         
     | 
| 
      
 8 
     | 
    
         
            +
              exit e.status_code
         
     | 
| 
      
 9 
     | 
    
         
            +
            end
         
     | 
| 
      
 10 
     | 
    
         
            +
            require 'rake'
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            require 'jeweler'
         
     | 
| 
      
 13 
     | 
    
         
            +
            require File.expand_path("../lib/tweetsentiments/version", __FILE__)
         
     | 
| 
      
 14 
     | 
    
         
            +
            Jeweler::Tasks.new do |gem|
         
     | 
| 
      
 15 
     | 
    
         
            +
              # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
         
     | 
| 
      
 16 
     | 
    
         
            +
              gem.version = Tweetsentiments::VERSION
         
     | 
| 
      
 17 
     | 
    
         
            +
              gem.name = "tweetsentiments"
         
     | 
| 
      
 18 
     | 
    
         
            +
              gem.homepage = "https://github.com/tomz/tweetsentiments"
         
     | 
| 
      
 19 
     | 
    
         
            +
              gem.license = "MIT"
         
     | 
| 
      
 20 
     | 
    
         
            +
              gem.summary = %Q{A Ruby wrapper for the www.tweetsentiments.com REST APIS} 
         
     | 
| 
      
 21 
     | 
    
         
            +
              gem.description = %Q{A Ruby wrapper for the www.tweetsentiments.com REST APIs}
         
     | 
| 
      
 22 
     | 
    
         
            +
              gem.email = "tom@intridea.com, yonggu@intridea.com"
         
     | 
| 
      
 23 
     | 
    
         
            +
              gem.authors = ["Yong Gu","Tom Zeng"]
         
     | 
| 
      
 24 
     | 
    
         
            +
              # Include your dependencies below. Runtime dependencies are required when using your gem,
         
     | 
| 
      
 25 
     | 
    
         
            +
              # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
         
     | 
| 
      
 26 
     | 
    
         
            +
              # gem.add_development_dependency 'rspec', '> 1.2.3'
         
     | 
| 
      
 27 
     | 
    
         
            +
              # gem.add_runtime_dependency 'farady', '>=0.5.3'
         
     | 
| 
      
 28 
     | 
    
         
            +
              # gem.add_runtime_dependency 'farady_middleware', '>=0.3.1'
         
     | 
| 
      
 29 
     | 
    
         
            +
            end
         
     | 
| 
      
 30 
     | 
    
         
            +
            Jeweler::RubygemsDotOrgTasks.new
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
            require 'rspec/core'
         
     | 
| 
      
 33 
     | 
    
         
            +
            require 'rspec/core/rake_task'
         
     | 
| 
      
 34 
     | 
    
         
            +
            RSpec::Core::RakeTask.new(:spec) do |spec|
         
     | 
| 
      
 35 
     | 
    
         
            +
              spec.pattern = FileList['spec/**/*_spec.rb']
         
     | 
| 
      
 36 
     | 
    
         
            +
            end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            RSpec::Core::RakeTask.new(:rcov) do |spec|
         
     | 
| 
      
 39 
     | 
    
         
            +
              spec.pattern = 'spec/**/*_spec.rb'
         
     | 
| 
      
 40 
     | 
    
         
            +
              spec.rcov = true
         
     | 
| 
      
 41 
     | 
    
         
            +
            end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            task :default => :spec
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            require 'rake/rdoctask'
         
     | 
| 
      
 46 
     | 
    
         
            +
            Rake::RDocTask.new do |rdoc|
         
     | 
| 
      
 47 
     | 
    
         
            +
              version = Tweetsentiments::VERSION
         
     | 
| 
      
 48 
     | 
    
         
            +
              rdoc.rdoc_dir = 'rdoc'
         
     | 
| 
      
 49 
     | 
    
         
            +
              rdoc.title = "tweetsentiments #{version}"
         
     | 
| 
      
 50 
     | 
    
         
            +
              rdoc.rdoc_files.include('README*')
         
     | 
| 
      
 51 
     | 
    
         
            +
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
      
 52 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Autotest.add_discovery { "rspec2" }
         
     | 
| 
         @@ -0,0 +1,47 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'faraday'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # @private
         
     | 
| 
      
 4 
     | 
    
         
            +
            module Faraday
         
     | 
| 
      
 5 
     | 
    
         
            +
              # @private
         
     | 
| 
      
 6 
     | 
    
         
            +
              class Response::RaiseHttp4xx < Response::Middleware
         
     | 
| 
      
 7 
     | 
    
         
            +
                def self.register_on_complete(env)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  env[:response].on_complete do |response|
         
     | 
| 
      
 9 
     | 
    
         
            +
                    case response[:status].to_i
         
     | 
| 
      
 10 
     | 
    
         
            +
                    when 400
         
     | 
| 
      
 11 
     | 
    
         
            +
                      raise Tweetsentiments::BadRequest, error_message(response)
         
     | 
| 
      
 12 
     | 
    
         
            +
                    when 401
         
     | 
| 
      
 13 
     | 
    
         
            +
                      raise Tweetsentiments::Unauthorized, error_message(response)
         
     | 
| 
      
 14 
     | 
    
         
            +
                    when 403
         
     | 
| 
      
 15 
     | 
    
         
            +
                      raise Tweetsentiments::Forbidden, error_message(response)
         
     | 
| 
      
 16 
     | 
    
         
            +
                    when 404
         
     | 
| 
      
 17 
     | 
    
         
            +
                      raise Tweetsentiments::NotFound, error_message(response)
         
     | 
| 
      
 18 
     | 
    
         
            +
                    when 406
         
     | 
| 
      
 19 
     | 
    
         
            +
                      raise Tweetsentiments::NotAcceptable, error_message(response)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    when 420
         
     | 
| 
      
 21 
     | 
    
         
            +
                      raise Tweetsentiments::RateLimited, error_message(response)
         
     | 
| 
      
 22 
     | 
    
         
            +
                    end
         
     | 
| 
      
 23 
     | 
    
         
            +
                  end
         
     | 
| 
      
 24 
     | 
    
         
            +
                end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                def initialize(app)
         
     | 
| 
      
 27 
     | 
    
         
            +
                  super
         
     | 
| 
      
 28 
     | 
    
         
            +
                  @parser = nil
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                private
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                def self.error_message(response)
         
     | 
| 
      
 34 
     | 
    
         
            +
                  "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:response_headers]['status']}#{error_body(response[:body])}"
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                def self.error_body(body)
         
     | 
| 
      
 38 
     | 
    
         
            +
                  if body.nil?
         
     | 
| 
      
 39 
     | 
    
         
            +
                    nil
         
     | 
| 
      
 40 
     | 
    
         
            +
                  elsif body['error']
         
     | 
| 
      
 41 
     | 
    
         
            +
                    ": #{body['error']}"
         
     | 
| 
      
 42 
     | 
    
         
            +
                  elsif body['errors']
         
     | 
| 
      
 43 
     | 
    
         
            +
                    ": #{body['errors'].to_a.first.chomp}"
         
     | 
| 
      
 44 
     | 
    
         
            +
                  end
         
     | 
| 
      
 45 
     | 
    
         
            +
                end
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'faraday'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # @private
         
     | 
| 
      
 4 
     | 
    
         
            +
            module Faraday
         
     | 
| 
      
 5 
     | 
    
         
            +
              # @private
         
     | 
| 
      
 6 
     | 
    
         
            +
              class Response::RaiseHttp5xx < Response::Middleware
         
     | 
| 
      
 7 
     | 
    
         
            +
                def self.register_on_complete(env)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  env[:response].on_complete do |response|
         
     | 
| 
      
 9 
     | 
    
         
            +
                    case response[:status].to_i
         
     | 
| 
      
 10 
     | 
    
         
            +
                    when 500
         
     | 
| 
      
 11 
     | 
    
         
            +
                      raise Tweetsentiments::InternalServerError, error_message(response, "Something is technically wrong.")
         
     | 
| 
      
 12 
     | 
    
         
            +
                    when 502
         
     | 
| 
      
 13 
     | 
    
         
            +
                      raise Tweetsentiments::BadGateway, error_message(response, "Tweetsentiments is down or being upgraded.")
         
     | 
| 
      
 14 
     | 
    
         
            +
                    when 503
         
     | 
| 
      
 15 
     | 
    
         
            +
                      raise Tweetsentiments::ServiceUnavailable, error_message(response, "(__-){ Twitter is over capacity.")
         
     | 
| 
      
 16 
     | 
    
         
            +
                    end
         
     | 
| 
      
 17 
     | 
    
         
            +
                  end
         
     | 
| 
      
 18 
     | 
    
         
            +
                end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                def initialize(app)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  super
         
     | 
| 
      
 22 
     | 
    
         
            +
                  @parser = nil
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                private
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                def self.error_message(response, body=nil)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:response_headers]['status']}:#{(' ' + body) if body} Check http://status.tweetsentiments.com/ for updates on the status of the Tweetsentiments service."
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path('../tweetsentiments/configuration', __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.expand_path('../tweetsentiments/api', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            require File.expand_path('../tweetsentiments/client', __FILE__)
         
     | 
| 
      
 4 
     | 
    
         
            +
            require File.expand_path('../tweetsentiments/error', __FILE__)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 7 
     | 
    
         
            +
              extend Configuration
         
     | 
| 
      
 8 
     | 
    
         
            +
              def self.client(options={})
         
     | 
| 
      
 9 
     | 
    
         
            +
                Tweetsentiments::Client.new(options)
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
              def self.method_missing(method, *args, &block)
         
     | 
| 
      
 12 
     | 
    
         
            +
                return super unless client.respond_to?(method)
         
     | 
| 
      
 13 
     | 
    
         
            +
                client.send(method, *args, &block)
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path('../connection', __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.expand_path('../request', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 5 
     | 
    
         
            +
              class API
         
     | 
| 
      
 6 
     | 
    
         
            +
                attr_accessor *Configuration::VALID_OPTIONS_KEYS
         
     | 
| 
      
 7 
     | 
    
         
            +
                def initialize(options={})
         
     | 
| 
      
 8 
     | 
    
         
            +
                  options = Tweetsentiments.options.merge(options)
         
     | 
| 
      
 9 
     | 
    
         
            +
                  Configuration::VALID_OPTIONS_KEYS.each do |key|
         
     | 
| 
      
 10 
     | 
    
         
            +
                    send("#{key}=", options[key])
         
     | 
| 
      
 11 
     | 
    
         
            +
                  end
         
     | 
| 
      
 12 
     | 
    
         
            +
                end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                include Connection
         
     | 
| 
      
 15 
     | 
    
         
            +
                include Request
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Client < API
         
     | 
| 
      
 3 
     | 
    
         
            +
                def classify(text, options={})
         
     | 
| 
      
 4 
     | 
    
         
            +
                  response = get("classify", options.merge(:text => text))
         
     | 
| 
      
 5 
     | 
    
         
            +
                  {:sentiment=>response["sentiment"], :translated_text=>response["translate_text"].to_s } if response 
         
     | 
| 
      
 6 
     | 
    
         
            +
                end
         
     | 
| 
      
 7 
     | 
    
         
            +
                def classify_simple(text, options={})
         
     | 
| 
      
 8 
     | 
    
         
            +
                  response = get("classify_simple", options.merge(:text => text))
         
     | 
| 
      
 9 
     | 
    
         
            +
                  response["value"] if response
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
                def lang_detect(text, options={})
         
     | 
| 
      
 12 
     | 
    
         
            +
                  response = get("lang/detect", options.merge(:text => text))
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
                def analyze(text, options={})
         
     | 
| 
      
 15 
     | 
    
         
            +
                  response = get("analyze", options.merge(:text => text))
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
                def search(options={})
         
     | 
| 
      
 18 
     | 
    
         
            +
                  response = get("search", options)
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,37 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'faraday'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.expand_path('../version', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Configuration
         
     | 
| 
      
 5 
     | 
    
         
            +
                VALID_OPTIONS_KEYS = [:endpoint, :format, :user_agent, :proxy, :adapter].freeze
         
     | 
| 
      
 6 
     | 
    
         
            +
                VALID_FORMATS = [:json, :xml].freeze
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                DEFAULT_FORMAT = :json.freeze
         
     | 
| 
      
 9 
     | 
    
         
            +
                DEFAULT_ENDPOINT = 'http://api.tweetsentiments.com:8080/api/'.freeze
         
     | 
| 
      
 10 
     | 
    
         
            +
                DEFAULT_USER_AGENT = "Tweetsentiments Ruby Gem #{Tweetsentiments::VERSION}".freeze
         
     | 
| 
      
 11 
     | 
    
         
            +
                DEFAULT_PROXY = nil.freeze
         
     | 
| 
      
 12 
     | 
    
         
            +
                DEFAULT_ADAPTER = Faraday.default_adapter.freeze
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_accessor *VALID_OPTIONS_KEYS
         
     | 
| 
      
 14 
     | 
    
         
            +
                
         
     | 
| 
      
 15 
     | 
    
         
            +
                def self.extended(base)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  base.reset
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                def configure
         
     | 
| 
      
 20 
     | 
    
         
            +
                  yield self
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                def options
         
     | 
| 
      
 24 
     | 
    
         
            +
                  VALID_OPTIONS_KEYS.inject({}) do |option, key|
         
     | 
| 
      
 25 
     | 
    
         
            +
                    option.merge!(key => send(key))
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                def reset
         
     | 
| 
      
 30 
     | 
    
         
            +
                  self.endpoint = DEFAULT_ENDPOINT
         
     | 
| 
      
 31 
     | 
    
         
            +
                  self.format = DEFAULT_FORMAT
         
     | 
| 
      
 32 
     | 
    
         
            +
                  self.user_agent = DEFAULT_USER_AGENT
         
     | 
| 
      
 33 
     | 
    
         
            +
                  self.proxy = DEFAULT_PROXY
         
     | 
| 
      
 34 
     | 
    
         
            +
                  self.adapter = DEFAULT_ADAPTER
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'faraday_middleware'
         
     | 
| 
      
 2 
     | 
    
         
            +
            Dir[File.expand_path('../../faraday/*.rb', __FILE__)].each{|f| require f}
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Connection
         
     | 
| 
      
 6 
     | 
    
         
            +
                private
         
     | 
| 
      
 7 
     | 
    
         
            +
                def connection(raw=false)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  options = {
         
     | 
| 
      
 9 
     | 
    
         
            +
                    :headers => {'Accept' => "application/#{format}", 'User-Agent' => user_agent},
         
     | 
| 
      
 10 
     | 
    
         
            +
                    :proxy => proxy,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    :ssl => {:verify => false},
         
     | 
| 
      
 12 
     | 
    
         
            +
                    :url => endpoint,
         
     | 
| 
      
 13 
     | 
    
         
            +
                  }
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                  Faraday::Connection.new(options) do |connection|
         
     | 
| 
      
 16 
     | 
    
         
            +
                    connection.use Faraday::Request::Multipart
         
     | 
| 
      
 17 
     | 
    
         
            +
                    connection.adapter(adapter)
         
     | 
| 
      
 18 
     | 
    
         
            +
                    connection.use Faraday::Response::RaiseHttp5xx
         
     | 
| 
      
 19 
     | 
    
         
            +
                    unless raw
         
     | 
| 
      
 20 
     | 
    
         
            +
                      case format.to_s.downcase
         
     | 
| 
      
 21 
     | 
    
         
            +
                        when 'json' then connection.use Faraday::Response::ParseJson
         
     | 
| 
      
 22 
     | 
    
         
            +
                        when 'xml' then connection.use Faraday::Response::ParseXml
         
     | 
| 
      
 23 
     | 
    
         
            +
                      end
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
                    connection.use Faraday::Response::RaiseHttp4xx
         
     | 
| 
      
 26 
     | 
    
         
            +
                    connection.use Faraday::Response::Mashify unless raw
         
     | 
| 
      
 27 
     | 
    
         
            +
                  end
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
              end
         
     | 
| 
      
 30 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,54 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Tweeetsentiments
         
     | 
| 
      
 2 
     | 
    
         
            +
              # Custom error class for rescuing from all server errors
         
     | 
| 
      
 3 
     | 
    
         
            +
              class Error < StandardError
         
     | 
| 
      
 4 
     | 
    
         
            +
                attr_reader :http_headers
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                def initialize(message, http_headers)
         
     | 
| 
      
 7 
     | 
    
         
            +
                  @http_headers = Hash[http_headers]
         
     | 
| 
      
 8 
     | 
    
         
            +
                  super message
         
     | 
| 
      
 9 
     | 
    
         
            +
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def ratelimit_reset
         
     | 
| 
      
 12 
     | 
    
         
            +
                  Time.at(@http_headers.values_at('x-ratelimit-reset', 'X-RateLimit-Reset').detect{|value| value}.to_i)
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                def ratelimit_limit
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @http_headers.values_at('x-ratelimit-limit', 'X-RateLimit-Limit').detect{|value| value}.to_i
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                def ratelimit_remaining
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @http_headers.values_at('x-ratelimit-remaining', 'X-RateLimit-Remaining').detect{|value| value}.to_i
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                def retry_after
         
     | 
| 
      
 24 
     | 
    
         
            +
                  [(ratelimit_reset - Time.now).ceil, 0].max
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 400
         
     | 
| 
      
 29 
     | 
    
         
            +
              class BadRequest < Error; end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 401
         
     | 
| 
      
 32 
     | 
    
         
            +
              class Unauthorized < Error; end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 403
         
     | 
| 
      
 35 
     | 
    
         
            +
              class Forbidden < Error; end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 404
         
     | 
| 
      
 38 
     | 
    
         
            +
              class NotFound < Error; end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 406
         
     | 
| 
      
 41 
     | 
    
         
            +
              class NotAcceptable < Error; end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 420
         
     | 
| 
      
 44 
     | 
    
         
            +
              class RateLimited < Error; end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 500
         
     | 
| 
      
 47 
     | 
    
         
            +
              class InternalServerError < Error; end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 502
         
     | 
| 
      
 50 
     | 
    
         
            +
              class BadGateway < Error; end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              # Raised when server returns the HTTP status code 503
         
     | 
| 
      
 53 
     | 
    
         
            +
              class ServiceUnavailable < Error; end
         
     | 
| 
      
 54 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Tweetsentiments
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Request
         
     | 
| 
      
 3 
     | 
    
         
            +
                def get(path, options={}, raw=false)
         
     | 
| 
      
 4 
     | 
    
         
            +
                  request(:get, path, options, raw)
         
     | 
| 
      
 5 
     | 
    
         
            +
                end
         
     | 
| 
      
 6 
     | 
    
         
            +
                def post(path, options={}, raw=false)
         
     | 
| 
      
 7 
     | 
    
         
            +
                  request(:post, path, options, raw)
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
                def put(path, options={}, raw=false)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  request(:put, path, options, raw)
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
                def delete(path, options={}, raw=false)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  request(:delete, path, options, raw)
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                private
         
     | 
| 
      
 17 
     | 
    
         
            +
                def request(method, path, options, raw)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  response = connection(raw).send(method) do |request|
         
     | 
| 
      
 19 
     | 
    
         
            +
                    case method
         
     | 
| 
      
 20 
     | 
    
         
            +
                    when :get, :delete
         
     | 
| 
      
 21 
     | 
    
         
            +
                      request.url(formatted_path(path), options)
         
     | 
| 
      
 22 
     | 
    
         
            +
                    when :post, :put
         
     | 
| 
      
 23 
     | 
    
         
            +
                      request.path = formatted_path(path)
         
     | 
| 
      
 24 
     | 
    
         
            +
                      request.body = options unless options.empty?
         
     | 
| 
      
 25 
     | 
    
         
            +
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                  raw ? response : response.body
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                def formatted_path(path)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  [path, format].compact.join('.')
         
     | 
| 
      
 32 
     | 
    
         
            +
                end
         
     | 
| 
      
 33 
     | 
    
         
            +
              end
         
     | 
| 
      
 34 
     | 
    
         
            +
            end
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path('../../lib/tweetsentiments', __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'rspec'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'webmock/rspec'
         
     | 
| 
      
 5 
     | 
    
         
            +
            # Requires supporting files with custom matchers and macros, etc,
         
     | 
| 
      
 6 
     | 
    
         
            +
            # in ./support/ and its subdirectories.
         
     | 
| 
      
 7 
     | 
    
         
            +
            Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
         
     | 
| 
      
 8 
     | 
    
         
            +
            RSpec.configure do |config|
         
     | 
| 
      
 9 
     | 
    
         
            +
              config.include WebMock::API
         
     | 
| 
      
 10 
     | 
    
         
            +
            end
         
     | 
| 
      
 11 
     | 
    
         
            +
            Tweetsentiments.configure do |config|
         
     | 
| 
      
 12 
     | 
    
         
            +
              #config.endpoint = "http://www.text.com"
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
      
 14 
     | 
    
         
            +
            def fixture_path
         
     | 
| 
      
 15 
     | 
    
         
            +
              File.expand_path("../fixtures", __FILE__)
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
      
 17 
     | 
    
         
            +
            def fixture(file)
         
     | 
| 
      
 18 
     | 
    
         
            +
              File.new(fixture_path + "/" + file)
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
      
 20 
     | 
    
         
            +
            def a_get(path)
         
     | 
| 
      
 21 
     | 
    
         
            +
              a_request(:get, Tweetsentiments.endpoint + path)
         
     | 
| 
      
 22 
     | 
    
         
            +
            end
         
     | 
| 
      
 23 
     | 
    
         
            +
            def stub_get(path)
         
     | 
| 
      
 24 
     | 
    
         
            +
              stub_request(:get, Tweetsentiments.endpoint + path)
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,85 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path('../../spec_helper', __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Tweetsentiments::Client do
         
     | 
| 
      
 4 
     | 
    
         
            +
              Tweetsentiments::Configuration::VALID_FORMATS.each do |format|
         
     | 
| 
      
 5 
     | 
    
         
            +
                context ".new(:format => '#{format}')" do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  before do
         
     | 
| 
      
 7 
     | 
    
         
            +
                    @text = "I am happy"
         
     | 
| 
      
 8 
     | 
    
         
            +
                    @user = "dhh"
         
     | 
| 
      
 9 
     | 
    
         
            +
                    @topic = "ipad2"
         
     | 
| 
      
 10 
     | 
    
         
            +
                    @client = Tweetsentiments::Client.new(:format => format)
         
     | 
| 
      
 11 
     | 
    
         
            +
                  end
         
     | 
| 
      
 12 
     | 
    
         
            +
                
         
     | 
| 
      
 13 
     | 
    
         
            +
                  describe ".classify(#{@text})" do
         
     | 
| 
      
 14 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 15 
     | 
    
         
            +
                      stub_get("classify.#{format}").
         
     | 
| 
      
 16 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 17 
     | 
    
         
            +
                        to_return(:body => fixture("classify.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
         
     | 
| 
      
 18 
     | 
    
         
            +
                    end
         
     | 
| 
      
 19 
     | 
    
         
            +
                    it "should get the correct resource" do
         
     | 
| 
      
 20 
     | 
    
         
            +
                      @client.classify(@text)
         
     | 
| 
      
 21 
     | 
    
         
            +
                      a_get("classify.#{format}").
         
     | 
| 
      
 22 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 23 
     | 
    
         
            +
                        should have_been_made
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
                  end
         
     | 
| 
      
 26 
     | 
    
         
            +
                  
         
     | 
| 
      
 27 
     | 
    
         
            +
                  describe ".classify_simple(#{@text})" do
         
     | 
| 
      
 28 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 29 
     | 
    
         
            +
                      stub_get("classify_simple.#{format}").
         
     | 
| 
      
 30 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 31 
     | 
    
         
            +
                        to_return(:body => fixture("classify.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
         
     | 
| 
      
 32 
     | 
    
         
            +
                    end
         
     | 
| 
      
 33 
     | 
    
         
            +
                    it "should get the correct resource" do
         
     | 
| 
      
 34 
     | 
    
         
            +
                      @client.classify_simple(@text)
         
     | 
| 
      
 35 
     | 
    
         
            +
                      a_get("classify_simple.#{format}").
         
     | 
| 
      
 36 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 37 
     | 
    
         
            +
                        should have_been_made
         
     | 
| 
      
 38 
     | 
    
         
            +
                    end
         
     | 
| 
      
 39 
     | 
    
         
            +
                  end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  describe ".analyze(#{@text})" do
         
     | 
| 
      
 42 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 43 
     | 
    
         
            +
                      stub_get("analyze.#{format}").
         
     | 
| 
      
 44 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 45 
     | 
    
         
            +
                        to_return(:body => fixture("analyze.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
         
     | 
| 
      
 46 
     | 
    
         
            +
                    end
         
     | 
| 
      
 47 
     | 
    
         
            +
                    it "should get the correct resource" do
         
     | 
| 
      
 48 
     | 
    
         
            +
                      @client.analyze(@text)
         
     | 
| 
      
 49 
     | 
    
         
            +
                      a_get("analyze.#{format}").
         
     | 
| 
      
 50 
     | 
    
         
            +
                        with(:query => {:text => @text}).
         
     | 
| 
      
 51 
     | 
    
         
            +
                        should have_been_made
         
     | 
| 
      
 52 
     | 
    
         
            +
                    end
         
     | 
| 
      
 53 
     | 
    
         
            +
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                  describe ".search(#{@topic})" do
         
     | 
| 
      
 56 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 57 
     | 
    
         
            +
                      stub_get("search.#{format}").
         
     | 
| 
      
 58 
     | 
    
         
            +
                        with(:query => {:topic => @topic}).
         
     | 
| 
      
 59 
     | 
    
         
            +
                        to_return(:body => fixture("search.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
         
     | 
| 
      
 60 
     | 
    
         
            +
                    end
         
     | 
| 
      
 61 
     | 
    
         
            +
                    it "should get the correct resource" do
         
     | 
| 
      
 62 
     | 
    
         
            +
                      @client.search(:topic=>@topic)
         
     | 
| 
      
 63 
     | 
    
         
            +
                      a_get("search.#{format}").
         
     | 
| 
      
 64 
     | 
    
         
            +
                        with(:query => {:topic => @topic}).
         
     | 
| 
      
 65 
     | 
    
         
            +
                        should have_been_made
         
     | 
| 
      
 66 
     | 
    
         
            +
                    end
         
     | 
| 
      
 67 
     | 
    
         
            +
                  end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                  describe ".search(#{@user})" do
         
     | 
| 
      
 70 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 71 
     | 
    
         
            +
                      stub_get("search.#{format}").
         
     | 
| 
      
 72 
     | 
    
         
            +
                        with(:query => {:user => @user}).
         
     | 
| 
      
 73 
     | 
    
         
            +
                        to_return(:body => fixture("search.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
         
     | 
| 
      
 74 
     | 
    
         
            +
                    end
         
     | 
| 
      
 75 
     | 
    
         
            +
                    it "should get the correct resource" do
         
     | 
| 
      
 76 
     | 
    
         
            +
                      @client.search(:user=>@user)
         
     | 
| 
      
 77 
     | 
    
         
            +
                      a_get("search.#{format}").
         
     | 
| 
      
 78 
     | 
    
         
            +
                        with(:query => {:user => @user}).
         
     | 
| 
      
 79 
     | 
    
         
            +
                        should have_been_made
         
     | 
| 
      
 80 
     | 
    
         
            +
                    end
         
     | 
| 
      
 81 
     | 
    
         
            +
                  end
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
                end
         
     | 
| 
      
 84 
     | 
    
         
            +
              end
         
     | 
| 
      
 85 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.expand_path('../spec_helper', __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Tweetsentiments do
         
     | 
| 
      
 4 
     | 
    
         
            +
              describe ".client" do
         
     | 
| 
      
 5 
     | 
    
         
            +
                it "should be a Tweetsentiments::Client" do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  Tweetsentiments.client.should be_a Tweetsentiments::Client
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
              describe ".configure" do
         
     | 
| 
      
 10 
     | 
    
         
            +
                Tweetsentiments::Configuration::VALID_OPTIONS_KEYS.each do |key|
         
     | 
| 
      
 11 
     | 
    
         
            +
                  it "should set the #{key}" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                    Tweetsentiments.configure do |config|
         
     | 
| 
      
 13 
     | 
    
         
            +
                      config.send("#{key}=", key)
         
     | 
| 
      
 14 
     | 
    
         
            +
                      Tweetsentiments.send(key).should == key
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,112 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Generated by jeweler
         
     | 
| 
      
 2 
     | 
    
         
            +
            # DO NOT EDIT THIS FILE DIRECTLY
         
     | 
| 
      
 3 
     | 
    
         
            +
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         
     | 
| 
      
 4 
     | 
    
         
            +
            # -*- encoding: utf-8 -*-
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |s|
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.name = %q{tweetsentiments}
         
     | 
| 
      
 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 = ["Yong Gu", "Tom Zeng"]
         
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = %q{2011-10-30}
         
     | 
| 
      
 13 
     | 
    
         
            +
              s.description = %q{A Ruby wrapper for the www.tweetsentiments.com REST APIs}
         
     | 
| 
      
 14 
     | 
    
         
            +
              s.email = %q{tom@intridea.com, yonggu@intridea.com}
         
     | 
| 
      
 15 
     | 
    
         
            +
              s.extra_rdoc_files = [
         
     | 
| 
      
 16 
     | 
    
         
            +
                "LICENSE.txt",
         
     | 
| 
      
 17 
     | 
    
         
            +
                "README.rdoc"
         
     | 
| 
      
 18 
     | 
    
         
            +
              ]
         
     | 
| 
      
 19 
     | 
    
         
            +
              s.files = [
         
     | 
| 
      
 20 
     | 
    
         
            +
                ".document",
         
     | 
| 
      
 21 
     | 
    
         
            +
                ".rspec",
         
     | 
| 
      
 22 
     | 
    
         
            +
                "Gemfile",
         
     | 
| 
      
 23 
     | 
    
         
            +
                "Gemfile.lock",
         
     | 
| 
      
 24 
     | 
    
         
            +
                "LICENSE.txt",
         
     | 
| 
      
 25 
     | 
    
         
            +
                "README.rdoc",
         
     | 
| 
      
 26 
     | 
    
         
            +
                "Rakefile",
         
     | 
| 
      
 27 
     | 
    
         
            +
                "autotest/discover.rb",
         
     | 
| 
      
 28 
     | 
    
         
            +
                "lib/faraday/raise_http_4xx.rb",
         
     | 
| 
      
 29 
     | 
    
         
            +
                "lib/faraday/raise_http_5xx.rb",
         
     | 
| 
      
 30 
     | 
    
         
            +
                "lib/tweetsentiments.rb",
         
     | 
| 
      
 31 
     | 
    
         
            +
                "lib/tweetsentiments/api.rb",
         
     | 
| 
      
 32 
     | 
    
         
            +
                "lib/tweetsentiments/client.rb",
         
     | 
| 
      
 33 
     | 
    
         
            +
                "lib/tweetsentiments/configuration.rb",
         
     | 
| 
      
 34 
     | 
    
         
            +
                "lib/tweetsentiments/connection.rb",
         
     | 
| 
      
 35 
     | 
    
         
            +
                "lib/tweetsentiments/error.rb",
         
     | 
| 
      
 36 
     | 
    
         
            +
                "lib/tweetsentiments/request.rb",
         
     | 
| 
      
 37 
     | 
    
         
            +
                "lib/tweetsentiments/version.rb",
         
     | 
| 
      
 38 
     | 
    
         
            +
                "spec/fixtures/analyze.json",
         
     | 
| 
      
 39 
     | 
    
         
            +
                "spec/fixtures/analyze.xml",
         
     | 
| 
      
 40 
     | 
    
         
            +
                "spec/fixtures/classify.json",
         
     | 
| 
      
 41 
     | 
    
         
            +
                "spec/fixtures/classify.xml",
         
     | 
| 
      
 42 
     | 
    
         
            +
                "spec/fixtures/classify_simple.json",
         
     | 
| 
      
 43 
     | 
    
         
            +
                "spec/fixtures/classify_simple.xml",
         
     | 
| 
      
 44 
     | 
    
         
            +
                "spec/fixtures/search.json",
         
     | 
| 
      
 45 
     | 
    
         
            +
                "spec/fixtures/search.xml",
         
     | 
| 
      
 46 
     | 
    
         
            +
                "spec/spec_helper.rb",
         
     | 
| 
      
 47 
     | 
    
         
            +
                "spec/tweetsentiments/client_spec.rb",
         
     | 
| 
      
 48 
     | 
    
         
            +
                "spec/tweetsentiments_spec.rb",
         
     | 
| 
      
 49 
     | 
    
         
            +
                "tweetsentiments.gemspec"
         
     | 
| 
      
 50 
     | 
    
         
            +
              ]
         
     | 
| 
      
 51 
     | 
    
         
            +
              s.homepage = %q{https://github.com/tomz/tweetsentiments}
         
     | 
| 
      
 52 
     | 
    
         
            +
              s.licenses = ["MIT"]
         
     | 
| 
      
 53 
     | 
    
         
            +
              s.require_paths = ["lib"]
         
     | 
| 
      
 54 
     | 
    
         
            +
              s.rubygems_version = %q{1.3.7}
         
     | 
| 
      
 55 
     | 
    
         
            +
              s.summary = %q{A Ruby wrapper for the www.tweetsentiments.com REST APIS}
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
              if s.respond_to? :specification_version then
         
     | 
| 
      
 58 
     | 
    
         
            +
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         
     | 
| 
      
 59 
     | 
    
         
            +
                s.specification_version = 3
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         
     | 
| 
      
 62 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 63 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 64 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<multi_xml>, [">= 0"])
         
     | 
| 
      
 65 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<multi_json>, [">= 0"])
         
     | 
| 
      
 66 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<hashie>, [">= 0"])
         
     | 
| 
      
 67 
     | 
    
         
            +
                  s.add_development_dependency(%q<json>, [">= 0"])
         
     | 
| 
      
 68 
     | 
    
         
            +
                  s.add_development_dependency(%q<ZenTest>, [">= 0"])
         
     | 
| 
      
 69 
     | 
    
         
            +
                  s.add_development_dependency(%q<rake>, [">= 0"])
         
     | 
| 
      
 70 
     | 
    
         
            +
                  s.add_development_dependency(%q<rspec>, [">= 0"])
         
     | 
| 
      
 71 
     | 
    
         
            +
                  s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
         
     | 
| 
      
 72 
     | 
    
         
            +
                  s.add_development_dependency(%q<jeweler>, [">= 1.5.1"])
         
     | 
| 
      
 73 
     | 
    
         
            +
                  s.add_development_dependency(%q<rcov>, [">= 0"])
         
     | 
| 
      
 74 
     | 
    
         
            +
                  s.add_development_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 75 
     | 
    
         
            +
                  s.add_development_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 76 
     | 
    
         
            +
                  s.add_development_dependency(%q<webmock>, [">= 0"])
         
     | 
| 
      
 77 
     | 
    
         
            +
                else
         
     | 
| 
      
 78 
     | 
    
         
            +
                  s.add_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 79 
     | 
    
         
            +
                  s.add_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 80 
     | 
    
         
            +
                  s.add_dependency(%q<multi_xml>, [">= 0"])
         
     | 
| 
      
 81 
     | 
    
         
            +
                  s.add_dependency(%q<multi_json>, [">= 0"])
         
     | 
| 
      
 82 
     | 
    
         
            +
                  s.add_dependency(%q<hashie>, [">= 0"])
         
     | 
| 
      
 83 
     | 
    
         
            +
                  s.add_dependency(%q<json>, [">= 0"])
         
     | 
| 
      
 84 
     | 
    
         
            +
                  s.add_dependency(%q<ZenTest>, [">= 0"])
         
     | 
| 
      
 85 
     | 
    
         
            +
                  s.add_dependency(%q<rake>, [">= 0"])
         
     | 
| 
      
 86 
     | 
    
         
            +
                  s.add_dependency(%q<rspec>, [">= 0"])
         
     | 
| 
      
 87 
     | 
    
         
            +
                  s.add_dependency(%q<bundler>, [">= 1.0.0"])
         
     | 
| 
      
 88 
     | 
    
         
            +
                  s.add_dependency(%q<jeweler>, [">= 1.5.1"])
         
     | 
| 
      
 89 
     | 
    
         
            +
                  s.add_dependency(%q<rcov>, [">= 0"])
         
     | 
| 
      
 90 
     | 
    
         
            +
                  s.add_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 91 
     | 
    
         
            +
                  s.add_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 92 
     | 
    
         
            +
                  s.add_dependency(%q<webmock>, [">= 0"])
         
     | 
| 
      
 93 
     | 
    
         
            +
                end
         
     | 
| 
      
 94 
     | 
    
         
            +
              else
         
     | 
| 
      
 95 
     | 
    
         
            +
                s.add_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 96 
     | 
    
         
            +
                s.add_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 97 
     | 
    
         
            +
                s.add_dependency(%q<multi_xml>, [">= 0"])
         
     | 
| 
      
 98 
     | 
    
         
            +
                s.add_dependency(%q<multi_json>, [">= 0"])
         
     | 
| 
      
 99 
     | 
    
         
            +
                s.add_dependency(%q<hashie>, [">= 0"])
         
     | 
| 
      
 100 
     | 
    
         
            +
                s.add_dependency(%q<json>, [">= 0"])
         
     | 
| 
      
 101 
     | 
    
         
            +
                s.add_dependency(%q<ZenTest>, [">= 0"])
         
     | 
| 
      
 102 
     | 
    
         
            +
                s.add_dependency(%q<rake>, [">= 0"])
         
     | 
| 
      
 103 
     | 
    
         
            +
                s.add_dependency(%q<rspec>, [">= 0"])
         
     | 
| 
      
 104 
     | 
    
         
            +
                s.add_dependency(%q<bundler>, [">= 1.0.0"])
         
     | 
| 
      
 105 
     | 
    
         
            +
                s.add_dependency(%q<jeweler>, [">= 1.5.1"])
         
     | 
| 
      
 106 
     | 
    
         
            +
                s.add_dependency(%q<rcov>, [">= 0"])
         
     | 
| 
      
 107 
     | 
    
         
            +
                s.add_dependency(%q<faraday>, [">= 0"])
         
     | 
| 
      
 108 
     | 
    
         
            +
                s.add_dependency(%q<faraday_middleware>, [">= 0"])
         
     | 
| 
      
 109 
     | 
    
         
            +
                s.add_dependency(%q<webmock>, [">= 0"])
         
     | 
| 
      
 110 
     | 
    
         
            +
              end
         
     | 
| 
      
 111 
     | 
    
         
            +
            end
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,329 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification 
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: tweetsentiments
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 25
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 6 
     | 
    
         
            +
              segments: 
         
     | 
| 
      
 7 
     | 
    
         
            +
              - 0
         
     | 
| 
      
 8 
     | 
    
         
            +
              - 1
         
     | 
| 
      
 9 
     | 
    
         
            +
              - 1
         
     | 
| 
      
 10 
     | 
    
         
            +
              segments_generated: true
         
     | 
| 
      
 11 
     | 
    
         
            +
              version: 0.1.1
         
     | 
| 
      
 12 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 13 
     | 
    
         
            +
            authors: 
         
     | 
| 
      
 14 
     | 
    
         
            +
            - Yong Gu
         
     | 
| 
      
 15 
     | 
    
         
            +
            - Tom Zeng
         
     | 
| 
      
 16 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 17 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 18 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            date: 2011-10-30 00:00:00 -04:00
         
     | 
| 
      
 21 
     | 
    
         
            +
            default_executable: 
         
     | 
| 
      
 22 
     | 
    
         
            +
            dependencies: 
         
     | 
| 
      
 23 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: &id001 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 25 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 26 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 29 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 30 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 31 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 32 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 34 
     | 
    
         
            +
              requirement: *id001
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 37 
     | 
    
         
            +
              name: faraday
         
     | 
| 
      
 38 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 39 
     | 
    
         
            +
              version_requirements: &id002 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 40 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 41 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 42 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 43 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 44 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 45 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 46 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 47 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 48 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 49 
     | 
    
         
            +
              requirement: *id002
         
     | 
| 
      
 50 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 51 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 52 
     | 
    
         
            +
              name: faraday_middleware
         
     | 
| 
      
 53 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 54 
     | 
    
         
            +
              version_requirements: &id003 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 55 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 56 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 57 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 58 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 59 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 60 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 61 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 62 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 63 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 64 
     | 
    
         
            +
              requirement: *id003
         
     | 
| 
      
 65 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 66 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 67 
     | 
    
         
            +
              name: multi_xml
         
     | 
| 
      
 68 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 69 
     | 
    
         
            +
              version_requirements: &id004 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 70 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 71 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 72 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 73 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 74 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 75 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 76 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 77 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 78 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 79 
     | 
    
         
            +
              requirement: *id004
         
     | 
| 
      
 80 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 81 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 82 
     | 
    
         
            +
              name: multi_json
         
     | 
| 
      
 83 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 84 
     | 
    
         
            +
              version_requirements: &id005 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 85 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 89 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 90 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 91 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 92 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 93 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 94 
     | 
    
         
            +
              requirement: *id005
         
     | 
| 
      
 95 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 96 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 97 
     | 
    
         
            +
              name: hashie
         
     | 
| 
      
 98 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 99 
     | 
    
         
            +
              version_requirements: &id006 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 100 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 101 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 102 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 103 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 104 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 105 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 106 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 107 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 108 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 109 
     | 
    
         
            +
              requirement: *id006
         
     | 
| 
      
 110 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 111 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 112 
     | 
    
         
            +
              name: json
         
     | 
| 
      
 113 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 114 
     | 
    
         
            +
              version_requirements: &id007 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 115 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 116 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 117 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 118 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 119 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 120 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 121 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 122 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 123 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 124 
     | 
    
         
            +
              requirement: *id007
         
     | 
| 
      
 125 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 126 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 127 
     | 
    
         
            +
              name: ZenTest
         
     | 
| 
      
 128 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 129 
     | 
    
         
            +
              version_requirements: &id008 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 130 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 131 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 132 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 133 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 134 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 135 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 136 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 137 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 138 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 139 
     | 
    
         
            +
              requirement: *id008
         
     | 
| 
      
 140 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 141 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 142 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 143 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 144 
     | 
    
         
            +
              version_requirements: &id009 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 145 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 146 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 147 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 148 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 149 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 150 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 151 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 152 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 153 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 154 
     | 
    
         
            +
              requirement: *id009
         
     | 
| 
      
 155 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 156 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 157 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 158 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 159 
     | 
    
         
            +
              version_requirements: &id010 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 160 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 161 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 162 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 163 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 164 
     | 
    
         
            +
                    hash: 23
         
     | 
| 
      
 165 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 166 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 167 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 168 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 169 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 170 
     | 
    
         
            +
                    version: 1.0.0
         
     | 
| 
      
 171 
     | 
    
         
            +
              requirement: *id010
         
     | 
| 
      
 172 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 173 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 174 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 175 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 176 
     | 
    
         
            +
              version_requirements: &id011 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 177 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 178 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 179 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 180 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 181 
     | 
    
         
            +
                    hash: 1
         
     | 
| 
      
 182 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 183 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 184 
     | 
    
         
            +
                    - 5
         
     | 
| 
      
 185 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 186 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 187 
     | 
    
         
            +
                    version: 1.5.1
         
     | 
| 
      
 188 
     | 
    
         
            +
              requirement: *id011
         
     | 
| 
      
 189 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 190 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 191 
     | 
    
         
            +
              name: jeweler
         
     | 
| 
      
 192 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 193 
     | 
    
         
            +
              version_requirements: &id012 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 194 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 195 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 196 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 197 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 198 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 199 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 200 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 201 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 202 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 203 
     | 
    
         
            +
              requirement: *id012
         
     | 
| 
      
 204 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 205 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 206 
     | 
    
         
            +
              name: rcov
         
     | 
| 
      
 207 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 208 
     | 
    
         
            +
              version_requirements: &id013 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 209 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 210 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 211 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 212 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 213 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 214 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 215 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 216 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 217 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 218 
     | 
    
         
            +
              requirement: *id013
         
     | 
| 
      
 219 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 220 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 221 
     | 
    
         
            +
              name: faraday
         
     | 
| 
      
 222 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 223 
     | 
    
         
            +
              version_requirements: &id014 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 224 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 225 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 226 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 227 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 228 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 229 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 230 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 231 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 232 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 233 
     | 
    
         
            +
              requirement: *id014
         
     | 
| 
      
 234 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 235 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 236 
     | 
    
         
            +
              name: faraday_middleware
         
     | 
| 
      
 237 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 238 
     | 
    
         
            +
              version_requirements: &id015 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 239 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 240 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 241 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 242 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 243 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
      
 244 
     | 
    
         
            +
                    segments: 
         
     | 
| 
      
 245 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 246 
     | 
    
         
            +
                    segments_generated: true
         
     | 
| 
      
 247 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 248 
     | 
    
         
            +
              requirement: *id015
         
     | 
| 
      
 249 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 250 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 251 
     | 
    
         
            +
              name: webmock
         
     | 
| 
      
 252 
     | 
    
         
            +
            description: A Ruby wrapper for the www.tweetsentiments.com REST APIs
         
     | 
| 
      
 253 
     | 
    
         
            +
            email: tom@intridea.com, yonggu@intridea.com
         
     | 
| 
      
 254 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 255 
     | 
    
         
            +
             
     | 
| 
      
 256 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 257 
     | 
    
         
            +
             
     | 
| 
      
 258 
     | 
    
         
            +
            extra_rdoc_files: 
         
     | 
| 
      
 259 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 260 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 261 
     | 
    
         
            +
            files: 
         
     | 
| 
      
 262 
     | 
    
         
            +
            - .document
         
     | 
| 
      
 263 
     | 
    
         
            +
            - .rspec
         
     | 
| 
      
 264 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 265 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
      
 266 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 267 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 268 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 269 
     | 
    
         
            +
            - autotest/discover.rb
         
     | 
| 
      
 270 
     | 
    
         
            +
            - lib/faraday/raise_http_4xx.rb
         
     | 
| 
      
 271 
     | 
    
         
            +
            - lib/faraday/raise_http_5xx.rb
         
     | 
| 
      
 272 
     | 
    
         
            +
            - lib/tweetsentiments.rb
         
     | 
| 
      
 273 
     | 
    
         
            +
            - lib/tweetsentiments/api.rb
         
     | 
| 
      
 274 
     | 
    
         
            +
            - lib/tweetsentiments/client.rb
         
     | 
| 
      
 275 
     | 
    
         
            +
            - lib/tweetsentiments/configuration.rb
         
     | 
| 
      
 276 
     | 
    
         
            +
            - lib/tweetsentiments/connection.rb
         
     | 
| 
      
 277 
     | 
    
         
            +
            - lib/tweetsentiments/error.rb
         
     | 
| 
      
 278 
     | 
    
         
            +
            - lib/tweetsentiments/request.rb
         
     | 
| 
      
 279 
     | 
    
         
            +
            - lib/tweetsentiments/version.rb
         
     | 
| 
      
 280 
     | 
    
         
            +
            - spec/fixtures/analyze.json
         
     | 
| 
      
 281 
     | 
    
         
            +
            - spec/fixtures/analyze.xml
         
     | 
| 
      
 282 
     | 
    
         
            +
            - spec/fixtures/classify.json
         
     | 
| 
      
 283 
     | 
    
         
            +
            - spec/fixtures/classify.xml
         
     | 
| 
      
 284 
     | 
    
         
            +
            - spec/fixtures/classify_simple.json
         
     | 
| 
      
 285 
     | 
    
         
            +
            - spec/fixtures/classify_simple.xml
         
     | 
| 
      
 286 
     | 
    
         
            +
            - spec/fixtures/search.json
         
     | 
| 
      
 287 
     | 
    
         
            +
            - spec/fixtures/search.xml
         
     | 
| 
      
 288 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 289 
     | 
    
         
            +
            - spec/tweetsentiments/client_spec.rb
         
     | 
| 
      
 290 
     | 
    
         
            +
            - spec/tweetsentiments_spec.rb
         
     | 
| 
      
 291 
     | 
    
         
            +
            - tweetsentiments.gemspec
         
     | 
| 
      
 292 
     | 
    
         
            +
            has_rdoc: true
         
     | 
| 
      
 293 
     | 
    
         
            +
            homepage: https://github.com/tomz/tweetsentiments
         
     | 
| 
      
 294 
     | 
    
         
            +
            licenses: 
         
     | 
| 
      
 295 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 296 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 297 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 298 
     | 
    
         
            +
             
     | 
| 
      
 299 
     | 
    
         
            +
            require_paths: 
         
     | 
| 
      
 300 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 301 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 302 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 303 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 304 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 305 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 306 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 307 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 308 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 309 
     | 
    
         
            +
                  segments_generated: true
         
     | 
| 
      
 310 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 311 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 312 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 313 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 314 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 315 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 316 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 317 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 318 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 319 
     | 
    
         
            +
                  segments_generated: true
         
     | 
| 
      
 320 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 321 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 322 
     | 
    
         
            +
             
     | 
| 
      
 323 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 324 
     | 
    
         
            +
            rubygems_version: 1.3.7
         
     | 
| 
      
 325 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 326 
     | 
    
         
            +
            specification_version: 3
         
     | 
| 
      
 327 
     | 
    
         
            +
            summary: A Ruby wrapper for the www.tweetsentiments.com REST APIS
         
     | 
| 
      
 328 
     | 
    
         
            +
            test_files: []
         
     | 
| 
      
 329 
     | 
    
         
            +
             
     |