ttwatcher 1.0.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.
- checksums.yaml +7 -0
 - data/Gemfile +20 -0
 - data/LICENSE +9 -0
 - data/sources/ttwatcher.rb +70 -0
 - data/sources/ttwatcher/helpers.rb +24 -0
 - data/sources/ttwatcher/logger.rb +40 -0
 - data/sources/ttwatcher/project_structure.rb +50 -0
 - data/sources/ttwatcher/sites.rb +68 -0
 - data/sources/ttwatcher/sites/config.rb +20 -0
 - data/sources/ttwatcher/sites/config.yml +29 -0
 - data/sources/ttwatcher/sites/connection.rb +82 -0
 - data/sources/ttwatcher/sites/connection/scheme.rb +79 -0
 - data/sources/ttwatcher/sites/connection/url.rb +66 -0
 - data/sources/ttwatcher/sites/megashara.rb +18 -0
 - data/sources/ttwatcher/sites/parsers/abstract_parser.rb +39 -0
 - data/sources/ttwatcher/sites/parsers/megashara_parser.rb +64 -0
 - data/sources/ttwatcher/sites/parsers/rutor_parser.rb +67 -0
 - data/sources/ttwatcher/sites/parsers/simple_parser.rb +134 -0
 - data/sources/ttwatcher/sites/parsers/unionpeer_parser.rb +62 -0
 - data/sources/ttwatcher/sites/parsers/zooqle_parser.rb +80 -0
 - data/sources/ttwatcher/sites/rutor.rb +13 -0
 - data/sources/ttwatcher/sites/site.rb +92 -0
 - data/sources/ttwatcher/sites/torrent_site.rb +70 -0
 - data/sources/ttwatcher/sites/unionpeer.rb +18 -0
 - data/sources/ttwatcher/sites/zooqle.rb +18 -0
 - data/sources/ttwatcher/torrent.rb +87 -0
 - data/sources/ttwatcher/torrent_agent.rb +34 -0
 - data/sources/ttwatcher/torrent_list.rb +51 -0
 - data/spec/sources/ttwatcher/sites_spec.rb +8 -0
 - data/spec/sources/ttwatcher/torrent_list_spec.rb +46 -0
 - data/spec/spec_helper.rb +20 -0
 - metadata +156 -0
 
| 
         @@ -0,0 +1,46 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # encoding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module TTWatcher
         
     | 
| 
      
 6 
     | 
    
         
            +
              describe TorrentList do
         
     | 
| 
      
 7 
     | 
    
         
            +
                before(:each) do
         
     | 
| 
      
 8 
     | 
    
         
            +
                  hide_const "TTWatcher::Torrent"
         
     | 
| 
      
 9 
     | 
    
         
            +
                  fake_klass = begin class Torrent; end; Torrent end
         
     | 
| 
      
 10 
     | 
    
         
            +
                  stub_const "TTWatcher::Torrent", fake_klass
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                context '#push' do
         
     | 
| 
      
 14 
     | 
    
         
            +
                  it 'raises an exception when not allowed object going to be pushed' do
         
     | 
| 
      
 15 
     | 
    
         
            +
                    list = described_class.new
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                    expect{ list.push 5 }
         
     | 
| 
      
 18 
     | 
    
         
            +
                      .to raise_exception described_class::UnexpectedClass
         
     | 
| 
      
 19 
     | 
    
         
            +
                  end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                  it 'pushes Torrent instance to the list' do
         
     | 
| 
      
 22 
     | 
    
         
            +
                    list = described_class.new
         
     | 
| 
      
 23 
     | 
    
         
            +
                    fake_instance = Torrent.new
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                    expect(list.push(fake_instance).any?).to be true
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                end # context '#push'
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                # ----------------------------------------------------
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                context '#new' do
         
     | 
| 
      
 34 
     | 
    
         
            +
                  it 'responds on Enumerable mixin methods' do
         
     | 
