Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder audits #22

Merged
merged 3 commits into from
Jun 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ For more information about changelogs, check
[Keep a Changelog](http://keepachangelog.com) and
[Vandamme](http://tech-angels.github.io/vandamme).


## 0.5.4 - 2017-06-20

* [ENHANCEMENT] Change order of audits.

## 0.5.3 - 2017-06-19

* [FEATURE] Add `VideoAudit::InvideoProgramming` to count videos with a branding annotation.
Expand Down
4 changes: 2 additions & 2 deletions lib/yt/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def run
[
Yt::VideoAudit::InfoCard.new(videos: @videos),
Yt::VideoAudit::BrandAnchoring.new(videos: @videos, brand: @brand),
Yt::VideoAudit::SubscribeAnnotation.new(videos: @videos),
Yt::VideoAudit::YoutubeAssociation.new(videos: @videos),
Yt::VideoAudit::EndCard.new(videos: @videos),
Yt::PlaylistAudit::Description.new(playlists: @playlists),
Yt::VideoAudit::EndScreen.new(videos: @videos),
Yt::VideoAudit::TagsLength.new(videos: @videos),
Expand All @@ -39,6 +37,8 @@ def run
Yt::VideoAudit::PlaylistEndScreen.new(videos: @videos),
Yt::VideoAudit::WebsiteEndScreen.new(videos: @videos),
Yt::VideoAudit::InvideoProgramming.new(videos: @videos),
Yt::VideoAudit::EndCard.new(videos: @videos),
Yt::VideoAudit::SubscribeAnnotation.new(videos: @videos),
]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/yt/audit/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Yt
class Audit
VERSION = '0.5.3'
VERSION = '0.5.4'
end
end
2 changes: 1 addition & 1 deletion lib/yt/playlist_audit/description.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def title
end

def description
'The number of playlists with description'
'The number of playlists with a description'
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/yt/video_audit/invideo_programming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

module Yt
module VideoAudit
# Count how many subject videos have a branding.
# Count how many subject videos have a branding annotation.
class InvideoProgramming < Base
def title
'In-Video Programming'
end

def description
'The number of videos with an in-video programming'
'The number of videos with in-video programming'
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/yt/video_audit/youtube_association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def title
end

def description
'The number of videos with description has a link to its own channel'
'The number of videos where the description has a link to its own channel'
end

private
Expand Down
86 changes: 43 additions & 43 deletions test/yt/audit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,59 @@ def test_channel_audit
assert_equal 3, result[1].valid_count
assert_equal 7, result[1].total_count

assert_equal 'Subscribe Annotations', result[2].title
assert_equal "The number of videos with a link to subscribe in its annotations", result[2].description
assert_equal 3, result[2].valid_count
assert_equal 'YouTube Association', result[2].title
assert_equal "The number of videos where the description has a link to its own channel", result[2].description
assert_equal 2, result[2].valid_count
assert_equal 7, result[2].total_count

assert_equal 'YouTube Association', result[3].title
assert_equal "The number of videos with description has a link to its own channel", result[3].description
assert_equal 2, result[3].valid_count
assert_equal 7, result[3].total_count
assert_equal 'Playlist Description', result[3].title
assert_equal "The number of playlists with a description", result[3].description
assert_equal 1, result[3].valid_count
assert_equal 4, result[3].total_count

assert_equal 'Possible End Card Annotations', result[4].title
assert_equal "The number of videos with a link annotation longer than 5 seconds, not an info card, at the end of its duration", result[4].description
assert_equal 3, result[4].valid_count
assert_equal 'End Screens', result[4].title
assert_equal "The number of videos with at least one end screen element", result[4].description
assert_equal 2, result[4].valid_count
assert_equal 7, result[4].total_count

assert_equal 'Playlist Description', result[5].title
assert_equal "The number of playlists with description", result[5].description
assert_equal 'Length of Tags', result[5].title
assert_equal "The number of videos that use at least 80\% of the available tags length limit", result[5].description
assert_equal 1, result[5].valid_count
assert_equal 4, result[5].total_count

assert_equal 'Length of Tags', result[7].title
assert_equal "The number of videos that use at least 80\% of the available tags length limit", result[7].description
assert_equal 1, result[7].valid_count
assert_equal 7, result[7].total_count
assert_equal 7, result[5].total_count

assert_equal 'End Screens', result[6].title
assert_equal "The number of videos with at least one end screen element", result[6].description
assert_equal 2, result[6].valid_count
assert_equal 'Subscribe End Screens', result[6].title
assert_equal "The number of videos with any link to subscribe in its end screens", result[6].description
assert_equal 1, result[6].valid_count
assert_equal 7, result[6].total_count

assert_equal 'Subscribe End Screens', result[8].title
assert_equal "The number of videos with any link to subscribe in its end screens", result[8].description
assert_equal 'Video End Screens', result[7].title
assert_equal "The number of videos with any link to a video in its end screens", result[7].description
assert_equal 2, result[7].valid_count
assert_equal 7, result[7].total_count

assert_equal 'Playlist End Screens', result[8].title
assert_equal "The number of videos with any link to a playlist in its end screens", result[8].description
assert_equal 1, result[8].valid_count
assert_equal 7, result[8].total_count

assert_equal 'Video End Screens', result[9].title
assert_equal "The number of videos with any link to a video in its end screens", result[9].description
assert_equal 2, result[9].valid_count
assert_equal 'Website End Screens', result[9].title
assert_equal "The number of videos with any external link in its end screens", result[9].description
assert_equal 1, result[9].valid_count
assert_equal 7, result[9].total_count

assert_equal 'Playlist End Screens', result[10].title
assert_equal "The number of videos with any link to a playlist in its end screens", result[10].description
assert_equal 1, result[10].valid_count
assert_equal 'In-Video Programming', result[10].title
assert_equal "The number of videos with in-video programming", result[10].description
assert_equal 6, result[10].valid_count
assert_equal 7, result[10].total_count

assert_equal 'Website End Screens', result[11].title
assert_equal "The number of videos with any external link in its end screens", result[11].description
assert_equal 1, result[11].valid_count
assert_equal 'Possible End Card Annotations', result[11].title
assert_equal "The number of videos with a link annotation longer than 5 seconds, not an info card, at the end of its duration", result[11].description
assert_equal 3, result[11].valid_count
assert_equal 7, result[11].total_count

assert_equal 'In-Video Programming', result[12].title
assert_equal "The number of videos with an in-video programming", result[12].description
assert_equal 6, result[12].valid_count
assert_equal 'Subscribe Annotations', result[12].title
assert_equal "The number of videos with a link to subscribe in its annotations", result[12].description
assert_equal 3, result[12].valid_count
assert_equal 7, result[12].total_count
end

Expand All @@ -88,23 +88,23 @@ def test_channel_audit_with_videos_argument
assert_equal 'Brand Anchoring', result[1].title
assert_equal 4, result[1].total_count

assert_equal 'Subscribe Annotations', result[2].title
assert_equal 4, result[2].total_count
assert_equal 'Subscribe Annotations', result[12].title
assert_equal 4, result[12].total_count

assert_equal 'YouTube Association', result[3].title
assert_equal 4, result[3].total_count
assert_equal 'YouTube Association', result[2].title
assert_equal 4, result[2].total_count

assert_equal 'Possible End Card Annotations', result[4].title
assert_equal 4, result[4].total_count
assert_equal 'Possible End Card Annotations', result[11].title
assert_equal 4, result[11].total_count
end

def test_channel_audit_with_playlists_argument
playlists = @channel.playlists.first(2)
audit = Yt::Audit.new(channel: @channel, playlists: playlists)
result = audit.run

assert_equal 'Playlist Description', result[5].title
assert_equal 2, result[5].total_count
assert_equal 'Playlist Description', result[3].title
assert_equal 2, result[3].total_count
end

def test_channel_audit_with_brand_argument
Expand Down