csscss 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0813cfe3a3c5ea373702b3e9a666ab1f7c89a99d
4
- data.tar.gz: e0c6d6a8927eaf0486c3345cea4829fb0845d85f
3
+ metadata.gz: 29fe6b307cec72a8caa09c390e53c62bbc14e711
4
+ data.tar.gz: ea292f00371ff139241d08731f4e34c341bd7316
5
5
  SHA512:
6
- metadata.gz: 232d3550de49a5f655cab3f68981f3d8b58bfd4c7465a8aee565d0f3e27b7a282c611a5434ce4283d6daa34c1f4e5ef62c143e676a2b2f041b0bed2da3cce8fa
7
- data.tar.gz: 8e1ea90d3ef93a39dc721ac4e19463dc9fd248f4dc888602a05f4a370a5d4da1ac742e33031d08c32fdf3d532f53d6fe7443493cb7ec7f90d1cfbe784797402b
6
+ metadata.gz: 0a0f4b998370a3fe7f43b01c80ed8dd2b7e0cbcdfa614163545b5e1b6ae1ce165116eaed1d770819d4665c27c453ae63220e17f708dbdc50a158c47420d1bbce
7
+ data.tar.gz: af2c34e8c0d78c3a4a2e5cc8cb675c016532c472656f6e7fda95e91eef840e9aa06c9b62b14bb2edd06af1c1fddca86ae32773a34f68c3f49bf2f8e914bc4ae2
@@ -1 +1 @@
1
- ruby-2.0.0-p195
1
+ ruby-2.1.2
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
4
+ - 2.1.2
@@ -1,3 +1,8 @@
1
+ ## 1.3.3 - 5/30/2014 ##
2
+
3
+ * Upgrades parslet dependency to v1.6.1 and drops optimization monkeypatch
4
+ * Use correct terminology "declartions" instead of "rules" in the output
5
+
1
6
  ## 1.3.2 - 6/22/2013 ##
2
7
 
3
8
  * Fixes attribute parsing bug that includes comments with braces
data/Gemfile CHANGED
@@ -4,16 +4,16 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # optional runtime dependencies
7
- gem "sass"
8
- gem "compass"
9
- gem "less"
10
- gem "therubyracer", :platform => :mri
7
+ gem 'sass'
8
+ gem 'compass'
9
+ gem 'less'
10
+ gem 'therubyracer', :platform => :mri
11
11
 
12
- gem "rake", :require => false
13
- gem "debugger"
12
+ gem 'rake', :require => false
13
+ gem 'byebug'
14
14
 
15
- gem "minitest"
16
- gem "m"
17
- gem "minitest-rg"
15
+ gem 'minitest'
16
+ gem 'm'
17
+ gem 'minitest-rg'
18
18
 
19
- gem "ruby-prof"
19
+ gem 'ruby-prof'
@@ -1,28 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csscss (1.3.2)
4
+ csscss (1.3.3)
5
5
  colorize
