JSONRecord 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +6 -9
- data/bin/jsonrecord +2 -1
- data/lib/JSONRecord/class_methods.rb +2 -1
- data/lib/JSONRecord/version.rb +1 -1
- data/lib/loader.rb +1 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# JSONRecord
|
2
2
|
|
3
|
-
JSONRecord is a minimal document storage for
|
3
|
+
JSONRecord is a minimal document storage for ruby, with an active record style query interface.
|
4
4
|
It eventually aims to be as powerfull of other document stores like couchdb ... this is just a beginning.
|
5
|
-
Inventual Roadmap is to make it independent of rails.
|
6
|
-
|
7
5
|
|
8
6
|
## Installation
|
9
7
|
|
@@ -39,11 +37,10 @@ Or install it yourself as:
|
|
39
37
|
##Methods include :
|
40
38
|
|
41
39
|
```ruby
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
Model.find(id)
|
41
|
+
Model.find_by_column_name("column_value")
|
42
|
+
Model.find(id).update_attributes(:name => "pankaj" , :age => "29")
|
43
|
+
Model.find(id).destroy()
|
47
44
|
```
|
48
45
|
|
49
46
|
also ,
|
@@ -53,7 +50,7 @@ Model.new({:name=> "pankaj" , :age => "29"}).save
|
|
53
50
|
```
|
54
51
|
|
55
52
|
In your rails model: In order to define new attributes use `column` method
|
56
|
-
i.e column :column_name ,
|
53
|
+
i.e column :column_name , datatype
|
57
54
|
|
58
55
|
|
59
56
|
example => `column :name`
|
data/bin/jsonrecord
CHANGED
@@ -4,7 +4,8 @@ require 'fileutils'
|
|
4
4
|
require 'optparse'
|
5
5
|
require 'active_support/inflector'
|
6
6
|
|
7
|
-
|
7
|
+
gempath = Gem::Specification.find_by_name('JSONRecord').gem_dir
|
8
|
+
tables_dir = File.expand_path("#{gempath}/lib/tables",__FILE__)
|
8
9
|
|
9
10
|
if ARGV[0] == 'generate' and ARGV[1] == 'model'
|
10
11
|
model_name = ARGV[2].to_s.pluralize
|
@@ -57,7 +57,8 @@ module JSONRecord
|
|
57
57
|
end
|
58
58
|
|
59
59
|
private
|
60
|
-
|
60
|
+
gempath = Gem::Specification.find_by_name('JSONRecord').gem_dir
|
61
|
+
Dir.glob File.expand_path("#{gempath}/lib/tables/**/*.json", __FILE__) do |file|
|
61
62
|
JSON_TABLES[File.basename(file)] = file
|
62
63
|
end
|
63
64
|
|
data/lib/JSONRecord/version.rb
CHANGED
data/lib/loader.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: JSONRecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|