Sha256: e229e000c14020bb4d1dde0164e19567974c2e8c90a389a2d19a9bdb03f951ef

Contents?: true

Size: 794 Bytes

Versions: 4

Compression:

Stored size: 794 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/glimmer/css/css_to_glimmer_converter'

usage = "***Glimmer DSL for CSS - CSS to Glimmer Converter***\nUsage: css_to_glimmer path_to_css_file"

if ARGV.empty?
  puts usage
else
  css_file_path = ARGV.last
  puts "Converting from CSS syntax to Glimmer DSL Ruby syntax for input file: #{css_file_path}"
  css = File.read(css_file_path)
  rule_keyword = ARGV.find { |arg| arg.start_with?("-r=") }.to_s.split('=')[1].to_s
  converter = rule_keyword.empty? ? Glimmer::CSS::CSSToGlimmerConverter.new : Glimmer::CSS::CSSToGlimmerConverter.new(rule_keyword: rule_keyword)
  glimmer = converter.convert(css)
  glimmer_file_path = "#{css_file_path}.glimmer.rb"
  File.write(glimmer_file_path, glimmer)
  puts "Converted output file: #{glimmer_file_path}"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
glimmer-dsl-css-1.5.2 bin/css_to_glimmer
glimmer-dsl-css-1.5.1 bin/css_to_glimmer
glimmer-dsl-css-1.5.0 bin/css_to_glimmer
glimmer-dsl-css-1.4.1 bin/css_to_glimmer