Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Miss require
? Well, this is a step in that direction:
# in a RubyMotion file
motion_require "base_view_controller"
motion_require "../util/controller_helper"
class MyController < BaseViewController
include ControllerHelper
end
# in your Rakefile
require 'motion/project'
require 'motion-require'
Motion::Require.all
Motion::Project::App.setup do |app|
# ...
end
To enable motion_require
for only select files:
Motion::Require.all(Dir.glob('app/models/**/*.rb'))
# if you're writing a gem that supports iOS and OS X, you might need to filter
# based on the platform:
Motion::Require.all(Dir.glob('lib/ios/**/*.rb'), platform: :ios)
Motion::Require.all(Dir.glob('lib/osx/**/*.rb'), platform: :osx)
You should not use app.files <<
in your setup
block if using motion-require; opt to use Motion::Require.all
and it will be taken care of.
It's used in:
gem install motion-require
Can also add to your Gemfile
etc
motion-require uses static analysis (via ripper
) to find the files using motion_require
and automatically add the declared dependencies to Motion::Project::Config#dependencies
. Then the Kernel#motion_require
method is overriden at compile-time to be a noop.
The paths attached to motion_require
are treated like those with require_relative
. If you want to use require_relative
instead of motion_require
, you can enable this:
require 'motion-require'
Motion::Require.require_relative_enabled = true
# now Motion::Require will detect require_relative
Motion::Require.all(Dir.glob("app/**/*.rb"))
Clay Allsopp (http://clayallsopp.com)
motion-require is available under the MIT license. See the LICENSE file for more info.
FAQs
Unknown package
We found that motion-require 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.