Sha256: 16ddd1004bcaf2042cbb0eb86c82baf999ca481e72ab41c5f06905ba59c79ffb

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

$:.unshift File.dirname(__FILE__) + '/../lib/'
require 'ass'
require 'benchmark'

large_ass = <<-ASS
/* Inline comment

// Literal imports
@import 'something.css'

// Constants

:primary_color = #fff
:heading_size = 16px

// Mixins
+large_font
  font-size 16px
  font-weight bold
  
+add_color
  color :primary_color
  
+clearfix
  display block
  content '.'
  height 0
  clear both
  visibility hidden
  +add_color
  +large_font

// Stylesheet

body
  font 12px
  color :primary_color
  
h1, h2, h3
  font-weight bold
  font-size :heading_size
  color #fff
  
a
  color black
 
  :hover
    color blue
  
#primary .content
  margin 15px
  
  #comments
    padding 5px
    font-size 11px
    color gray
  
    .comment
      border white 1px solid
      
      a
        color black !important
        
#footer
  +clearfix  
    
ASS

Benchmark.bm(15) do |x|
  x.report("60 lines") { 
    Ass::Parser.parse(large_ass)
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
visionmedia-ass-0.0.2 examples/benchmarks.rb