lib/frameit/editor.rb in frameit-0.1.0 vs lib/frameit/editor.rb in frameit-0.1.1

- old
+ new

@@ -18,11 +18,11 @@ end def run(path, color = Color::BLACK) @color = color - Dir["#{path}/**/*.png"].each do |screenshot| + Dir.glob("#{path}/**/*.{png,PNG}").each do |screenshot| next if screenshot.include?"_framed.png" begin template_path = get_template(screenshot) if template_path template = MiniMagick::Image.open(template_path) @@ -36,12 +36,12 @@ result = template.composite(image) do |c| c.compose "Over" c.geometry offset_information[:offset] end - output_path = screenshot.gsub('.png', '_framed.png') + output_path = screenshot.gsub('.png', '_framed.png').gsub('.PNG', '_framed.png') result.write output_path - Helper.log.info "Successfully framed screenshots at path '#{output_path}'".green + Helper.log.info "Successfully framed screenshot at path '#{output_path}'".green end rescue Exception => ex Helper.log.error ex end end \ No newline at end of file