| 
      
 35 
     | 
    
         
            +
                    list = described_class.new
         
     | 
| 
      
 36 
     | 
    
         
            +
                    fake_instance = Torrent.new
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                    6.times { list << fake_instance.dup }
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                    expect(list.count).to eq 6
         
     | 
| 
      
 41 
     | 
    
         
            +
                    expect(list.first).to_not be_nil
         
     | 
| 
      
 42 
     | 
    
         
            +
                    expect(list.take 2).to be_instance_of Array
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
                end # context '#new'
         
     | 
| 
      
 45 
     | 
    
         
            +
              end # describe TorrentList
         
     | 
| 
      
 46 
     | 
    
         
            +
            end # module TTWatcher
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # encoding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'coveralls'
         
     | 
| 
      
 4 
     | 
    
         
            +
            Coveralls.wear!
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            require 'webmock/rspec'
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            require_relative '../sources/ttwatcher'
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            RSpec.configure do |config|
         
     | 
| 
      
 11 
     | 
    
         
            +
              WebMock.disable_net_connect! allow_localhost: true
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              config.after(:all) do
         
     | 
| 
      
 14 
     | 
    
         
            +
                pathname = Pathname.new(File.join(__root__, 'tmp'))
         
     | 
| 
      
 15 
     | 
    
         
            +
                pathname.children.reject { |c| c.basename.to_s == '.gitkeep' }
         
     | 
| 
      
 16 
     | 
    
         
            +
                                 .each(&:unlink)
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            SimpleCov.coverage_dir "spec/coverage"
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,156 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: ttwatcher
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.1
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Kuzichev Michael
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-01-03 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: addressable
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '2.3'
         
     | 
| 
      
 20 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 21 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 22 
     | 
    
         
            +
                    version: 2.3.6
         
     | 
| 
      
 23 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 24 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 25 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 26 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 29 
     | 
    
         
            +
                    version: '2.3'
         
     | 
| 
      
 30 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 31 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 32 
     | 
    
         
            +
                    version: 2.3.6
         
     | 
| 
      
 33 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 34 
     | 
    
         
            +
              name: rest-client
         
     | 
| 
      
 35 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 36 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 37 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 38 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 39 
     | 
    
         
            +
                    version: '2.0'
         
     | 
| 
      
 40 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 41 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 42 
     | 
    
         
            +
                    version: 2.0.0
         
     | 
| 
      
 43 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 44 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 45 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 46 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 47 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 48 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 49 
     | 
    
         
            +
                    version: '2.0'
         
     | 
| 
      
 50 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 51 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 52 
     | 
    
         
            +
                    version: 2.0.0
         
     | 
| 
      
 53 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 54 
     | 
    
         
            +
              name: nokogiri
         
     | 
| 
      
 55 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 56 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 57 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 58 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 59 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 60 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 61 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 62 
     | 
    
         
            +
                    version: 1.7.0
         
     | 
| 
      
 63 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 64 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 65 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 66 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 67 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 68 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 69 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 70 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 71 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 72 
     | 
    
         
            +
                    version: 1.7.0
         
     | 
| 
      
 73 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 74 
     | 
    
         
            +
              name: deep_merge
         
     | 
| 
      
 75 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 76 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 77 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 78 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 79 
     | 
    
         
            +
                    version: '1.1'
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                    version: 1.1.1
         
     | 
| 
      
 83 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 84 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 85 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '1.1'
         
     | 
| 
      
 90 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 91 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 92 
     | 
    
         
            +
                    version: 1.1.1
         
     | 
| 
      
 93 
     | 
    
         
            +
            description: 
         
     | 
| 
      
 94 
     | 
    
         
            +
            email: kMedvedu@gmail.com
         
     | 
| 
      
 95 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 96 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 97 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 98 
     | 
    
         
            +
            files:
         
     | 
