New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

merb_relaxdb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merb_relaxdb

  • 1.11
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

h2. Overview

merb_relaxdb is a merb plugin that provides integration with CouchDB via the RelaxDB gem. Version numbers indicate compatibility with Merb. Revision numbers are excluded e.g. merb_relaxdb 1.0 should be compatible with Merb 1.0.x

The current release includes integration with merb-auth, but this should not yet be considered stable. A sample integration file is included below.

merb_relaxdb expects your merb app to augment the standard layout as described in the following tree. couchdb.yml is mandatory. Reference data, sample data and views are optional. merb-gen model my_model will create a sample couchdb.yml.

To use merb_relaxdb, list @dependency "merb_relaxdb", "1.0"@ in @config/dependencies.rb@ and @use_orm :relaxdb@ in @config/init.rb@

For more details on using RelaxDB, see the "RelaxDB wiki":http://github.com/paulcarey/relaxdb/wikis



  my_merb_app $ tree
  .
  |-- Rakefile
  |-- app
  |-- autotest
  |-- config
  |   |-- couchdb.yml
  |-- couchdb
  |   |-- data
  |   |   |-- reference
  |   |   |   `-- reference_data.rb
  |   |   `-- sample
  |   |       `-- sample_data.rb
  |   `-- views
  |       `-- views.js
  |-- lib
  |-- log
  |-- public
  |-- scratch
  `-- spec
  

h3. Sample merb/merb-auth/setup.rb


begin
  Merb::Authentication.user_class = User 
  
  # Mixin the salted user mixin  
  require 'merb-auth-more/mixins/salted_user'
  require 'merb_relaxdb/rdb_salted_user'
  
  Merb::Authentication.user_class.class_eval{ include Merb::Authentication::Mixins::SaltedUser }
      
  # Setup the session serialization
  class Merb::Authentication

    def fetch_user(session_user_id)
      RelaxDB.load(session_user_id) rescue nil
    end

    def store_user(user)
      user.nil? ? user : user._id
    end
  end
  
rescue => e
  Merb.logger.error <<-TEXT
  
    You need to setup some kind of user class with merb-auth.  
    Merb::Authentication.user_class = User
    
    If you want to fully customize your authentication you should use merb-core directly.  
    
    See lib/authentication/setup.rb and strategies.rb to customize your setup

    TEXT
end

FAQs

Package last updated on 14 Jun 2010

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc