Refactor theme handling so that it is unified via a helper method

This commit is contained in:
Ufuk Kayserilioglu
2015-03-16 21:43:31 +02:00
parent 2d62bd0147
commit 1ff838b5fe
4 changed files with 20 additions and 12 deletions
+1 -4
View File
@@ -20,10 +20,7 @@ class Screenshot
end
def initialize(theme)
@theme = OpenStruct.new(theme.merge(
slug: theme[:name].parameterize.underscore,
digest: Digest::MD5.new.hexdigest(theme[:colors])
))
@theme = theme
end
def generate_theme_image
+3 -2
View File
@@ -7,10 +7,11 @@ class ScreenshotGenerator < ::Middleman::Extension
super
app.before_build do |builder|
Screenshot.prepare
data = YAML.load_file('data/themes.yml')
data.each do |theme|
themes.each do |theme|
Screenshot.new(theme).generate_theme_image
end
puts "Hello World"
# builder.run './my_deploy_script.sh'
end