csso-rails 0.7.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csso-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,21 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: appraisal
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -74,42 +88,22 @@ executables:
74
88
  extensions: []
75
89
  extra_rdoc_files: []
76
90
  files:
77
- - ".gitignore"
78
- - ".rspec"
79
- - ".travis.yml"
80
- - Appraisals
81
- - Gemfile
82
91
  - README.md
83
- - Rakefile
84
92
  - bin/ruby_csso
85
93
  - csso-rails.gemspec
86
- - gemfiles/rails_4.2.gemfile
87
- - gemfiles/rails_5.0.gemfile
88
- - gemfiles/rails_5.1.gemfile
89
- - gemfiles/sprockets_2.gemfile
90
- - gemfiles/sprockets_3.gemfile
91
- - gemfiles/sprockets_4.gemfile
92
- - gemfiles/therubyracer.gemfile
93
94
  - lib/csso-rails.rb
94
95
  - lib/csso.rb
95
96
  - lib/csso/cli.rb
96
97
  - lib/csso/compressor.rb
97
- - lib/csso/csso.js.erb
98
98
  - lib/csso/js_lib.rb
99
99
  - lib/csso/railtie.rb
100
100
  - lib/csso/version.rb
101
- - spec/csso/csso_spec.rb
102
- - spec/csso/sprockets_integration_spec.rb
103
- - spec/fixtures/test.css
104
- - spec/fixtures/test2.css
105
- - spec/fixtures/test3.scss
106
- - spec/fixtures/test4.scss
107
101
  - vendor/csso/csso.js
108
102
  homepage: https://github.com/Vasfed/csso-rails
109
103
  licenses:
110
104
  - MIT
111
105
  metadata: {}
112
- post_install_message:
106
+ post_install_message:
113
107
  rdoc_options: []
114
108
  require_paths:
115
109
  - lib
@@ -117,22 +111,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
111
  requirements:
118
112
  - - ">="
119
113
  - !ruby/object:Gem::Version
120
- version: '0'
114
+ version: 1.9.2
121
115
  required_rubygems_version: !ruby/object:Gem::Requirement
122
116
  requirements:
123
117
  - - ">="
124
118
  - !ruby/object:Gem::Version
125
119
  version: '0'
126
120
  requirements: []
127
- rubyforge_project: csso-rails
128
- rubygems_version: 2.6.12
129
- signing_key:
121
+ rubygems_version: 3.0.9
122
+ signing_key:
130
123
  specification_version: 4
131
124
  summary: CSS Stylesheet optimizer/compressor for Rails
