erbfmt 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3bfbd53427027ba63e702a93e31c01562777fbbaff0c046bf2ea392caf08e68c
4
+ data.tar.gz: 02ac7f93b86e6e69700a3d168fd828cb7449c48fae63c2130e03f2f7e5e34168
5
+ SHA512:
6
+ metadata.gz: 9fdf7f9b1f21b1a924a213069f311479e30b12c5a8461bea46e96933acee8a16458e17ec54f5c59f75bbea986f9ffc8879686efec91d175bf31c8ff44b998983
7
+ data.tar.gz: d56ca2bb5b1fb3adc9e43f8657122ec3c00916b5809d59ab9df8dfa4571500a3121d731150f05c790a0ff056e0fc78c44affb6c3b5e05aeb486955e3b2b186ac
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 erbfmt contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # erbfmt Ruby wrapper
2
+
3
+ This gem is a thin launcher for the erbfmt Rust binary.
4
+
5
+ Initial releases are distributed as `.gem` files attached to the
6
+ [erbfmt GitHub Release](https://github.com/hinamimi/erbfmt/releases/tag/v0.1.5).
7
+ Newer releases may also be published to RubyGems.org. To install a downloaded
8
+ release gem directly, choose the file matching the local platform. For example,
9
+ on glibc Linux x64:
10
+
11
+ ```bash
12
+ gem install --local ./erbfmt-0.1.5-x86_64-linux-gnu.gem
13
+ erbfmt --version
14
+ ```
15
+
16
+ ## Installing from a Gemfile
17
+
18
+ If the erbfmt version you want is available on RubyGems.org, use Bundler:
19
+
20
+ ```bash
21
+ bundle add erbfmt --group development --require false
22
+ bundle exec erbfmt --version
23
+ ```
24
+
25
+ RubyGems.org releases include platform-specific gems with the packaged Rust
26
+ binary and may include `erbfmt-0.1.5.gem` as a binary-free Bundler fallback for
27
+ multi-platform lockfiles. The fallback resolves dependency installation but
28
+ needs either a matching platform gem or `ERBFMT_BINARY` to run.
29
+
30
+ If the version is only available as a GitHub Release asset, download the
31
+ matching release asset, unpack it into `vendor/gems`, and reference the
32
+ unpacked path dependency:
33
+
34
+ ```bash
35
+ curl -L \
36
+ -o erbfmt-0.1.5-x86_64-linux-gnu.gem \
37
+ https://github.com/hinamimi/erbfmt/releases/download/v0.1.5/erbfmt-0.1.5-x86_64-linux-gnu.gem
38
+ mkdir -p vendor/gems
39
+ gem unpack erbfmt-0.1.5-x86_64-linux-gnu.gem --target vendor/gems
40
+ ```
41
+
42
+ Add the unpacked gem to the project Gemfile:
43
+
44
+ ```ruby
45
+ group :development do
46
+ gem "erbfmt",
47
+ path: "vendor/gems/erbfmt-0.1.5-x86_64-linux-gnu",
48
+ require: false
49
+ end
50
+ ```
51
+
52
+ Then install and run it through Bundler:
53
+
54
+ ```bash
55
+ bundle install
56
+ bundle exec erbfmt --version
57
+ ```
58
+
59
+ New release gems include the gemspec needed by Bundler. If an older downloaded
60
+ asset does not unpack `erbfmt.gemspec`, use the fallback in the Ruby gem docs.
61
+
62
+ Commit the unpacked `vendor/gems/erbfmt-...` directory and `Gemfile.lock` when
63
+ the project should be installable by other team members without a separate
64
+ download step. You can also commit the downloaded `.gem` under `vendor/cache`
65
+ as the original release artifact. See
66
+ [RubyGem.md](../../docs/RubyGem.md#installing-from-a-gemfile) for supported
67
+ platforms, older gem fallback steps, and multi-platform guidance.
68
+
69
+ The wrapper packages one Rust binary and does not implement formatting or
70
+ linting in Ruby.
71
+
72
+ ## Development
73
+
74
+ From the repository root:
75
+
76
+ ```bash
77
+ cargo build --locked
78
+ BUNDLE_GEMFILE=packages/ruby/Gemfile bundle install
79
+ BUNDLE_GEMFILE=packages/ruby/Gemfile \
80
+ ERBFMT_BINARY="$PWD/target/debug/erbfmt" \
81
+ bundle exec rake -f packages/ruby/Rakefile test verify_version
82
+ ```
83
+
84
+ The shared version check covers Cargo, this gem, the VSCode extension, and
85
+ their lockfiles. Release versions are updated from the repository root:
86
+
87
+ ```bash
88
+ ruby scripts/version.rb set 0.1.5
89
+ ruby scripts/version.rb verify 0.1.5
90
+ ```
91
+
92
+ Build, install, and execute a local platform-specific gem in isolation:
93
+
94
+ ```bash
95
+ BUNDLE_GEMFILE=packages/ruby/Gemfile \
96
+ ERBFMT_BINARY="$PWD/target/debug/erbfmt" \
97
+ bundle exec rake -f packages/ruby/Rakefile gem:verify
98
+ ```
99
+
100
+ RubyGems.org publishing is an explicit release step handled from the repository
101
+ root. See [Release.md](../../docs/Release.md#rubygemsorg-publishing).
data/erbfmt.gemspec ADDED
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/erbfmt/version"
4
+
5
+ erbfmt_version = Erbfmt::VERSION
6
+ configured_platform = ENV["ERBFMT_GEM_PLATFORM"]
7
+ unpacked_platform = File.basename(__dir__).match(/\Aerbfmt-#{Regexp.escape(erbfmt_version)}-(.+)\z/)
8
+ erbfmt_platform = if configured_platform.nil? || configured_platform.empty?
9
+ unpacked_platform ? Gem::Platform.new(unpacked_platform[1]) : Gem::Platform::RUBY
10
+ else
11
+ Gem::Platform.new(configured_platform)
12
+ end
13
+
14
+ Gem::Specification.new do |spec|
15
+ spec.name = "erbfmt"
16
+ spec.version = erbfmt_version
17
+ spec.authors = ["erbfmt contributors"]
18
+ spec.summary = "Ruby wrapper for the erbfmt formatter and linter"
19
+ spec.description = "A thin Ruby launcher for the erbfmt Rust binary."
20
+ spec.homepage = "https://github.com/hinamimi/erbfmt"
21
+ spec.license = "MIT"
22
+ spec.required_ruby_version = ">= 3.1"
23
+ spec.metadata = {
24
+ "source_code_uri" => "https://github.com/hinamimi/erbfmt",
25
+ "bug_tracker_uri" => "https://github.com/hinamimi/erbfmt/issues",
26
+ "changelog_uri" => "https://github.com/hinamimi/erbfmt/releases"
27
+ }
28
+
29
+ spec.bindir = "exe"
30
+ spec.executables = ["erbfmt"]
31
+ spec.require_paths = ["lib"]
32
+ spec.platform = erbfmt_platform
33
+ spec.files = [
34
+ "erbfmt.gemspec",
35
+ "LICENSE.txt",
36
+ "README.md",
37
+ "exe/erbfmt",
38
+ "lib/erbfmt.rb",
39
+ "lib/erbfmt/binary.rb",
40
+ "lib/erbfmt/version.rb"
41
+ ] + Dir["libexec/erbfmt-bin*"]
42
+
43
+ spec.add_development_dependency "minitest", "~> 5.25"
44
+ spec.add_development_dependency "rake", "~> 13.2"
45
+ end
data/exe/erbfmt ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "erbfmt"
5
+
6
+ begin
7
+ exec(Erbfmt::Binary.path, *ARGV)
8
+ rescue Erbfmt::BinaryNotFound => error
9
+ warn "erbfmt: #{error.message}"
10
+ exit 1
11
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Erbfmt
4
+ class BinaryNotFound < StandardError; end
5
+
6
+ module Binary
7
+ module_function
8
+
9
+ def path(env = ENV)
10
+ override = env["ERBFMT_BINARY"]
11
+ return validate(File.expand_path(override), "ERBFMT_BINARY") unless override.nil? || override.empty?
12
+
13
+ validate(packaged_path, "packaged erbfmt binary")
14
+ end
15
+
16
+ def packaged_path
17
+ name = Gem.win_platform? ? "erbfmt-bin.exe" : "erbfmt-bin"
18
+ File.expand_path("../../libexec/#{name}", __dir__)
19
+ end
20
+
21
+ def validate(candidate, source)
22
+ return candidate if File.file?(candidate) && File.executable?(candidate)
23
+
24
+ raise BinaryNotFound,
25
+ "#{source} is missing or not executable: #{candidate}"
26
+ end
27
+ private_class_method :validate
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Erbfmt
4
+ VERSION = "0.1.5"
5
+ end
data/lib/erbfmt.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "erbfmt/binary"
4
+ require_relative "erbfmt/version"
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: erbfmt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
+ platform: ruby
6
+ authors:
7
+ - erbfmt contributors
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: minitest
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '5.25'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '5.25'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rake
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '13.2'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '13.2'
40
+ description: A thin Ruby launcher for the erbfmt Rust binary.
41
+ executables:
42
+ - erbfmt
43
+ extensions: []
44
+ extra_rdoc_files: []
45
+ files:
46
+ - LICENSE.txt
47
+ - README.md
48
+ - erbfmt.gemspec
49
+ - exe/erbfmt
50
+ - lib/erbfmt.rb
51
+ - lib/erbfmt/binary.rb
52
+ - lib/erbfmt/version.rb
53
+ homepage: https://github.com/hinamimi/erbfmt
54
+ licenses:
55
+ - MIT
56
+ metadata:
57
+ source_code_uri: https://github.com/hinamimi/erbfmt
58
+ bug_tracker_uri: https://github.com/hinamimi/erbfmt/issues
59
+ changelog_uri: https://github.com/hinamimi/erbfmt/releases
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '3.1'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 3.6.9
75
+ specification_version: 4
76
+ summary: Ruby wrapper for the erbfmt formatter and linter
77
+ test_files: []