Sha256: f51a8a4c9f44b8efd3615971854b90c295afb8d2236290db10189b6605730dba

Contents?: true

Size: 1.27 KB

Versions: 21

Compression:

Stored size: 1.27 KB

Contents

module MagLove
  module Command
    class Copy
      include Commander::Methods
      
      def run

        task :base_images, theme: "!", pattern: "images/**/*.{jpg,png,gif,svg}" do |args, options|
          pattern = options.pattern.gsub(theme_base_path("", options.theme), "")
          theme_base_glob(pattern, options.theme).each do |file|
            asset = base_theme_asset(file, options.theme)
            debug("▸ created #{asset.logical_path}") if asset.write!
          end
        end

        task :images, theme: "!", pattern: "images/**/*.{jpg,png,gif,svg}" do |args, options|
          pattern = options.pattern.gsub(theme_path("", options.theme), "")
          theme_glob(pattern, options.theme).each do |file|
            asset = theme_asset(file, options.theme)
            debug("▸ created #{asset.logical_path}") if asset.write!
          end
        end  
  
        task :thumbs, theme: "!", pattern: "thumbs/**/*.{jpg,png,gif,svg}" do |args, options|
          pattern = options.pattern.gsub(theme_path("", options.theme), "")
          theme_glob(pattern, options.theme).each do |file|
            asset = theme_asset(file, options.theme)
            debug("▸ created #{asset.logical_path}") if asset.write!
          end
        end

      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
maglove-0.8.1 lib/maglove/command/copy.rb
maglove-0.8.0 lib/maglove/command/copy.rb
maglove-0.7.2 lib/maglove/command/copy.rb
maglove-0.7.1 lib/maglove/command/copy.rb
maglove-0.7.0 lib/maglove/command/copy.rb
maglove-0.6.6 lib/maglove/command/copy.rb
maglove-0.6.5 lib/maglove/command/copy.rb
maglove-0.6.4 lib/maglove/command/copy.rb
maglove-0.6.3 lib/maglove/command/copy.rb
maglove-0.6.2 lib/maglove/command/copy.rb
maglove-0.6.1 lib/maglove/command/copy.rb
maglove-0.6.0 lib/maglove/command/copy.rb
maglove-0.5.9 lib/maglove/command/copy.rb
maglove-0.5.8 lib/maglove/command/copy.rb
maglove-0.5.7 lib/maglove/command/copy.rb
maglove-0.5.5 lib/maglove/command/copy.rb
maglove-0.5.4 lib/maglove/command/copy.rb
maglove-0.5.2 lib/maglove/command/copy.rb
maglove-0.5.1 lib/maglove/command/copy.rb
maglove-0.5.0 lib/maglove/command/copy.rb