132
- test_files:
133
- - spec/csso/csso_spec.rb
134
- - spec/csso/sprockets_integration_spec.rb
135
- - spec/fixtures/test.css
136
- - spec/fixtures/test2.css
137
- - spec/fixtures/test3.scss
138
- - spec/fixtures/test4.scss
125
+ test_files: []
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- .DS_Store
2
- *~
3
-
4
- pkg/
5
- .yardoc/
6
-
7
- .rvmrc
8
- .bundle
9
- tmp
10
- /csso/
11
- /log/
12
- /.idea/
13
-
14
- Gemfile.lock
15
- gemfiles/*.lock
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/.travis.yml DELETED
@@ -1,28 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
- - 2.3
5
- - 2.0
6
- gemfile:
7
- - gemfiles/sprockets_2.gemfile
8
- - gemfiles/sprockets_3.gemfile
9
- - gemfiles/sprockets_4.gemfile
10
- - gemfiles/rails_4.2.gemfile
11
- - gemfiles/rails_5.0.gemfile
12
- - gemfiles/rails_5.1.gemfile
13
- - gemfiles/therubyracer.gemfile
14
-
15
- matrix:
16
- exclude:
17
- - rvm: 2.0
18
- gemfile: gemfiles/sprockets_3.gemfile
19
- - rvm: 2.0
20
- gemfile: gemfiles/sprockets_4.gemfile
21
- - rvm: 2.0
22
- gemfile: gemfiles/therubyracer.gemfile
23
- - rvm: 2.0
24
- gemfile: gemfiles/rails_4.2.gemfile
25
- - rvm: 2.0
26
- gemfile: gemfiles/rails_5.0.gemfile
27
- - rvm: 2.0
28
- gemfile: gemfiles/rails_5.1.gemfile
data/Appraisals DELETED
@@ -1,33 +0,0 @@
1
- # to test against all, run: appraisal rake spec
2
-
3
- # sprockets-1 is unsupported
4
-
5
- appraise "sprockets-2" do
6
- gem "sprockets", "~>2.0"
7
- end
8
-
9
- appraise "sprockets-3" do
10
- gem "sprockets", "~>3.0"
11
- end
12
-
13
- appraise "sprockets-4" do
14
- gem "sprockets", "~>4.0.0.beta4"
15
- gem 'sass', '>=3.3'
16
- end
17
-
18
- appraise "rails-4.2" do
19
- gem "rails", '~>4.2.0'
20
- end
21
-
22
- appraise "rails-5.0" do
23
- gem "rails", '~>5.0.0'
24
- end
25
-
26
- appraise "rails-5.1" do
27
- gem "rails", '~>5.1.0'
28
- end
29
-
30
- appraise "therubyracer" do
31
- #TODO: currently rubyracer segfaults on my machine, fix that and start testing
32
- # gem "therubyracer"
33
- end
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,59 +0,0 @@
1
- require 'bundler'
2
- require 'bundler/setup'
3
-
4
- require 'rake/testtask'
5
-
6
- Rake::TestTask.new(:spec) do |t|
7
- t.pattern = 'spec/**/*_spec.rb'
8
- t.libs.push 'spec'
9
- end
10
-
11
- $:.push File.expand_path("../lib", __FILE__)
12
- require 'csso/version'
13
-
14
- Bundler::GemHelper.install_tasks
15
-
16
- task :default => :spec
17
-
18
-
19
- file 'csso' do
20
- puts 'Fetching csso repo...'
21
- `git clone --single-branch --depth 1 --no-hardlinks git://github.com/css/csso`
22
- Dir.chdir('csso'){
23
- puts 'Now making web-version, just in case.'
24
- `npm install && npm run browserify`
25
- }
26
- end
27
-
28
- desc "updates csso repo"
29
- task :update_csso_repo => :csso do
30
- #??
31
- Dir.chdir('csso'){
32
- puts 'Updating csso...'
33
- `git pull --rebase`
34
- `npm install && npm run browserify`
35
- }
36
- end
37
-
38
- directory 'vendor/csso'
39
- lib_template = 'lib/csso/csso.js.erb'
40
- file Csso::CSSO_JS_LIB => [lib_template, 'csso', 'vendor/csso', 'csso/.git/HEAD', 'csso/.git/refs/heads/master'] do
41
- puts "Generating #{Csso::CSSO_JS_LIB}"
42
- `erb #{lib_template} > #{Csso::CSSO_JS_LIB}`
43
- end
44
-
45
- desc "Generate bundled csso from repo"
46
- task :generate_files => [:csso, Csso::CSSO_JS_LIB]
47
-
48
- desc "Clean generated files"
49
- task :rm_generated do
50
- puts "Removing #{Csso::CSSO_JS_LIB}"
51
- `rm #{Csso::CSSO_JS_LIB}`
52
- end
53
-
54
- task :regenerate => [:rm_generated, :generate_files]
55
-
56
- desc "Update CSSO"
57
- task :update_csso => [:rm_generated, :update_csso_repo, :generate_files]
58
-
59
- task :build => :generate_files
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~>4.2.0"
6
-
7
- gemspec :path => "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~>5.0.0"
6
-
7
- gemspec :path => "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~>5.1.0"
6
-
7
- gemspec :path => "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sprockets", "~>2.0"
6
-
7
- gemspec :path => "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sprockets", "~>3.0"
6
-
7
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sprockets", "~>4.0.0.beta4"
6
- gem "sass", ">=3.3"
7
-
8
- gemspec :path => "../"
@@ -1,5 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec :path => "../"
data/lib/csso/csso.js.erb DELETED
@@ -1,41 +0,0 @@
1
- <%
2
- # template for single-file csso lib
3
-
4
- def file(filename)
5
- File.read(filename).strip
6
- end
7
-
8
- def version package
9
- require 'json'
10
- JSON.parse(File.read(package))['version']
11
- end
12
-
13
- %>/*
14
- <%= " THIS FILE IS AUTOGENERATED! DO NOT EDIT!\n See #{__FILE__} instead." %>
15
-
16
- Based on <%= version 'csso/package.json' %> revision <%= file 'csso/.git/refs/heads/master' %>
17
- */
18
-
19
- console = {
20
- log: function(){},
21
- error: function(txt){
22
- throw txt;
23
- }
24
- };
25
-
26
- <%= file 'csso/dist/csso-browser.js' %>
27
-
28
- do_compression = function(css, structural){
29
- return csso.minify(css, {
30
- restructure: structural
31
- }).css;
32
- };
33
-
34
- do_compression_with_map = function(css, filename, structural){
35
- var result = csso.minify(css, {
36
- restructure: structural,
37
- filename: filename,
38
- sourceMap: true
39
- });
40
- return [result.css, result.map.toString()];
41
- };
@@ -1,39 +0,0 @@
1
- #encoding: utf-8
2
-
3
- require 'minitest/autorun'
4
- require 'csso'
5
-
6
- # Encoding.default_external = Encoding::UTF_8
7
-
8
- describe Csso do
9
-
10
- subject { Csso }
11
-
12
- it "dummy test" do
13
- 1.must_equal 1
14
- end
15
-
16
- it "should optimize css" do
17
- subject.optimize("a {\ncolor: white; }").must_equal "a{color:#fff}"
18
- end
19
-
20
- it "should optimize structure" do
21
- subject.optimize("a {\ncolor: white; } a{color: red;}").must_equal "a{color:red}"
22
- end
23
-
24
- it "should optimize structure" do
25
- skip "original csso is a bit broken at the moment"
26
- # FIXME: csso produces "a{color:#fff;color:red}" on this :(
27
- subject.optimize("a {\ncolor: white; } a{color: #ff0000;}").must_equal "a{color:red}"
28
- end
29
-
30
- it "should optimize structure in maniac mode" do
31
- subject.optimize("a {\ncolor: white; } a{color: #ff0000;}", true).must_equal "a{color:red}"
32
- end
33
-
34
- it 'should produce no error on empty input' do
35
- subject.optimize(nil).must_be_nil
36
- subject.optimize("").must_equal ""
37
- end
38
-
39
- end
@@ -1,87 +0,0 @@
1
- #encoding: utf-8
2
-
3
- require 'minitest/autorun'
4
- require 'fileutils'
5
- require 'csso'
6
-
7
- # Encoding.default_external = Encoding::UTF_8
8
-
9
- describe Csso do
10
-
11
- subject { Csso }
12
- let(:sprockets_env_without_csso){
13
- begin
14
- require 'sprockets'
15
- rescue LoadError
16
- skip "Skipping sprockets integration, as there's no sprockets in this env"
17
- end
18
- e = Sprockets::Environment.new(File.expand_path('../', File.dirname(__FILE__)))
19
- e.append_path 'fixtures'
20
- e.config = e.config.merge(gzip_enabled: false).freeze if e.respond_to? :config
21
- # e.logger = Logger.new STDOUT
22
- e
23
- }
24
- let(:result_dir){
25
- d = File.expand_path('../fixtures/res', File.dirname(__FILE__))
26
- FileUtils.mkdir_p(d)
27
- d
28
- }
29
- let(:manifest_file){
30
- File.expand_path('manifest.json', result_dir)
31
- }
32
- let(:manifest){
33
- sprockets_env
34
- Sprockets::Manifest.new(sprockets_env, result_dir, manifest_file)
35
- }
36
- let(:sprockets_env){
37
- subject.install(sprockets_env_without_csso)
38
- sprockets_env_without_csso
39
- }
40
-
41
- it "installs" do
42
- sprockets_env.css_compressor.must_equal Csso::Compressor
43
- manifest.environment.must_equal(sprockets_env)
44
- manifest.clobber
45
- res = manifest.compile('test.css')
46
- res.size.must_equal 1
47
- [File.expand_path('../../fixtures/test.css', __FILE__), 'test.css'].must_include res.first
48
- File.read(manifest_file).wont_equal '{}'
49
- sprockets_env['test.css'].source.must_equal '.class{color:red}'
50
- manifest.clobber
51
- end
52
-
53
- it "compiles with sourcemap" do
54
- manifest.clobber
55
- begin
56
- require 'sass'
57
- rescue LoadError
58
- skip 'No sass in this env, skipping'
59
- end
60
- manifest.compile('test2.css')
61
- manifest.compile('test2.css.map')
62
- json = JSON.load File.read(manifest_file)
63
- json["assets"]["test2.css"].must_match(/\.css$/)
64
- sprockets_env['test2.css'].source.must_equal '.class,.class .other_class{color:red}.something{color:#000}.test2{color:#00f}'
65
- map = JSON.load(sprockets_env['test2.css.map'].source)
66
- map["sources"].size.must_equal 4
67
- manifest.clobber
68
- end
69
-
70
- it "loads into rails" do
71
- begin
72
- require "rails"
73
- rescue LoadError
74
- skip "no rails in this env"
75
- end
76
- require "sprockets/railtie"
77
- require 'csso/railtie'
78
-
79
- app = Class.new(Rails::Application) do
80
- config.eager_load = false
81
- config.assets.enabled = true
82
- end
83
- app.initialize!
84
- app.config.assets.css_compressor.must_equal :csso
85
- app.assets.css_compressor.must_equal Csso::Compressor
86
- end
87
- end
@@ -1,5 +0,0 @@
1
- /* LaLaLa */
2
-
3
- .class {
4
- color: #ff0000;
5
- }
@@ -1,7 +0,0 @@
1
- /* LaLaLa */
2
- //= require ./test.css
3
- //= require ./test4.css
4
-
5
- .test2{
6
- color: #0000ff;
7
- }
@@ -1,3 +0,0 @@
1
- .something{
2
- color: #000000;
3
- }
@@ -1,10 +0,0 @@
1
- @import 'test3';
2
-
3
- $color: #ff0000;
4
-
5
- .class {
6
- .other_class{
7
- // comment blablabla
8
- color: $color;
9
- }
10
- }