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

Reorganize file seed data #686

Merged
merged 3 commits into from
Feb 7, 2017
Merged

Reorganize file seed data #686

merged 3 commits into from
Feb 7, 2017

Conversation

tf
Copy link
Member

@tf tf commented Dec 16, 2016

  • Include file model type names in common seed
  • Include file url templates in common seed
  • Generate seed data for files

@tf tf added this to the v0.12 milestone Dec 16, 2016
@@ -37,4 +41,5 @@ def json_response(options = {})

RSpec.configure do |config|
config.include(JsonResponseHelper, :type => :controller)
config.include(JsonResponseHelper, :type => :helper)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.

[
{attribute: 'thumbnail_image_id', file_collection: 'image_files'},
{attribute: 'video_id', file_collection: 'video_files'}
]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent the right bracket the same as the start of the line where the left bracket is.

it 'includes thumbnail candidates of page types registered for entry' do
thumbnail_candidates =
[
{attribute: 'thumbnail_image_id', file_collection: 'image_files'},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 2 spaces for indentation in an array, relative to the start of the line where the left square bracket is.

:'4k' => url_template(:mp4_4k),

:'hls-playlist' => url_template(:hls_playlist),
:'dash-playlist' => url_template(:dash_playlist),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.

},
{
path: video_file.mp4_4k.url(host: :hls_origin, default_protocol: 'http'),
bandwidth: 32000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate every 3 digits in the integer portion of a number with underscores(_).

}
end

def mp4_low_definition
{
label: 'low',
format: 'mp4',
prepare_for_segmenting: ['hls', 'dash'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use %w or %W for an array of words.

}
end

def mp4_medium_definition
{
label: 'medium',
format: 'mp4',
prepare_for_segmenting: ['hls', 'dash'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use %w or %W for an array of words.

@@ -100,59 +72,198 @@ def mp4_fullhd_definition
def mp4_high_definition
{
label: 'high',
format: 'mp4',
prepare_for_segmenting: ['hls', 'dash'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use %w or %W for an array of words.

@tf tf changed the title Reorganize file seed data [WIP] Reorganize file seed data Dec 16, 2016
tf and others added 3 commits February 7, 2017 18:23
Can be used to map file type collection names to model type names in
client side code.
Let file types provide a hash of file url template strings. Url
templates are created lazily to allow using an actual example record
in the construction of the url without triggering eager loading of the
model during initialization.
Add a common json partial that is used by both the `FilesHelper`,
which renders seed data for the editor, and the `EntryJsonSeedHelper`,
which renders seed data for published entries.

Let file types specify a custom partial that is included in these
representations.

Add id, parent file and basename to file seed data.
@tf tf changed the title [WIP] Reorganize file seed data Reorganize file seed data Feb 7, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.138% when pulling 53705e9 on tf:file-seeds into 88997ef on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.138% when pulling 53705e9 on tf:file-seeds into 88997ef on codevise:master.

@tf tf merged commit ce06bc9 into codevise:master Feb 7, 2017
@tf tf deleted the file-seeds branch February 7, 2017 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants