Socket
Book a DemoInstallSign in
Socket

ifd_tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ifd_tools

0.3.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

IFD Tools

This gem provides common functionality for use with all IFD server applications, including:

  • Base tweaks in styling and functionality for ActiveAdmin
  • User management for access to the /admin area
  • Management of EmergencyMessage, NotifierUpdate & SoftwareUpdate resources
  • Management of Customer
  • IfdTools::Tracking::Event & framework for tracking API and reporting (customer trends, etc)
  • Automatic inclusion of modules for generating API XML responses for /api/emergency_messages.xml, /api/notifier_updates.xml & /api/software_updates.xml
  • Protected API requests by Devise authentication (auth_token)

Usage

To install:

  • Create a new Rails project
  • Add gem 'ifd_tools' to your Gemfile
  • Run bundle
  • Run rails g ifd_tools:install
  • Start your server, login credentials are "matt@dmgx.com" & "P@$$w0rd" for http://localhost:5000/admin

Tracking

  • There are several configuration options for color choices in the ifd_tools.rb initializer.
  • To track specific events, create subclasses of IfdTools::Tracking::Event in your application, in app/models/ifd_tools/tracking folder.
  • Be sure to override the assign_trackable_item_by_id method per subclass (default implement is to raise an exception)
  • Tracking requests can be initiated via the API at /api/track.xml?type=product_event&id=14. The type parameter is the class name without the module prefixes, underscored -> "IfdTools::Tracking::ProductEvent" should be sent as "product_event".
  • Also have "batch tracking" functionality available, which will accept JSON or XML in a request to process multiple entries. Each "event" is id, type and optionally timestamp (UNIX) or platform.

Customer Creation

A special helper method is provided on the ApiController class to facilitate easy Customer creation. There is plenty of inline documentation on usage there, but here's an example:

class ApiController < ApplicationController

  before_filter :authenticate_customer!, :except => [:software_updates, :emergency_messages, :notifier_updates]
  respond_to :json, :xml

  include IfdTools::ApiControllerExtensions

  create_customer do |customer|
	  # customer = Customer.new(params[:request][:customer]) already passed in to us, just handle special use cases for data transformations
	  customer.account_level = CustomerAccountLevel.find_by_abbreviation(params[:account_level])
	  customer
  end

end

FAQs

Package last updated on 13 Feb 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.