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

Adds functionality for user customized messages #4

Merged
merged 3 commits into from
Jun 22, 2019

Conversation

katelovescode
Copy link
Owner

This solves #1

@katelovescode katelovescode merged commit 390df92 into develop Jun 22, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/user_customized_messages branch June 22, 2019 03:31

def custom_aphorisms
custom_path = File.join(Dir.home, '.aphorism')
custom_files = Dir.children(custom_path)

Choose a reason for hiding this comment

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

If this directory doesn't exist, it will throw a Errno::ENOENT...

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed in #8

custom_path = File.join(Dir.home, '.aphorism')
custom_files = Dir.children(custom_path)
custom_aphorisms = []
custom_files.each { |file| custom_aphorisms += IO.read(File.join(custom_path, file)).split("\n%\n") }

Choose a reason for hiding this comment

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

Probably not critical, but this will pick up more than just *.txt files...

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed in #8

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

2 participants