Skip to content

Instantly share code, notes, and snippets.

@firedev
Created January 15, 2016 11:38
Show Gist options
  • Select an option

  • Save firedev/6376d6d79dfd1fbec807 to your computer and use it in GitHub Desktop.

Select an option

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

klepov commented Jul 8, 2016

Copy link
Copy Markdown

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

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