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.
rbs_draper is a generator for decorators using Draper.
Add a new entry to your Gemfile and run bundle install
:
group :development do
gem 'rbs_draper', require: false
end
After the installation, please run rake task generator:
bundle exec rails g rbs_draper:install
If you have decorators having different names from models, you can specify the mapping from
decorator names to model names in lib/tasks/rbs_draper.rake
. For example:
RbsDraper::RakeTask.new do |task|
task.mapping = -> { { AdminUserDecorator => User } }
end
If your decorators access to the custom helpers via #h
method, you need to define the types
for the custom helpers into Draper::HelperProxy
:
module Draper
class HelperProxy
include MyCustomHelper
def my_custom_helper_method: (String, String) -> String
end
end
Run rbs:draper:clean
at first
Run other RBS generators (ex. rbs prototype
, rbs_rails
and so on)
Run rbs:draper:setup
task finally.
bundle exec rake rbs:draper:setup
Then rbs_draper will scan your source code and type signatures, and will generate
RBS files into sig/draper
directory.
Note: rbs_draper uses other type signatures to generate decorators' signature. So it should be run after other tasks.
After checking out the repo, run bin/setup
to install dependencies. 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 put
a git tag (ex. git tag v1.0.0
) and push it to the GitHub. Then GitHub Actions
will release a new package to rubygems.org automatically.
Bug reports and pull requests are welcome on GitHub at https://github.com/tk0miya/rbs_draper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the RbsDraper project's codebases, issue trackers is expected to follow the code of conduct.
FAQs
Unknown package
We found that rbs_draper demonstrated a not healthy version release cadence and project activity because the last version was released 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.