escompress 0.1.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: c90fadf990224c158502f673ddf7305f31b6cdb5ea4dddc3bcb3f7195ce6e4e9
4
- data.tar.gz: ed32c9ff9764ad084909999633d0079ca68acb2cc97d9d0d96f5e8f73c362061
3
+ metadata.gz: 41d04aee1692b8dcb3d122a0ebce14713b990928436f20eb4d31912a3092a058
4
+ data.tar.gz: 2727e34eb6c9e09fc22eebd4ed8358441078beaae8cf9fd2dec3565571c1f179
5
5
  SHA512:
6
- metadata.gz: baf76ad89aa2fb5d8e5ff7fa01d6a1a638a70f2742fd8de1aeaaa5402432e088d6da1f292c8e177f6bd75ce76afe34650d7f053afded66b1cfe3902d9709882c
7
- data.tar.gz: aea80a7e9a7922812196d2af5550509e372468e32a5adad39ad4f6d8530f6eb561c5c08c7bb0db5ab55a23237bbfb2c5638114ee5b3118ce8455dcfbc0089c0a
6
+ metadata.gz: d64f0562372a1e9ebe51bb00c1f1fb18c6fdb8910a585226f8571dd03c07033aae6b2b5e3a690e77be5103e9e1c5ad5203f284cf39c78881f1f3ef228bbfbb56
7
+ data.tar.gz: ea9b162a7c554845c4bc884807d5358e739691f63030e5004286c8bd9d7fe3cfcea4cdd76352bb5efa4e6bbc1a6f6fc65910d9616d7a64bf2840cb71dc38bb5a
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- escompress (0.1.0)
4
+ escompress (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
10
  json (2.6.2)
11
+ minitest (5.16.3)
11
12
  parallel (1.22.1)
12
13
  parser (3.1.2.0)
13
14
  ast (~> 2.4.1)
@@ -38,9 +39,11 @@ GEM
38
39
 
39
40
  PLATFORMS
40
41
  x86_64-darwin-20
42
+ x86_64-linux
41
43
 
42
44
  DEPENDENCIES
43
45
  escompress!
46
+ minitest
44
47
  rake (~> 13.0)
45
48
  standard (~> 1.3)
46
49
 
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Use esbuild to compress your Rails CSS (or JS if you want).
4
4
 
5
+ ## Why?
6
+
7
+ You might find yourself with a Rails app that uses sass-rails (and sassc) gems. You may be stuck with these gems for legacy reasons. Ruby sass can't handle newer CSS syntaxes.
8
+
5
9
  ## Installation
6
10
 
7
11
  Install the gem and add to the application's Gemfile by executing:
@@ -14,12 +18,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
14
18
 
15
19
  ## Usage
16
20
 
21
+ Make sure you have `esbuild` in your package.json file. If you are using Rails, escompress will look in your node_modules folder for the esbuild executable. If not using Rails, the gem will assume the executable is located at `/usr/local/bin/esbuild` on the underlying machine.
22
+
17
23
  ```ruby
18
24
  # in application.rb
19
25
 
20
26
  # You can specify the location of your esbuild executable.
21
- # The default location where escompress will look is /usr/local/bin/esbuild
22
- Escompress.esbuild_executable = Rails.root.join("node_modules/esbuild/bin/esbuild")
27
+ # Escompress.esbuild_executable = Rails.root.join("some/other/path/esbuild")
23
28
 
24
29
  module MyApp
25
30
  class Application < Rails::Application
@@ -38,7 +43,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
38
43
 
39
44
  ## Contributing
40
45
 
41
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/escompress. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/escompress/blob/master/CODE_OF_CONDUCT.md).
46
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jwilsjustin/escompress. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to be decent human beings.
42
47
 
43
48
  ## License
44
49
 
data/Rakefile CHANGED
@@ -2,5 +2,10 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "standard/rake"
5
+ require "rake/testtask"
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.pattern = "test/test_*.rb"
9
+ end
5
10
 
6
11
  task default: :standard
data/escompress.gemspec CHANGED
@@ -28,4 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.bindir = "exe"
29
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "minitest"
31
33
  end
@@ -1,4 +1,7 @@
1
1
  module Escompress
2
2
  class Railtie < Rails::Railtie
3
+ initializer "escompress_railtie.configure_rails_initialization" do
4
+ Escompress.esbuild_executable = Rails.root.join("node_modules/esbuild/bin/esbuild")
5
+ end
3
6
  end
4
7
  end
@@ -1,3 +1,3 @@
1
1
  module Escompress
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/escompress.rb CHANGED
@@ -1,17 +1,18 @@
1
1
  require_relative "escompress/compressor"
2
2
  require_relative "escompress/version"
3
3
  require "escompress/railtie" if defined?(Rails::Railtie)
4
+ require "pathname"
4
5
 
5
6
  module Escompress
6
7
  class Error < StandardError; end
7
8
 
8
- @@esbuild_executable = "/usr/local/bin/esbuild"
9
+ DEFAULT_LOCATION = "/usr/local/bin/esbuild"
9
10
 
10
11
  def self.esbuild_executable=(path)
11
- @@esbuild_executable = path
12
+ @esbuild_executable = Pathname.new(path)
12
13
  end
13
14
 
14
15
  def self.esbuild_executable
15
- @@esbuild_executable
16
+ @esbuild_executable ||= Pathname.new(DEFAULT_LOCATION)
16
17
  end
17
18
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escompress
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Wilson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Use esbuild to compress your Rails CSS
14
28
  email:
15
29
  - justin@jwils.co
@@ -35,7 +49,7 @@ metadata:
35
49
  homepage_uri: https://github.com/jwilsjustin/escompress
36
50
  source_code_uri: https://github.com/jwilsjustin/escompress
37
51
  changelog_uri: https://github.com/jwilsjustin/escompress/CHANGELOG.md
38
- post_install_message:
52
+ post_install_message:
39
53
  rdoc_options: []
40
54
  require_paths:
41
55
  - lib
@@ -50,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
64
  - !ruby/object:Gem::Version
51
65
  version: '0'
52
66
  requirements: []
53
- rubygems_version: 3.1.6
54
- signing_key:
67
+ rubygems_version: 3.3.7
68
+ signing_key:
55
69
  specification_version: 4
56
70
  summary: Use esbuild to compress your Rails CSS
57
71
  test_files: []