ofmcore 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ofmcore/person.rb +10 -0
  2. data/lib/ofmcore.rb +3 -0
  3. metadata +68 -0
@@ -0,0 +1,10 @@
1
+ class OfmCore::Person < Sequel::Model
2
+ def self.rand
3
+ count = Person.count
4
+ Person.limit(1, Kernel.rand(count) ).first if (count > 0)
5
+ end
6
+
7
+ def validate
8
+ errors.add(:name, "can't be empty") if name.nil? || name.empty?
9
+ end
10
+ end
data/lib/ofmcore.rb ADDED
@@ -0,0 +1,3 @@
1
+ module OfmCore
2
+ require 'ofmcore/person.rb'
3
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ofmcore
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Ben Colon
14
+ autorequire: name
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-06-02 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description:
23
+ email: ben@colon.com.fr
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - lib/ofmcore.rb
32
+ - lib/ofmcore/person.rb
33
+ has_rdoc: true
34
+ homepage: http://colon.com.fr
35
+ licenses: []
36
+
37
+ post_install_message:
38
+ rdoc_options: []
39
+
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ hash: 3
48
+ segments:
49
+ - 0
50
+ version: "0"
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ requirements: []
61
+
62
+ rubyforge_project:
63
+ rubygems_version: 1.3.7
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Description ...
67
+ test_files: []
68
+