Skip to content

Instantly share code, notes, and snippets.

@staycreativedesign
Created August 29, 2018 02:23
Show Gist options
  • Save staycreativedesign/7b9262f7d575211ef87f7a7aef53aaeb to your computer and use it in GitHub Desktop.
Save staycreativedesign/7b9262f7d575211ef87f7a7aef53aaeb to your computer and use it in GitHub Desktop.
def generate_location(io, context = {})
name = super # the default unique identifier
@new_location = ""
if io.is_a?(File)
ioo = io.to_path
initial_location = io.to_path
@new_location = ioo.match(/(.*\/).*/)[1]
else
binding.pry
@new_location = ioo.match(/(.*\/).*/)[1]
end
final_location = [@new_location + name].compact.join # returns original path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment