famili 0.0.3 → 0.0.4

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/lib/famili/mother.rb CHANGED
@@ -10,7 +10,7 @@ module Famili
10
10
  end
11
11
 
12
12
  def unique
13
- "#{Time.now.to_s}__#{rand(100)}"
13
+ "#{"%10.6f" % Time.now.to_f}#{object_id.abs}"
14
14
  end
15
15
 
16
16
  def sequence_number
data/lib/famili.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
2
2
  module Famili
3
- VERSION='0.0.3'
3
+ VERSION='0.0.4'
4
4
  autoload :Mother,'famili/mother'
5
5
  end
data/spec/famili_spec.rb CHANGED
@@ -58,6 +58,7 @@ describe Famili do
58
58
  hash.keys.each {|key| key.should be_kind_of(Symbol) }
59
59
  end
60
60
 
61
+
61
62
  it "should create model with asscociation" do
62
63
  article = Famili::Article.create
63
64
  article.user.should_not be_nil
@@ -74,4 +75,12 @@ describe Famili do
74
75
  next_seq_number = Famili::User.new.sequence_number
75
76
  next_seq_number.should == (seq_number + 1)
76
77
  end
78
+
79
+ it "mother should generate unique numbers" do
80
+ logins = []
81
+ 10000.times do
82
+ logins << Famili::User.hash[:login]
83
+ end
84
+ logins.include?(Famili::User.hash[:login]).should_not be_true
85
+ end
77
86
  end
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: famili
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- version: 0.0.3
4
+ version: 0.0.4
11
5
  platform: ruby
12
6
  authors:
13
7
  - niquola
@@ -15,7 +9,7 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2010-08-30 00:00:00 +04:00
12
+ date: 2010-08-31 00:00:00 +04:00
19
13
  default_executable:
20
14
  dependencies: []
21
15
 
@@ -28,14 +22,14 @@ extensions: []
28
22
  extra_rdoc_files:
29
23
  - README.rdoc
30
24
  files:
31
- - Rakefile
32
25
  - README.rdoc
33
- - lib/famili.rb
26
+ - Rakefile
34
27
  - lib/famili/mother.rb
28
+ - lib/famili.rb
35
29
  - spec/famili_spec.rb
36
- - spec/spec_helper.rb
37
30
  - spec/database.yml
38
31
  - spec/db/schema.rb
32
+ - spec/spec_helper.rb
39
33
  has_rdoc: true
40
34
  homepage: http://github.com/niquola/famili
41
35
  licenses: []
@@ -46,27 +40,21 @@ rdoc_options: []
46
40
  require_paths:
47
41
  - lib
48
42
  required_ruby_version: !ruby/object:Gem::Requirement
49
- none: false
50
43
  requirements:
51
44
  - - ">="
52
45
  - !ruby/object:Gem::Version
53
- hash: 3
54
- segments:
55
- - 0
56
46
  version: "0"
47
+ version:
57
48
  required_rubygems_version: !ruby/object:Gem::Requirement
58
- none: false
59
49
  requirements:
60
50
  - - ">="
61
51
  - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
52
  version: "0"
53
+ version:
66
54
  requirements: []
67
55
 
68
56
  rubyforge_project:
69
- rubygems_version: 1.3.7
57
+ rubygems_version: 1.3.5
70
58
  signing_key:
71
59
  specification_version: 3
72
60
  summary: Rails plugin for postgres