| 
      
 99 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 100 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 101 
     | 
    
         
            +
            - sources/ttwatcher.rb
         
     | 
| 
      
 102 
     | 
    
         
            +
            - sources/ttwatcher/helpers.rb
         
     | 
| 
      
 103 
     | 
    
         
            +
            - sources/ttwatcher/logger.rb
         
     | 
| 
      
 104 
     | 
    
         
            +
            - sources/ttwatcher/project_structure.rb
         
     | 
| 
      
 105 
     | 
    
         
            +
            - sources/ttwatcher/sites.rb
         
     | 
| 
      
 106 
     | 
    
         
            +
            - sources/ttwatcher/sites/config.rb
         
     | 
| 
      
 107 
     | 
    
         
            +
            - sources/ttwatcher/sites/config.yml
         
     | 
| 
      
 108 
     | 
    
         
            +
            - sources/ttwatcher/sites/connection.rb
         
     | 
| 
      
 109 
     | 
    
         
            +
            - sources/ttwatcher/sites/connection/scheme.rb
         
     | 
| 
      
 110 
     | 
    
         
            +
            - sources/ttwatcher/sites/connection/url.rb
         
     | 
| 
      
 111 
     | 
    
         
            +
            - sources/ttwatcher/sites/megashara.rb
         
     | 
| 
      
 112 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/abstract_parser.rb
         
     | 
| 
      
 113 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/megashara_parser.rb
         
     | 
| 
      
 114 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/rutor_parser.rb
         
     | 
| 
      
 115 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/simple_parser.rb
         
     | 
| 
      
 116 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/unionpeer_parser.rb
         
     | 
| 
      
 117 
     | 
    
         
            +
            - sources/ttwatcher/sites/parsers/zooqle_parser.rb
         
     | 
| 
      
 118 
     | 
    
         
            +
            - sources/ttwatcher/sites/rutor.rb
         
     | 
| 
      
 119 
     | 
    
         
            +
            - sources/ttwatcher/sites/site.rb
         
     | 
| 
      
 120 
     | 
    
         
            +
            - sources/ttwatcher/sites/torrent_site.rb
         
     | 
| 
      
 121 
     | 
    
         
            +
            - sources/ttwatcher/sites/unionpeer.rb
         
     | 
| 
      
 122 
     | 
    
         
            +
            - sources/ttwatcher/sites/zooqle.rb
         
     | 
| 
      
 123 
     | 
    
         
            +
            - sources/ttwatcher/torrent.rb
         
     | 
| 
      
 124 
     | 
    
         
            +
            - sources/ttwatcher/torrent_agent.rb
         
     | 
| 
      
 125 
     | 
    
         
            +
            - sources/ttwatcher/torrent_list.rb
         
     | 
| 
      
 126 
     | 
    
         
            +
            - spec/sources/ttwatcher/sites_spec.rb
         
     | 
| 
      
 127 
     | 
    
         
            +
            - spec/sources/ttwatcher/torrent_list_spec.rb
         
     | 
| 
      
 128 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 129 
     | 
    
         
            +
            homepage: https://github.com/Medvedu/TTWatcher
         
     | 
| 
      
 130 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 131 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 132 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 133 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 134 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 135 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 136 
     | 
    
         
            +
            - sources
         
     | 
| 
      
 137 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 138 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 139 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 140 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 141 
     | 
    
         
            +
                  version: '2.3'
         
     | 
| 
      
 142 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 143 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 144 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 145 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 146 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 147 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 148 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 149 
     | 
    
         
            +
            rubygems_version: 2.6.8
         
     | 
| 
      
 150 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 151 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 152 
     | 
    
         
            +
            summary: Torrents search tool for [rutor|unionpeer|megashara|zooqle] sites.
         
     | 
| 
      
 153 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 154 
     | 
    
         
            +
            - spec/sources/ttwatcher/torrent_list_spec.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - spec/sources/ttwatcher/sites_spec.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     |