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

Picture set refactoring #16

Merged
merged 7 commits into from Jul 2, 2018
Merged

Picture set refactoring #16

merged 7 commits into from Jul 2, 2018

Conversation

digitaltom
Copy link
Owner

No description provided.

@coveralls
Copy link

coveralls commented Jul 2, 2018

Coverage Status

Coverage decreased (-33.9%) to 62.5% when pulling 1c9bcce on picture_set_refactoring into 67a416d on master.

class << self

def all
dirs = Dir.glob(File.join(PICTURE_PATH, "*/*#{ANIMATION_SUFFIX}")).map do |animation|
File.basename(File.dirname(animation))
end
dirs.sort.reverse.map { |dir| new(dir) }
Rails.logger.warn "No picture sets found at: #{PICTURE_PATH}" if dirs.empty?
dirs.sort.reverse.map { |dir| PictureSet.new(date: dir) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

new should be enough then you also don't have the dependency to the class name.


# Create collage of all images
def combine_images(overwrite: false)
if File.exist?(File.join(dir, combined)) && !overwrite
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can also introduce a flag for create_combine_images which we can set in the options. Then we don't need to comment it on the raspberry ...

Copy link
Owner Author

Choose a reason for hiding this comment

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

-> #19

end

def destroy
Syscall.execute("rm -r #{date}", dir: PICTURE_PATH)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

should move all file operations to FileUtils, will do.

@digitaltom digitaltom merged commit 798fa89 into master Jul 2, 2018
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