
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
modularity-coffee-rails
Advanced tools
Makes the Modularity CoffeeScript library and related modules available to Rails 3.1 applications.
Modularity is a framework for lightweight component-oriented CoffeeScript. It allows to compose functionally rich web pages in a clean, intuitive, and testable way out of well structured and reusable components. It scales very well with complexity.
Load modularity in your application's Gemfile:
gem 'modularity-rails'
And then execute:
$ bundle
Finally, you have to load the modularity file into your application's javascript.
The easiest way is to add it to application.coffee
:
# require jquery
# require modularity
Modularity is a lightweight framework for building powerful AJAX applications. Modularity avoids magic and heavyness. It focusses on providing a pragmatic and interoperable foundation for clean hand-written code bases. Modularity provides practices to create code bases of incredible complexity that are still nicely manageable and perform very well.
Modules are native CoffeeScript classes that are specialized for doing what most JavaScript running in browsers does: managing a UI consisting of DOM elements, reacting to events that happen within that section, representing application logic specific to that section, and providing high-level APIs for others to interact with the section.
Each module has a container. The container is the outermost DOM element of a section. Everything the module does must happen inside this container. The module is responsible for managing the inner DOM-structure of the container.
Similar to Ruby mixins, mixins in Modularity allow to include orthogonal functional aspects defined in separate objects into a class.
myMixin =
# This will be called when an instance of a class that includes this mixin is created.
constructor: ->
# This method will be available in every class that includes
myMethod: ->
class MyModule extends Module
@mixin myMixin
constructor: (container) ->
# The super constructor will call the mixin constructors here.
super
# ...
Hooks are a more direct and easier way to interact with mixins. They are methods with predefined names that mixing modules can implement to hook into events of their mixins without the need to wire up event handlers, and with the ability to interact with the workflow of the mixins.
Modularity comes bundled with a bunch of example modules and mixins that can be used in production code.
The example modules are located in vendor/assets/javascripts/modules/
and vendor/assets/javascripts/mixins
and must be explicitly required in your Rails files using the require
commands of the asset pipeline.
clicked
event when anything inside the container is clicked. Uses the clickable
mixin.###clickable Including this mixins adds a 'clickable' aspect to your module, i.e. turns it into a button. Clicking anywhere inside the container makes it fire the 'clicked' event.
###closable Including this mixin makes a module closable. The mixin searches for an embedded DOM element with the class 'CloseButton'. When it is clicked, the following things happen:
A generic cached loader for parallel and repeated GET requests. Prevents duplicate requests, caches the responses.
The first request triggers the ajax request. Subsequent requests while the resquest is running are accumulated without causing new requests. Once the response arrives, all currently requesting clients are answered. Subsequent requests are answered immediately using the cached data.
Module.loader.get '/test.json', (data) ->
# Use data here.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)$ evergreen run
Modularity-Rails comes with support for LifeReload via Guard.
$ evergreen run
$ bundle exec guard
FAQs
Unknown package
We found that modularity-coffee-rails 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.