couchbase-patterns 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/couchbase_patterns.gemspec +23 -0
- data/lib/{couchbase-patterns.rb → couchbase_patterns.rb} +16 -17
- data/lib/couchbase_patterns/version.rb +3 -0
- metadata +59 -10
- data/couchbase-patterns.gemspec +0 -17
- data/lib/couchbase-patterns/version.rb +0 -5
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# This is a new gem and currently under initial development
|
2
2
|
|
3
|
-
#
|
3
|
+
# CouchbasePatterns
|
4
4
|
|
5
|
-
ActiveRecord-like Design Patterns for Couchbase modeling
|
5
|
+
ActiveRecord-like Design Patterns for Couchbase modeling, based on KV patterns at CouchbaseModels.com
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/couchbase_patterns/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
|
6
|
+
gem.authors = ["Jasdeep Jaitla"]
|
7
|
+
gem.email = ["jasdeep@scalabl3.com"]
|
8
|
+
gem.description = %q{ActiveRecord-like Design Patterns and Other Design Patterns for Modeling with Couchbase}
|
9
|
+
gem.summary = %q{CouchbasePatterns employs KV patterns that can be found on CouchbaseModels.com as a convenience. This is an experimental gem at this point!}
|
10
|
+
gem.homepage = "https://github.com/scalabl3/couchbase-patterns"
|
11
|
+
|
12
|
+
gem.add_dependency('couchbase-docstore', '>= 0.1.0')
|
13
|
+
gem.add_dependency('couchbase-settings', '>= 0.1.0')
|
14
|
+
gem.add_dependency('couchbase', '>= 1.2.0.z.beta3')
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($\)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.name = "couchbase-patterns"
|
20
|
+
gem.require_paths = ["lib"]
|
21
|
+
gem.version = CouchbasePatterns::VERSION
|
22
|
+
|
23
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
require "
|
1
|
+
require "couchbase_settings"
|
2
|
+
require "couchbase_doc_store"
|
3
|
+
require "couchbase_patterns/version"
|
2
4
|
|
3
5
|
# active record verbs
|
4
6
|
|
@@ -15,20 +17,17 @@ require "couchbase-patterns/version"
|
|
15
17
|
|
16
18
|
# has_and_belongs_to_many :categories
|
17
19
|
|
18
|
-
module
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end # lookup_by
|
32
|
-
|
33
|
-
end
|
20
|
+
module CouchbasePatterns
|
21
|
+
# symbol-attributes to separate out as find_by methods,
|
22
|
+
# lookup attribute values MUST BE UNIQUE (i.e. email, phone number, uid, social network id, social security number, etc.)
|
23
|
+
def lookup_by(*attributes)
|
24
|
+
attributes.each do |a|
|
25
|
+
puts a
|
26
|
+
self.class.class_eval %Q{
|
27
|
+
def find_by_#{a} (&block)
|
28
|
+
yield(self) if block_given?
|
29
|
+
end
|
30
|
+
}
|
31
|
+
end # attributes.each
|
32
|
+
end # lookup_by
|
34
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-patterns
|
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:
|
@@ -9,9 +9,58 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
14
|
-
|
12
|
+
date: 2012-10-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: couchbase-docstore
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: couchbase-settings
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.1.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.1.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: couchbase
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.2.0.z.beta3
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.0.z.beta3
|
62
|
+
description: ActiveRecord-like Design Patterns and Other Design Patterns for Modeling
|
63
|
+
with Couchbase
|
15
64
|
email:
|
16
65
|
- jasdeep@scalabl3.com
|
17
66
|
executables: []
|
@@ -23,9 +72,9 @@ files:
|
|
23
72
|
- LICENSE
|
24
73
|
- README.md
|
25
74
|
- Rakefile
|
26
|
-
-
|
27
|
-
- lib/
|
28
|
-
- lib/
|
75
|
+
- couchbase_patterns.gemspec
|
76
|
+
- lib/couchbase_patterns.rb
|
77
|
+
- lib/couchbase_patterns/version.rb
|
29
78
|
homepage: https://github.com/scalabl3/couchbase-patterns
|
30
79
|
licenses: []
|
31
80
|
post_install_message:
|
@@ -46,9 +95,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
95
|
version: '0'
|
47
96
|
requirements: []
|
48
97
|
rubyforge_project:
|
49
|
-
rubygems_version: 1.8.
|
98
|
+
rubygems_version: 1.8.24
|
50
99
|
signing_key:
|
51
100
|
specification_version: 3
|
52
|
-
summary:
|
53
|
-
|
101
|
+
summary: CouchbasePatterns employs KV patterns that can be found on CouchbaseModels.com
|
102
|
+
as a convenience. This is an experimental gem at this point!
|
54
103
|
test_files: []
|
data/couchbase-patterns.gemspec
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/couchbase-patterns/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Jasdeep Jaitla"]
|
6
|
-
gem.email = ["jasdeep@scalabl3.com"]
|
7
|
-
gem.description = %q{ActiveRecord and Other Design Patterns for Models using Couchbase}
|
8
|
-
gem.summary = %q{Model objects and relationships easier in Ruby/Rails/JRuby using Design Patterns that work well in Couchbase}
|
9
|
-
gem.homepage = "https://github.com/scalabl3/couchbase-patterns"
|
10
|
-
|
11
|
-
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name = "couchbase-patterns"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Couchbase::Patterns::VERSION
|
17
|
-
end
|