dmm-crawler 0.4.4 → 0.4.5

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
  SHA256:
3
- metadata.gz: ec2e4b341260b38115388c293b57d98ddccf2ea05d5eedeabcbf84b79821a0c0
4
- data.tar.gz: 6a926c8de5ca4d482812b769a2da0f9dde753b6f02e9819e2061f0fb991916f5
3
+ metadata.gz: 50faa1adcf0cbb6d6f43454ec733e1560280aed46821059eb32ecb0cffeb0d1a
4
+ data.tar.gz: 51cf3b9d4f13f54c4c3f3463382bf2bb7fcec6e203d350584ee4ae6cb3f41e39
5
5
  SHA512:
6
- metadata.gz: 05c7d60a958b025c8d3acdc5838b3e9197a341009a9a5624f0dc4260597c193fa2fcd824612c3f5ac9b939b9dd4d5d4e1e6fe9a98c44efe74f537f4ad2aaa6c0
7
- data.tar.gz: 92d4c449500364fce30d549eeac5d800d1b0e6566ec7ae369325ab73db7c22edaac238495f6f955526b6f264b33d6a739d20513d1d6933965aa17d1d60ba5229
6
+ metadata.gz: c585ff843bda9433748571e846f026d1e2bf4bb7fe827450002ef6aa8423ff756285d09cf1940fca00a9932a688ca99aa08662145ed1789bd0bd0cd6d9c4a64b
7
+ data.tar.gz: '019f0f9332fa6e6842d4e33e4e77f69810809fcd2c5e92554c56dfa04536a85d0fe08639b0327cbdacc27b38b0af0548fe256f545c2bb7662db4825e85064c97'
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.4
2
3
  DisplayCopNames: true
3
4
 
4
5
  LineLength:
@@ -7,7 +7,9 @@ rvm:
7
7
  before_install:
8
8
  - gem install bundler
9
9
 
10
- script: 'bundle exec rake spec'
10
+ script:
11
+ - bundle exec rubocop -c .rubocop.yml
12
+ - bundle exec rake spec
11
13
 
12
14
  notifications:
13
15
  email: false
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,4 +1,6 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'dmm-crawler/version'
4
6
 
@@ -19,12 +21,12 @@ Gem::Specification.new do |spec|
19
21
 
20
22
  spec.require_paths = ['lib']
21
23
 
22
- spec.add_runtime_dependency 'rdmm'
23
24
  spec.add_runtime_dependency 'mechanize'
25
+ spec.add_runtime_dependency 'rdmm'
24
26
 
25
27
  spec.add_development_dependency 'bundler'
26
- spec.add_development_dependency 'rake'
27
- spec.add_development_dependency 'rubocop', '< 0.49.0'
28
28
  spec.add_development_dependency 'pry'
29
+ spec.add_development_dependency 'rake'
29
30
  spec.add_development_dependency 'rspec'
31
+ spec.add_development_dependency 'rubocop', '~> 0.69.0'
30
32
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rdmm'
2
4
  require 'mechanize'
3
5
 
4
6
  module DMMCrawler
5
- BASE_URL = 'http://www.dmm.co.jp'.freeze
7
+ BASE_URL = 'http://www.dmm.co.jp'
6
8
  end
7
9
 
8
10
  require 'dmm-crawler/agent'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'singleton'
2
4
 
3
5
  module DMMCrawler
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Attributes
3
5
  class AdultGameAttributes < BaseAttributes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Attributes
3
5
  class BaseAttributes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Attributes
3
5
  class DojinAttributes < BaseAttributes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  class Client
3
5
  attr_accessor :agent
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Ranking
3
5
  class AdultGameRanking < BaseRanking
4
6
  include Attributes
5
7
 
6
8
  FETCHING_LIMITATION = 20
7
- DLSOFT_URL = "https://dlsoft.dmm.co.jp/"
9
+ DLSOFT_URL = 'https://dlsoft.dmm.co.jp/'
8
10
 
9
11
  def initialize(agent: Agent.instance.agent, term: nil)
10
12
  @agent = discriminate_agent(agent)
@@ -45,7 +47,7 @@ module DMMCrawler
45
47
  when 'monthly'
46
48
  ''
47
49
  when 'yearly'
48
- "term=all/year=2018"
50
+ 'term=all/year=2018'
49
51
  end
50
52
  end
51
53
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Ranking
3
5
  class BaseRanking
@@ -18,6 +20,7 @@ module DMMCrawler
18
20
 
19
21
  def discriminate_agent(agent)
20
22
  return agent if agent.is_a?(Mechanize)
23
+
21
24
  raise TypeError
22
25
  end
23
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
4
  module Ranking
3
5
  class DojinRanking < BaseRanking
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DMMCrawler
2
- VERSION = '0.4.4'.freeze
4
+ VERSION = '0.4.5'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  describe DMMCrawler::Ranking::AdultGameRanking do
2
4
  let(:agent) { DMMCrawler::Agent.instance.agent }
3
5
  let(:arguments) { { agent: agent, term: term } }
@@ -19,7 +21,7 @@ describe DMMCrawler::Ranking::AdultGameRanking do
19
21
  let(:attachments) { described_class.new(arguments).arts }
20
22
 
21
23
  it { is_expected.to all(include(:title, :title_link, :main_image_url, :sample_image_urls, :submedia, :author, :rank, :affiliateable, :tags)) }
22
- it { is_expected.to all(satisfy { |art| art.all? { |_k, v| v != '' && v != nil} }) }
24
+ it { is_expected.to all(satisfy { |art| art.all? { |_k, v| v != '' && !v.nil? } }) }
23
25
  end
24
26
 
25
27
  context 'with not registered argument' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  describe DMMCrawler::Ranking::DojinRanking do
2
4
  let(:agent) { DMMCrawler::Agent.instance.agent }
3
5
  let(:submedia) { 'cg' }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dmm-crawler'
2
4
  require 'pry'
3
5
 
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmm-crawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Ohmori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-02 00:00:00.000000000 Z
11
+ date: 2019-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rdmm
14
+ name: mechanize
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: mechanize
28
+ name: rdmm
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,21 +67,21 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rubocop
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "<"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.49.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "<"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.49.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: pry
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rspec
98
+ name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 0.69.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 0.69.0
111
111
  description: Show DMM and DMM.R18's crawled data. e.g. ranking
112
112
  email:
113
113
  - sachin21dev@gmail.com
@@ -158,7 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.0.3
161
+ rubyforge_project:
162
+ rubygems_version: 2.7.6
162
163
  signing_key:
163
164
  specification_version: 4
164
165
  summary: Show DMM and DMM.R18's crawled data