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.
This project aims to provide a ruby-like way of creating CoreData models using a DSL, avoiding the need to create them using the XCode GUI builder.
##Installation
###Using bundler:
If you are using bundler for managing dependencies, you will need to add the gem to your project's Gemfile:
# Gemfile
source "https://rubygems.org"
gem "rake"
gem "core_data_motion"
# Some other gems for your poject
and setup your Rakefile to properly require bundler's dependencies:
# -*- coding: utf-8 -*-
# Rakefile
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'bundler'
Bundler.setup
Bundler.require
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'your_app_name'
app.frameworks += %w(CoreData)
app.files.unshift(*Dir.glob(File.join(app.project_dir, 'app/lib/**/*.rb')))
end
###Without bundler
If you are not managing dependencies with bundler, you will need to install the gem with:
gem install core_data_motion
And then require it in your Rakefile:
# -*- coding: utf-8 -*-
# Rakefile
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'core_data_motion'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'your_app_name'
app.frameworks += %w(CoreData)
app.files.unshift(*Dir.glob(File.join(app.project_dir, 'app/lib/**/*.rb')))
end
##Usage example:
Create a file under your settings/
directory and define the
ModelDefinition class as follows:
class ModelDefinition < CDM::EntityDefinition
def define_model
create_entity :project do |e|
e.string :name
e.string :description_text
e.date :start_date
e.double :budget
end
create_entity :task do |e|
e.int16 :project_id, optional: false
e.string :name
e.string :details
end
create_entity :comment do |e|
e.int16 :owner_id, optional: false
e.string :owner_type
e.string :content
end
end
end
Run the following rake task to create the files needed to create the data model:
rake coredata:setup
If you are using MagicalRecord, you can initialize your database in your application delegate by running:
MagicalRecord.setupCoreDataStackWithStoreNamed('database.sqlite')
You can use any CoreData wrapper you want (or none at all) to query for records and save them to the device's local database.
The available data types in a CoreData model are:
e.binary :binary_field
e.boolean :boolean_field
e.date :date_field
e.decimal :decimal_field
e.double :double_field
e.float :float_field
e.int16 :int_field
e.int32 :int_field
e.int64 :int_field
e.string :string_field
e.transformable :transformable_field
This is a work in progress and help is greatly appreciated! If you want to add a feature, fix a bug or help with documentation, you are very welcome to do so. Just follow the usual way of contributing:
FAQs
Unknown package
We found that core_data_motion 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.