Sha256: d67fe7ec5fbd9bd2348475d947c549c995a6c8e64e4365fb4bd1d4956d9a2170

Contents?: true

Size: 941 Bytes

Versions: 8

Compression:

Stored size: 941 Bytes

Contents

JQTOUCH_MESSAGE1 = "# Generated by compass-jquery-plugin/gem-tasks/jqtouch.rake\n# Install with: compass install jquery/jqtouch\n\n"
JQTOUCH_MESSAGE2 = "// Generated by compass-jquery-plugin/gem-tasks/jqtouch.rake\n\n"

class JqTouchTheme

  # Initialize with the base theme
  def initialize
    @theme_filename = "theme.css"
  end

  # Create a sass file of variables names and copy the images
  def convert_theme(name, dir, stylesheets)
    theme = File.read(File.join(dir, @theme_filename))

    # Fix stuff
    theme.gsub!(/\;filter:Alpha/, "; filter: Alpha")
    theme.gsub! /url\(img(.+?)\)/, "image_url(\"jquery/touch/#{name}\\1\")"

    # Convert the stylesheet
    open File.join(JQTOUCH_DEST_THEMES, "#{name}.scss"), 'w' do |f|
      sass = JQTOUCH_MESSAGE2
      IO.popen("sass-convert -F css -T scss", 'r+') { |ff| ff.print(theme); ff.close_write; sass += ff.read }
      f.print sass
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
compass-jquery-plugin-0.3.3.1 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.3.0 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.8 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.7 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.7.nil lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.6 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.5 lib/jqtouch_theme.rb
compass-jquery-plugin-0.3.2.4 lib/jqtouch_theme.rb