mongo_helper 0.0.2
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/.gitignore +6 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/lib/mongo_helper/version.rb +3 -0
- data/lib/mongo_helper.rb +21 -0
- data/mongo_helper.gemspec +22 -0
- metadata +84 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/lib/mongo_helper.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module MongoHelper
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
module ClassMethods
|
5
|
+
def attr_alias(new_attr, old_attr)
|
6
|
+
alias_method(new_attr, old_attr)
|
7
|
+
alias_method("#{new_attr}=", "#{old_attr}=")
|
8
|
+
end
|
9
|
+
|
10
|
+
def embedded_in(owner_name)
|
11
|
+
alias_method(owner_name, :_parent_document)
|
12
|
+
alias_method("#{owner_name}=", "_parent_document=")
|
13
|
+
end
|
14
|
+
|
15
|
+
def random_token
|
16
|
+
# use base64url as defined by RFC4648
|
17
|
+
SecureRandom.base64(15).tr('+/=', '').strip.delete("\n")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "mongo_helper/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "mongo_helper"
|
7
|
+
s.version = MongoHelper::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Alan Graham"]
|
10
|
+
s.email = ["alan.g.graham@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Helper gem for Mongo}
|
13
|
+
s.description = %q{Helper gem for Mongo}
|
14
|
+
|
15
|
+
s.rubyforge_project = "mongo_helper"
|
16
|
+
s.add_dependency "activesupport"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mongo_helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Alan Graham
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-03-20 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: activesupport
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
description: Helper gem for Mongo
|
35
|
+
email:
|
36
|
+
- alan.g.graham@gmail.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- .gitignore
|
45
|
+
- Gemfile
|
46
|
+
- Rakefile
|
47
|
+
- lib/mongo_helper.rb
|
48
|
+
- lib/mongo_helper/version.rb
|
49
|
+
- mongo_helper.gemspec
|
50
|
+
homepage: ""
|
51
|
+
licenses: []
|
52
|
+
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
requirements: []
|
77
|
+
|
78
|
+
rubyforge_project: mongo_helper
|
79
|
+
rubygems_version: 1.8.17
|
80
|
+
signing_key:
|
81
|
+
specification_version: 3
|
82
|
+
summary: Helper gem for Mongo
|
83
|
+
test_files: []
|
84
|
+
|