-
Notifications
You must be signed in to change notification settings - Fork 1
Threads #66
Conversation
app/parsers/test_parser.rb
Outdated
end | ||
|
||
def second | ||
puts __method__ | ||
yield Runner.run(parser: self.class, method: :third, url: nil, data: {}) | ||
yield task(parser: self.class, method: :third, url: 'http://google.com/', data: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [87/80]
app/parsers/test_parser.rb
Outdated
end | ||
|
||
def first | ||
puts __method__ | ||
yield Runner.run(parser: self.class, method: :second, url: nil, data: {}) | ||
yield task(parser: self.class, method: :second, url: 'http://google.com/', data: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [88/80]
app/app.rb
Outdated
@@ -40,6 +41,46 @@ def parse_class(text) | |||
end | |||
end | |||
|
|||
def start | |||
@@runner = Runner.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ClassVars: Replace class var @@runner with a class instance var.
@@ -40,6 +41,46 @@ def parse_class(text) | |||
end | |||
end | |||
|
|||
def start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for start is too high. [22.2/15]
Metrics/MethodLength: Method has too many lines. [27/10]
should be test covered |
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
===========================================
+ Coverage 55.97% 74.46% +18.49%
===========================================
Files 6 4 -2
Lines 159 94 -65
===========================================
- Hits 89 70 -19
+ Misses 70 24 -46
Continue to review full report at Codecov.
|
app/task.rb
Outdated
attr_reader :parser, :method, :url, :data | ||
|
||
def initialize(parser:, method:, url:, data:) | ||
@parser, @method, @url, @data = parser, method, url, data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ParallelAssignment: Do not use parallel assignment.
@@ -0,0 +1,19 @@ | |||
module Parsers | |||
class Task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level class documentation comment.
@@ -0,0 +1,19 @@ | |||
module Parsers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@@runner ||= Runner.new | ||
end | ||
|
||
def start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/MethodLength: Method has too many lines. [12/10]
app/app.rb
Outdated
@@ -40,6 +40,30 @@ def parse_class(text) | |||
end | |||
end | |||
|
|||
def runner | |||
@@runner ||= Runner.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ClassVars: Replace class var @@runner with a class instance var.
@@ -0,0 +1,33 @@ | |||
require 'spec_helper' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
allow(parser).to receive(:test).and_return(something: 'testing') | ||
end | ||
|
||
VCR.use_cassette('source') do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [34/25]
@@ -0,0 +1,68 @@ | |||
require 'spec_helper' | |||
|
|||
describe Parsers::Runner do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [53/25]
@@ -0,0 +1,68 @@ | |||
require 'spec_helper' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@@ -0,0 +1,22 @@ | |||
require 'byebug' | |||
|
|||
class TestParser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level class documentation comment.
@@ -0,0 +1,22 @@ | |||
require 'byebug' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
app/app.rb
Outdated
private | ||
|
||
def runner | ||
@@runner ||= Runner.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ClassVars: Replace class var @@runner with a class instance var.
|
||
array = [] | ||
find_all('.row').each do |row| | ||
array << { "#{row.find('.left').text.to_s}": row.find('.right').text.to_s } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [85/80]
end | ||
end | ||
|
||
describe Parsers do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [43/25]
it 'does something useful' do | ||
VCR.use_cassette('yahoo') do | ||
url = 'http://yahoo.com' | ||
links = JSON.parse(result.list_links_images(url)).map { |link| link['link'] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [85/80]
@@ -0,0 +1,77 @@ | |||
require 'spec_helper' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@@ -1,7 +1,8 @@ | |||
require('spec_helper') | |||
require 'spec_helper' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
No description provided.