diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..403b308 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 6d32d4f..ffb82d0 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -36,6 +36,7 @@ jobs: ruby-version: ${{matrix.ruby}} - run: gem install bundler -v ">= 2.3.22" # for "add --path" - run: bundle install --local || bundle install + - run: bundle exec rake download - run: git clone --depth=1 ${{matrix.url}} ${{matrix.name}} - name: ${{matrix.name}} test suite working-directory: ${{matrix.name}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2545da..bd9b6c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,20 @@ on: - '*' jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rm Gemfile.lock + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler: latest + bundler-cache: true + - run: bundle exec rake standard + build: + needs: [ lint ] runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/CHANGELOG.md b/CHANGELOG.md index e64b3db..4838e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +## v3.4.14 + +* Update `tailwindcss` to [v3.4.14](https://github.com/tailwindlabs/tailwindcss/releases/tag/v3.4.14). (#8) @flavorjones + + ## v3.4.13 / 2023-09-26 * This gem was extracted from `tailwindcss-rails`. diff --git a/Gemfile b/Gemfile index d616ad9..4b34c62 100644 --- a/Gemfile +++ b/Gemfile @@ -9,4 +9,4 @@ gem "rake", "~> 13.0" gem "minitest", "~> 5.16" -gem "standard", "~> 1.3" +gem "standard", "~> 1.41" diff --git a/Gemfile.lock b/Gemfile.lock index 3659cc4..7d0cc59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tailwindcss-ruby (3.4.13) + tailwindcss-ruby (3.4.14) GEM remote: https://rubygems.org/ @@ -19,36 +19,34 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) - rexml (3.3.7) - rubocop (1.65.1) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.32.3) parser (>= 3.3.1.0) - rubocop-performance (1.21.1) + rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) - standard (1.40.0) + standard (1.41.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.65.0) + rubocop (~> 1.66.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.4) + standard-performance (~> 1.5) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.4.0) + standard-performance (1.5.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.21.0) + rubocop-performance (~> 1.22.0) unicode-display_width (2.6.0) PLATFORMS @@ -58,7 +56,7 @@ PLATFORMS DEPENDENCIES minitest (~> 5.16) rake (~> 13.0) - standard (~> 1.3) + standard (~> 1.41) tailwindcss-ruby! BUNDLED WITH diff --git a/exe/tailwindcss b/exe/tailwindcss index 24b29b8..15b02ee 100755 --- a/exe/tailwindcss +++ b/exe/tailwindcss @@ -14,6 +14,6 @@ begin exec(*command) end rescue Tailwindcss::Ruby::UnsupportedPlatformException, Tailwindcss::Ruby::ExecutableNotFoundException => e - STDERR.puts("ERROR: " + e.message) + warn("ERROR: " + e.message) exit 1 end diff --git a/lib/tailwindcss/ruby/upstream.rb b/lib/tailwindcss/ruby/upstream.rb index ce7dab3..aa23e2c 100644 --- a/lib/tailwindcss/ruby/upstream.rb +++ b/lib/tailwindcss/ruby/upstream.rb @@ -1,7 +1,7 @@ module Tailwindcss module Ruby module Upstream - VERSION = "v3.4.13" + VERSION = "v3.4.14" # rubygems platform name => upstream release filename NATIVE_PLATFORMS = { @@ -11,7 +11,7 @@ module Upstream "x86_64-darwin" => "tailwindcss-macos-x64", "x86_64-linux" => "tailwindcss-linux-x64", "aarch64-linux" => "tailwindcss-linux-arm64", - "arm-linux" => "tailwindcss-linux-armv7", + "arm-linux" => "tailwindcss-linux-armv7" } end end diff --git a/lib/tailwindcss/ruby/version.rb b/lib/tailwindcss/ruby/version.rb index fc1a5de..f0db692 100644 --- a/lib/tailwindcss/ruby/version.rb +++ b/lib/tailwindcss/ruby/version.rb @@ -2,6 +2,6 @@ module Tailwindcss module Ruby - VERSION = "3.4.13" + VERSION = "3.4.14" end end diff --git a/rakelib/package.rake b/rakelib/package.rake index 2b49fa8..55c73cc 100644 --- a/rakelib/package.rake +++ b/rakelib/package.rake @@ -1,4 +1,3 @@ -# coding: utf-8 # # Rake tasks to manage native gem packages with binary executables from tailwindlabs/tailwindcss # @@ -39,7 +38,7 @@ # - pkg/tailwindcss-ruby-1.0.0-x64-mingw-ucrt.gem # - pkg/tailwindcss-ruby-1.0.0-x86_64-darwin.gem # - pkg/tailwindcss-ruby-1.0.0-x86_64-linux.gem -# +# # Note that in addition to the native gems, a vanilla "ruby" gem will also be created without # either the `exe/tailwindcss` script or a binary executable present. # @@ -75,7 +74,7 @@ end TAILWINDCSS_RUBY_GEMSPEC = Bundler.load_gemspec("tailwindcss-ruby.gemspec") # prepend the download task before the Gem::PackageTask tasks -task :package => :download +task package: :download gem_path = Gem::PackageTask.new(TAILWINDCSS_RUBY_GEMSPEC).define desc "Build the ruby gem" @@ -103,12 +102,10 @@ Tailwindcss::Ruby::Upstream::NATIVE_PLATFORMS.each do |platform, filename| warn "Downloading #{exepath} from #{release_url} ..." # lazy, but fine for now. - URI.open(release_url) do |remote| - File.open(exepath, "wb") do |local| - local.write(remote.read) - end + URI.parse(release_url).open do |remote| + File.binwrite(exepath, remote.read) end - FileUtils.chmod(0755, exepath, verbose: true) + FileUtils.chmod(0o755, exepath, verbose: true) end end end @@ -119,11 +116,11 @@ task "check" => exepaths do sha_url = if File.exist?(sha_filename) sha_filename else - sha_url = tailwindcss_download_url("sha256sums.txt") + tailwindcss_download_url("sha256sums.txt") end gemspec = TAILWINDCSS_RUBY_GEMSPEC - checksums = URI.open(sha_url).each_line.map do |line| + checksums = URI.parse(sha_url).open.each_line.map do |line| checksum, file = line.split [File.basename(file), checksum] end.to_h diff --git a/test/tailwindcss/test_ruby.rb b/test/tailwindcss/test_ruby.rb index ecdcbd2..02ea102 100644 --- a/test/tailwindcss/test_ruby.rb +++ b/test/tailwindcss/test_ruby.rb @@ -108,13 +108,11 @@ def mock_local_tailwindcss_install end it ".executable raises ExecutableNotFoundException is TAILWINDCSS_INSTALL_DIR is set to a nonexistent dir" do - begin - ENV["TAILWINDCSS_INSTALL_DIR"] = "/does/not/exist" - assert_raises(Tailwindcss::Ruby::DirectoryNotFoundException) do - Tailwindcss::Ruby.executable - end - ensure - ENV["TAILWINDCSS_INSTALL_DIR"] = nil + ENV["TAILWINDCSS_INSTALL_DIR"] = "/does/not/exist" + assert_raises(Tailwindcss::Ruby::DirectoryNotFoundException) do + Tailwindcss::Ruby.executable end + ensure + ENV["TAILWINDCSS_INSTALL_DIR"] = nil end end