kinopoisk_parser 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24653cc8767111eb4cd54ceede08d3ab8dd9a5b4
4
- data.tar.gz: 2f85849f90e4befe2b30f3580de2c68cba14f732
3
+ metadata.gz: e56c2aead71c161dcf774ec7922462ce05eaf013
4
+ data.tar.gz: 5cf48abed4e93df9f0f3e1be871714235bd86555
5
5
  SHA512:
6
- metadata.gz: c3f3c5adc813675d9cea5a87f26c7f70dbb6e4546c31bd62832d39135463ca777a54e7864435e51cba1dae460f606868014ffebb6fc6b6d986e3cde6cd9310fc
7
- data.tar.gz: fa98e16ff3b6d4960f6d92d43950abe799640d9ba324173410f4d51fa85d78b1755c8625e3576b2728f738917523765146a8b9c98bb7fe8f10868dba53b561a0
6
+ metadata.gz: e9d094cf5c798f8b361ecdf60e65d3001d0913da828685075a3cb91f6033dff8b0426437cf6f5786fa6d9615313e9d68e719ef21f674d084ba84f169502e5ea0
7
+ data.tar.gz: 7a633600b10a91bc67637e69d01f3b1139945d5bdcfda9230d49491707cf65a8f89008faba1002966849bd8303b591b06b0c5915cb0ef6889dcc47af438cabbb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'kinopoisk_parser'
3
- gem.version = '2.1.0'
3
+ gem.version = '2.2.0'
4
4
  gem.authors = ['RavWar']
5
5
  gem.email = ['rav_war@mail.ru']
6
6
  gem.homepage = 'https://github.com/RavWar/kinopoisk_parser'
@@ -15,7 +15,7 @@ module Kinopoisk
15
15
  #
16
16
  def initialize(input, title=nil)
17
17
  @id = input.is_a?(String) ? find_by_title(input) : input
18
- @url = "http://www.kinopoisk.ru/film/#{id}/"
18
+ @url = "https://www.kinopoisk.ru/film/#{id}/"
19
19
  @title = title
20
20
  end
21
21
 
@@ -12,7 +12,7 @@ module Kinopoisk
12
12
  #
13
13
  def initialize(id, name=nil)
14
14
  @id = id
15
- @url = "http://www.kinopoisk.ru/name/#{id}/"
15
+ @url = "https://www.kinopoisk.ru/name/#{id}/"
16
16
  @name = name
17
17
  end
18
18
 
@@ -5,14 +5,14 @@ require 'kinopoisk/search'
5
5
  require 'kinopoisk/person'
6
6
 
7
7
  module Kinopoisk
8
- SEARCH_URL = 'http://www.kinopoisk.ru/index.php?kp_query='
8
+ SEARCH_URL = 'https://www.kinopoisk.ru/index.php?kp_query='
9
9
 
10
10
  NotFound = Class.new StandardError
11
11
  Denied = Class.new StandardError
12
12
 
13
13
  # Headers are needed to mimic proper request so kinopoisk won't block it
14
14
  def self.fetch(url)
15
- HTTPClient.new.get url, nil, { 'User-Agent'=>'a', 'Accept-Encoding'=>'a' }
15
+ HTTPClient.new.get url, nil, { follow_redirect: true, 'User-Agent'=>'a', 'Accept-Encoding'=>'a' }
16
16
  end
17
17
 
18
18
  # Returns a nokogiri document or an error if fetch response status is not 200
@@ -5,12 +5,12 @@ describe Kinopoisk::Movie, vcr: { cassette_name: 'movies' } do
5
5
  let(:dexter) { Kinopoisk::Movie.new 277537 }
6
6
  let(:avatar) { Kinopoisk::Movie.new 251733 }
7
7
 
8
- it { dexter.url.should eq('http://www.kinopoisk.ru/film/277537/') }
8
+ it { dexter.url.should eq('https://www.kinopoisk.ru/film/277537/') }
9
9
  it { dexter.title.should eq('Декстер') }
10
10
  it { dexter.title_en.should eq('Dexter') }
11
11
 
12
- it { dexter.poster.should eq('http://st.kp.yandex.net/images/film_iphone/iphone360_277537.jpg') }
13
- it { dexter.poster_big.should eq('http://st.kp.yandex.net/images/film_big/277537.jpg') }
12
+ it { dexter.poster.should eq('https://st.kp.yandex.net/images/film_iphone/iphone360_277537.jpg') }
13
+ it { dexter.poster_big.should eq('https://st.kp.yandex.net/images/film_big/277537.jpg') }
14
14
 
15
15
  it { dexter.year.should eq(2006) }
16
16
  it { dexter.countries.should eq(['США']) }
@@ -47,7 +47,7 @@ describe Kinopoisk::Movie, vcr: { cassette_name: 'movies' } do
47
47
  end
48
48
 
49
49
  it 'should raise error if nothing found' do
50
- expect { Kinopoisk::Movie.new(111111111).title }.to raise_error
50
+ expect { Kinopoisk::Movie.new(111111111).title }.to raise_error Kinopoisk::NotFound
51
51
  end
52
52
 
53
53
  context 'by title' do
@@ -5,11 +5,11 @@ describe Kinopoisk::Person, vcr: { cassette_name: 'people' } do
5
5
  let(:person) { Kinopoisk::Person.new 13180 }
6
6
 
7
7
  it 'should return right url' do
8
- person.url.should eq('http://www.kinopoisk.ru/name/13180/')
8
+ person.url.should eq('https://www.kinopoisk.ru/name/13180/')
9
9
  end
10
10
 
11
11
  it { person.best_movies.should include('Карты, деньги, два ствола', 'Братья по оружию') }
12
- it { person.poster.should eq('http://st.kp.yandex.net/images/actor_iphone/iphone360_13180.jpg') }
12
+ it { person.poster.should eq('https://st.kp.yandex.net/images/actor_iphone/iphone360_13180.jpg') }
13
13
  it { person.career.should eq(['Актер', 'Режиссер', 'Сценарист', 'Продюсер']) }
14
14
  it { person.genres.should eq(['драма', 'комедия', 'криминал']) }
15
15
  it { person.partner.should eq('Далия Ибельхауптайте') }
data/spec/spec_helper.rb CHANGED
@@ -8,3 +8,9 @@ VCR.configure do |c|
8
8
  c.cassette_library_dir = 'spec/fixtures'
9
9
  c.default_cassette_options = { record: :new_episodes }
10
10
  end
11
+
12
+ RSpec.configure do |config|
13
+ config.expect_with :rspec do |c|
14
+ c.syntax = [:should, :expect]
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinopoisk_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RavWar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.5
140
+ rubygems_version: 2.6.4
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Easily search and access information on kinopoisk.ru
@@ -146,4 +146,3 @@ test_files:
146
146
  - spec/kinopoisk/person_spec.rb
147
147
  - spec/kinopoisk/search_spec.rb
148
148
  - spec/spec_helper.rb
149
- has_rdoc: