module Utils

Public Class Methods

increment_filename(path) click to toggle source
# File lib/fccc/utils.rb, line 68
def self.increment_filename(path)
  _, filename, count, extension = *path.match(/(\A.*?)(?:_#(\d+))?(\.[^.]*)?\Z/)
  count = (count || '0').to_i + 1
  return "#{filename}_##{count}#{extension}"
end
load_credentials(path) click to toggle source
# File lib/fccc/utils.rb, line 74
def self.load_credentials(path)
  credentials = YAML.load_file(path)
  FlickRaw.api_key = credentials["api_key"]
  FlickRaw.shared_secret = credentials["shared_secret"]
end