Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Helpers for compiling Go extensions for ruby
Add below.
spec.add_dependency "go_gem"
See below for details.
create_go_makefile
create_go_makefile
is an extension of create_makefile
.
Add a task and hacks to build Go against the Makefile
generated by create_makefile
.
e.g.
# ext/GEM_NAME/extconf.rb
require "mkmf"
require "go_gem/mkmf" # Append this
# Use create_go_makefile instead of create_makefile
# create_makefile("example/example")
create_go_makefile("example/example")
GoGem::RakeTask
Provides rake tasks for go test
with CRuby
# Rakefile
require "go_gem/rake_task"
GoGem::RakeTask.new("gem_name")
Following tasks are generated
rake go:test
rake go:testrace
rake go:fmt
rake go:build_envs
# Rakefile
require "go_gem/rake_task"
GoGem::RakeTask.new("gem_name") do |t|
t.task_namespace = "go5"
t.go_bin_path = "/path/to/go"
t.go_test_args = "-mod=readonly"
t.target_dir = "/dir/to/go-mod/"
end
Following tasks are generated
rake go5:test
rake go5:testrace
rake go5:fmt
rake go5:build_envs
# Rakefile
require "go_gem/rake_task"
go_task = GoGem::RakeTask.new("gem_name")
namespace :go do
desc "Run golangci-lint"
task :lint do
go_task.within_target_dir do
sh "which golangci-lint" do |ok, _|
raise "golangci-lint isn't installed. See. https://golangci-lint.run/welcome/install/" unless ok
end
sh GoGem::RakeTask.build_env_vars, "golangci-lint run"
end
end
end
jobs:
go-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: ruby/setup-ruby@v1
- name: export CGO_CFLAGS for golangci-lint
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
task_namespace
: task namespace (default: :go
)go_bin_path
: path to go binary (default: "go"
)go_test_args
: argument passed to go test
(default: "-mod=readonly -count=1"
)target_dir
: directory when executing go commands. (default: "ext/#{gem_name}"
)After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby-go-gem/go-gem-wrapper.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that go_gem demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.