famili 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +2 -1
  2. data/lib/famili/mother.rb +10 -3
  3. data/lib/famili.rb +1 -1
  4. metadata +7 -7
data/README.rdoc CHANGED
@@ -115,7 +115,8 @@ and then
115
115
  * 0.0.1 - created
116
116
  * 0.0.2 - add inheritance, and mother methods [unique,sequence_number]
117
117
  * 0.0.3 - fix Mother.create call model.save!; Mother.hash return symbolized hash
118
- * 0.0.5 - add raise NoMethodError if property declared without block (becose it is error-prone), fix Famili::Mother.class#name method
118
+ * 0.0.5 - add raise NoMethodError if property declared without block (becose it is error-prone), fix Famili::Mother.class#name method
119
+ * 0.0.6 - rename Mother#hash to Mother#build_hash (to avoid conflicts with Object#hash in Ruby 1.9). Old name keeped as alias when using with oldest versions of Ruby for backward compatibility.
119
120
 
120
121
  == TODO
121
122
 
data/lib/famili/mother.rb CHANGED
@@ -68,15 +68,22 @@ module Famili
68
68
  end
69
69
 
70
70
  def build(opts={})
71
- mother,model = _build(opts)
71
+ _,model = _build(opts)
72
72
  model
73
73
  end
74
74
 
75
- def hash(opts={})
76
- mother,model = _build(opts)
75
+ def build_hash(opts={})
76
+ _,model = _build(opts)
77
77
  model.attributes.dup.symbolize_keys!
78
78
  end
79
79
 
80
+ if RUBY_VERSION.sub(/(\d+\.\d+).*/, "\\1").to_f < 1.9
81
+ def hash(opts={})
82
+ warn "[DEPRECATION] `hash` is deprecated and not supported for Ruby 1.9. Please use `build_hash` instead."
83
+ build_hash(opts)
84
+ end
85
+ end
86
+
80
87
 
81
88
  def _build(opts)
82
89
  mother = new
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.5'
3
+ VERSION='0.0.6'
4
4
  autoload :Mother,'famili/mother'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: famili
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - niquola
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-27 00:00:00 +04:00
18
+ date: 2010-11-17 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -28,14 +28,14 @@ extensions: []
28
28
  extra_rdoc_files:
29
29
  - README.rdoc
30
30
  files:
31
- - Rakefile
32
31
  - README.rdoc
32
+ - Rakefile
33
33
  - lib/famili/mother.rb
34
34
  - lib/famili.rb
35
- - spec/spec_helper.rb
36
- - spec/database.yml
37
35
  - spec/famili_spec.rb
36
+ - spec/database.yml
38
37
  - spec/db/schema.rb
38
+ - spec/spec_helper.rb
39
39
  has_rdoc: true
40
40
  homepage: http://github.com/niquola/famili
41
41
  licenses: []