Skip to content

Commit

Permalink
repair git/config issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoward committed Oct 30, 2012
1 parent 6fb6677 commit 9f815cd
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 349 deletions.
51 changes: 36 additions & 15 deletions README.md
@@ -1,35 +1,56 @@
NAME
----
mongoid-sequence
mongoid-grid_fs

INSTALL
-------
gem install mongoid-sequence
gem install mongoid-grid_fs

SYNOPSIS
--------

````ruby

require 'mongoid'
require 'mongoid-sequence'
require 'mongoid-grid_fs'

g = GridFs.put readable

class Page
include Mongoid::Document
include Mongoid::Sequence
GridFS.get id

sequence :number
end

p Page.create.number #=> 1
p Page.create.number #=> 2
p Page.create.number #=> 3
GridFS.delete id


````

DESCRIPTION
-----------
mongoid_sequence is a pure mongoid sequence generator based on mongodb's
increment operator
mongoid_grid_fs is a pure mongoid 3 / moped implementation of the mongodb
grid_fs specification

ref: http://www.mongodb.org/display/DOCS/GridFS+Specification

it has the following features:

- implementation is on top of mongoid for portability. moped (the driver) is
barely used

- simple, REST-like api

- support for custom namespaces (fs.files vs. image.files)

- pathnames and io-like objects can be written to the grid

- auto-unique pathnames are generated (by default) to avoid collisions using #put

'path/info/a.rb' -> '$object_id/a.rb'

- [] and []= methods which allow the grid to be used like a giant file
hash in the sky

- supprt for data_uris

````erb
<%= image_tag :src => file.data_uri %>
````
4 changes: 2 additions & 2 deletions Rakefile
@@ -1,8 +1,8 @@
This.name =
"Mongoid::Sequence"
"Mongoid::GridFs"

This.synopsis =
"a mongoid 3/moped compatible sequence generator for your models"
"a mongoid 3/moped compatible implementation of the grid_fs specification"

This.rubyforge_project = 'codeforpeople'
This.author = "Ara T. Howard"
Expand Down
125 changes: 0 additions & 125 deletions lib/mongoid-sequence.rb

This file was deleted.

36 changes: 0 additions & 36 deletions mongoid-sequence.gemspec

This file was deleted.

16 changes: 13 additions & 3 deletions test/helper.rb
@@ -1,8 +1,18 @@
# -*- encoding : utf-8 -*-
require 'pp'
require_relative 'testing'
require_relative '../lib/mongoid-sequence.rb'
require_relative '../lib/mongoid-grid_fs.rb'

Mongoid.configure do |config|
config.connect_to('mongoid-sequence')
config.connect_to('mongoid-grid_fs_test')
end

require 'stringio'

class SIO < StringIO
attr_accessor :filename

def initialize(filename, *args, &block)
@filename = filename
super(*args, &block)
end
end
84 changes: 0 additions & 84 deletions test/mongoid-sequence.rb

This file was deleted.

0 comments on commit 9f815cd

Please sign in to comment.