6
- parslet (~> 1.5)
6
+ parslet (>= 1.6.1, < 2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  blankslate (2.1.2.4)
12
+ byebug (3.1.2)
13
+ columnize (~> 0.8)
14
+ debugger-linecache (~> 1.2)
12
15
  chunky_png (1.2.7)
13
- colorize (0.5.8)
14
- columnize (0.3.6)
16
+ colorize (0.7.3)
17
+ columnize (0.8.9)
15
18
  commonjs (0.2.6)
16
19
  compass (0.12.2)
17
20
  chunky_png (~> 1.2)
18
21
  fssm (>= 0.2.7)
19
22
  sass (~> 3.1)
20
- debugger (1.6.0)
21
- columnize (>= 0.3.1)
22
- debugger-linecache (~> 1.2.0)
23
- debugger-ruby_core_source (~> 1.2.1)
24
23
  debugger-linecache (1.2.0)
25
- debugger-ruby_core_source (1.2.2)
26
24
  fssm (0.2.10)
27
25
  less (2.3.1)
28
26
  commonjs (~> 0.2.6)
@@ -33,7 +31,7 @@ GEM
33
31
  method_source (0.8.1)
34
32
  minitest (2.12.1)
35
33
  minitest-rg (1.1.0)
36
- parslet (1.5.0)
34
+ parslet (1.6.1)
37
35
  blankslate (~> 2.0)
38
36
  rake (10.0.3)
39
37
  ref (1.0.4)
@@ -47,9 +45,9 @@ PLATFORMS
47
45
  ruby
48
46
 
49
47
  DEPENDENCIES
48
+ byebug
50
49
  compass
51
50
  csscss!
52
- debugger
53
51
  less
54
52
  m
55
53
  minitest
data/README.md CHANGED
@@ -63,6 +63,13 @@ LESS requires an additional javascript runtime.
63
63
  rubies, and [therubyrhino](https://rubygems.org/gems/therubyrhino) on
64
64
  jruby.
65
65
 
66
+ ## Are there any community extensions? ##
67
+
68
+ * [compass-csscss](https://github.com/Comcast/compass-csscss) integrates csscss with [compass](http://compass-style.org/) projects.
69
+ * [grunt-csscss](https://github.com/peterkeating/grunt-csscss) a [grunt](http://gruntjs.com/) task to automatically run csscss.
70
+
71
+ _Please submit [an issue](https://github.com/zmoazeni/csscss/issues/new) if you know of any others._
72
+
66
73
  ## Why doesn't csscss automatically remove duplications for me? ##
67
74
 
68
75
  I have been asked this a lot, but csscss is intentionally designed this
@@ -19,6 +19,6 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.required_ruby_version = ">= 1.9"
21
21
 
22
- gem.add_dependency "parslet", "~> 1.5"
22
+ gem.add_dependency "parslet", ">= 1.6.1", "< 2.0"
23
23
  gem.add_dependency "colorize"
24
24
  end
@@ -5,7 +5,6 @@ require "open-uri"
5
5
 
6
6
  require "colorize"
7
7
  require "parslet"
8
- require "csscss/parslet_optimizations"
9
8
 
10
9
  require "csscss/version"
11
10
  require "csscss/cli"
@@ -13,7 +13,7 @@ module Csscss
13
13
  selector_groups = selector_groups.map {|selectors| "{#{maybe_color(selectors, :red, should_color)}}" }
14
14
  last_selector = selector_groups.pop
15
15
  count = declarations.size
16
- io.puts %Q(#{selector_groups.join(", ")} AND #{last_selector} share #{maybe_color(count, :red, should_color)} rule#{"s" if count > 1})
16
+ io.puts %Q(#{selector_groups.join(", ")} AND #{last_selector} share #{maybe_color(count, :red, should_color)} declaration#{"s" if count > 1})
17
17
  if verbose
18
18
  declarations.each {|dec| io.puts(" - #{maybe_color(dec, :yellow, should_color)}") }
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Csscss
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -12,19 +12,19 @@ module Csscss
12
12
  })
13
13
 
14
14
  expected =<<-EXPECTED
15
- {.foo} AND {.bar} share 2 rules
16
- {h1, h2}, {.foo} AND {.baz} share 1 rule
17
- {h1, h2} AND {.bar} share 1 rule
15
+ {.foo} AND {.bar} share 2 declarations
16
+ {h1, h2}, {.foo} AND {.baz} share 1 declaration
17
+ {h1, h2} AND {.bar} share 1 declaration
18
18
  EXPECTED
19
19
  reporter.report(color:false).must_equal expected
20
20
 
21
21
  expected =<<-EXPECTED
22
- {.foo} AND {.bar} share 2 rules
22
+ {.foo} AND {.bar} share 2 declarations
23
23
  - width: 1px
24
24
  - border: black
25
- {h1, h2}, {.foo} AND {.baz} share 1 rule
25
+ {h1, h2}, {.foo} AND {.baz} share 1 declaration
26
26
  - display: none
27
- {h1, h2} AND {.bar} share 1 rule
27
+ {h1, h2} AND {.bar} share 1 declaration
28
28
  - position: relative
29
29
  EXPECTED
30
30
  reporter.report(verbose:true, color:false).must_equal expected
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require "debugger"
3
+ require "byebug"
4
4
  require "csscss"
5
5
 
6
6
  raise "need a file name" unless ARGV[0]
@@ -1,11 +1,11 @@
1
- require "rubygems"
2
- require "bundler/setup"
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
3
 
4
- require "minitest/autorun"
5
- require "minitest/rg"
6
- require "debugger"
4
+ require 'minitest/autorun'
5
+ require 'minitest/rg'
6
+ require 'byebug'
7
7
 
8
- require "csscss"
8
+ require 'csscss'
9
9
 
10
10
  module TypeHelpers
11
11
  def sel(s)
metadata CHANGED
@@ -1,41 +1,47 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csscss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Moazeni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-22 00:00:00.000000000 Z
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: 1.6.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.6.1
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '1.5'
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: colorize
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - '>='
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: '0'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - '>='
44
+ - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: '0'
41
47
  description: csscss will parse any CSS files you give it and let you know which rulesets
@@ -47,9 +53,9 @@ executables:
47
53
  extensions: []
48
54
  extra_rdoc_files: []
49
55
  files:
50
- - .gitignore
51
- - .ruby-version
52
- - .travis.yml
56
+ - ".gitignore"
57
+ - ".ruby-version"
58
+ - ".travis.yml"
53
59
  - CHANGELOG.md
54
60
  - CONTRIBUTING.md
55
61
  - CONTRIBUTORS.md
@@ -79,7 +85,6 @@ files:
79
85
  - lib/csscss/parser/multi_side_transformer.rb
80
86
  - lib/csscss/parser/outline.rb
81
87
  - lib/csscss/parser/padding.rb
82
- - lib/csscss/parslet_optimizations.rb
83
88
  - lib/csscss/redundancy_analyzer.rb
84
89
  - lib/csscss/reporter.rb
85
90
  - lib/csscss/sass_include_extensions.rb
@@ -115,17 +120,17 @@ require_paths:
115
120
  - lib
116
121
  required_ruby_version: !ruby/object:Gem::Requirement
117
122
  requirements:
118
- - - '>='
123
+ - - ">="
119
124
  - !ruby/object:Gem::Version
120
125
  version: '1.9'
121
126
  required_rubygems_version: !ruby/object:Gem::Requirement
122
127
  requirements:
123
- - - '>='
128
+ - - ">="
124
129
  - !ruby/object:Gem::Version
125
130
  version: '0'
126
131
  requirements: []
127
132
  rubyforge_project:
128
- rubygems_version: 2.0.3
133
+ rubygems_version: 2.2.2
129
134
  signing_key:
130
135
  specification_version: 4
131
136
  summary: A CSS redundancy analyzer that analyzes redundancy.
@@ -1,77 +0,0 @@
1
- # These are my multibyte optimizations for parslet.
2
- # More information can be found:
3
- # https://github.com/kschiess/parslet/issues/73
4
- # https://github.com/kschiess/parslet/pull/74
5
- # https://github.com/zmoazeni/parslet/tree/optimized-multibyte-parsing
6
-
7
- require 'strscan'
8
- require 'forwardable'
9
-
10
- module Parslet
11
- class Source
12
- extend Forwardable
13
-
14
- def initialize(str)
15
- raise ArgumentError unless str.respond_to?(:to_str)
16
-
17
- @str = StringScanner.new(str)
18
-
19
- @line_cache = LineCache.new
20
- @line_cache.scan_for_line_endings(0, str)
21
- end
22
-
23
- def matches?(pattern)
24
- regexp = pattern.is_a?(String) ? Regexp.new(Regexp.escape(pattern)) : pattern
25
- !@str.match?(regexp).nil?
26
- end
27
- alias match matches?
28
-
29
- def consume(n)
30
- original_pos = @str.pos
31
- slice_str = n.times.map { @str.getch }.join
32
- slice = Parslet::Slice.new(
33
- slice_str,
34
- original_pos,
35
- @line_cache)
36
-
37
- return slice
38
- end
39
-
40
- def chars_left
41
- @str.rest_size
42
- end
43
-
44
- def_delegator :@str, :pos
45
- def pos=(n)
46
- if n > @str.string.bytesize
47
- @str.pos = @str.string.bytesize
48
- else
49
- @str.pos = n
50
- end
51
- end
52
-
53
-
54
- class LineCache
55
- def scan_for_line_endings(start_pos, buf)
56
- return unless buf
57
-
58
- buf = StringScanner.new(buf)
59
- return unless buf.exist?(/\n/)
60
-
61
- ## If we have already read part or all of buf, we already know about
62
- ## line ends in that portion. remove it and correct cur (search index)
63
- if @last_line_end && start_pos < @last_line_end
64
- # Let's not search the range from start_pos to last_line_end again.
65
- buf.pos = @last_line_end - start_pos
66
- end
67
-
68
- ## Scan the string for line endings; store the positions of all endings
69
- ## in @line_ends.
70
- while buf.skip_until(/\n/)
71
- @last_line_end = start_pos + buf.pos
72
- @line_ends << @last_line_end
73
- end
74
- end
75
- end
76
- end
77
- end