mince 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/README.md +49 -9
- data/lib/mince/version.rb +1 -1
- metadata +11 -11
data/README.md
CHANGED
@@ -1,16 +1,53 @@
|
|
1
|
-
# What is
|
1
|
+
# What is mince?
|
2
2
|
|
3
|
-
|
3
|
+
Light weight ORM to persist data to a hash.
|
4
|
+
|
5
|
+
Provides a very light weight interface for storing and retreiving information to MongoDB.
|
6
|
+
|
7
|
+
The motivation behind this is so your application is not tightly tied to a specific database. As your application grows you may need to upgrade to a different database or pull specific models to a different persistence strategy.
|
8
|
+
|
9
|
+
[@github](https://github.com/asynchrony/mince)
|
10
|
+
[@rubygems](https://rubygems.org/gems/mince)
|
11
|
+
|
12
|
+
# How to use
|
13
|
+
|
14
|
+
view the [example mince rails app](https://github.com/coffeencoke/mince_rails_example) to see how to use this.
|
15
|
+
|
16
|
+
Start MongoDB at localhost (currently does not support authentication against MongoDB).
|
17
|
+
|
18
|
+
From there you can use Mince to add and retrieve data.
|
19
|
+
|
20
|
+
<pre>
|
21
|
+
# Add a book to the books collection
|
22
|
+
Mince::DataStore.add 'books', title: 'The World In Photographs', publisher: 'National Geographic'
|
23
|
+
|
24
|
+
# Retrieve all records from the books collection
|
25
|
+
Mince::DataStore.find_all 'books'
|
26
|
+
|
27
|
+
# Retrieve all records from the books collection
|
28
|
+
Mince::DataStore.find_all 'books'
|
29
|
+
|
30
|
+
# Replace the a specific book
|
31
|
+
Mince::DataStore.replace 'books', title: 'A World In Photographs', publisher: 'National Geographic'
|
32
|
+
</pre>
|
33
|
+
|
34
|
+
View the [data_store.rb](https://github.com/asynchrony/mince/blob/master/lib/mince/data_store.rb) file for all methods available.
|
35
|
+
|
36
|
+
Use with [mince data model](https://github.com/asynchrony/mince_data_model) to make it easy to change from one data storage to another, like [Hashy Db](https://github.com/asynchrony/hashy_db), a Hash data persistence implementation.
|
4
37
|
|
5
38
|
# Why would you want this?
|
6
39
|
|
7
|
-
- To
|
8
|
-
-
|
40
|
+
- To defer choosing your database until you know most about your application.
|
41
|
+
- Provides assitance in designing a database agnostic architecture.
|
42
|
+
- When used along with [Hashy Db](https://github.com/asynchrony/hashy_db) it offers very little technical dependencies. Use Hashy Db in development mode so that you can clone the repo and develop, and run tests, cucumbers without databases, migrations, etc. Then in production mode, switch to Mince.
|
43
|
+
|
44
|
+
If you are able to switch between Hashy Db and Mince, your application will be more open to new and improved database in the future, or as your application evolves you aren't tied to a database.
|
9
45
|
|
10
|
-
# Todos
|
11
46
|
|
12
|
-
|
13
|
-
|
47
|
+
# Todo
|
48
|
+
|
49
|
+
- Load configuration from a yaml file
|
50
|
+
- Add rdoc comments
|
14
51
|
|
15
52
|
# Contribute
|
16
53
|
|
@@ -19,8 +56,11 @@ Provides a very lightweight interface to store and retrieve data in MongoDB in R
|
|
19
56
|
# Owners
|
20
57
|
|
21
58
|
Matt Simpson - [@railsgrammer](https://twitter.com/railsgrammer)
|
22
|
-
|
59
|
+
|
23
60
|
Jason Mayer - [@farkerhaiku](https://twitter.com/farkerhaiku)
|
24
61
|
|
25
62
|
# Contributors
|
26
|
-
|
63
|
+
|
64
|
+
- Your name here!
|
65
|
+
|
66
|
+
![Mince Some App](https://github.com/coffeencoke/gist-files/raw/master/images/mince%20garlic.png)
|
data/lib/mince/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mince
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ date: 2012-03-03 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
18
|
-
requirement: &
|
18
|
+
requirement: &70236892657660 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '3.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70236892657660
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mongo
|
29
|
-
requirement: &
|
29
|
+
requirement: &70236892657120 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 1.5.2
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70236892657120
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: bson_ext
|
40
|
-
requirement: &
|
40
|
+
requirement: &70236892656620 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 1.5.2
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70236892656620
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rake
|
51
|
-
requirement: &
|
51
|
+
requirement: &70236892656140 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70236892656140
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rspec
|
62
|
-
requirement: &
|
62
|
+
requirement: &70236892655480 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70236892655480
|
71
71
|
description: Lightweight MongoDB ORM for Ruby.
|
72
72
|
email:
|
73
73
|
- matt@railsgrammer.com
|