Skip to content

Instantly share code, notes, and snippets.

@firedev
Created January 15, 2016 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firedev/6376d6d79dfd1fbec807 to your computer and use it in GitHub Desktop.
Save firedev/6376d6d79dfd1fbec807 to your computer and use it in GitHub Desktop.
require 'ostruct'
css = File.read('apps/src/stylesheets/sagamore/_buttons.scss').split("\n")
find_images = -> line { line[/"(.+)"/]; $1 }
check_for_file = -> name { OpenStruct.new(name: name, exists: File.exists?("apps/src/images/icons/#{name}.png")) }
format_filenames = -> file_exists { OpenStruct.new(name: (file_exists.name + '.png' + ' ' * 20)[0, 20], exists: file_exists.exists) }
print_results = -> file_exists { puts "#{file_exists.name}\t #{file_exists.exists ? '✅' :'⛔'}" }
css.map(& find_images).compact.map(& check_for_file).map(& format_filenames).map(& print_results)
@klepov
Copy link

klepov commented Jul 8, 2016

Краусавчег, гитхаб нинужон

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment