gendalf 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.3. Made submodel attributes loading a separate routine in order for it to be easier overriden. Also fixed wrong eval type, which somehow worked :)
2
+
1
3
  v0.2. First working implementation
2
4
 
3
5
  v0.1. Initial gem release
data/Manifest CHANGED
@@ -1,7 +1,6 @@
1
1
  CHANGELOG
2
2
  Manifest
3
3
  Rakefile
4
- gendalf.gemspec
5
4
  lib/controllers/wizard_controller.rb
6
5
  lib/extensions/routes.rb
7
6
  lib/gendalf.rb
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{gendalf}
5
- s.version = "0.2"
5
+ s.version = "0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ivan Kasatenko"]
9
- s.date = %q{2011-02-16}
9
+ s.date = %q{2011-02-17}
10
10
  s.description = %q{Trivial gem to support wizard application style creation.}
11
11
  s.email = %q{sky.31338@gmail.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "lib/controllers/wizard_controller.rb", "lib/extensions/routes.rb", "lib/gendalf.rb", "lib/models/wizard_model.rb"]
13
- s.files = ["CHANGELOG", "Manifest", "Rakefile", "gendalf.gemspec", "lib/controllers/wizard_controller.rb", "lib/extensions/routes.rb", "lib/gendalf.rb", "lib/models/wizard_model.rb"]
13
+ s.files = ["CHANGELOG", "Manifest", "Rakefile", "lib/controllers/wizard_controller.rb", "lib/extensions/routes.rb", "lib/gendalf.rb", "lib/models/wizard_model.rb", "gendalf.gemspec"]
14
14
  s.homepage = %q{http://github.com/skywriter/gendalf}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Gendalf"]
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Gendalf", "--main", "README.markdown"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{gendalf}
18
18
  s.rubygems_version = %q{1.3.7}
@@ -64,9 +64,17 @@ module Gendalf
64
64
  step_model_class.class_eval do
65
65
  def initialize(attributes = {})
66
66
  return unless attributes.kind_of? Hash
67
+ if self.respond_to?(:custom_load_attributes)
68
+ custom_load_attributes attributes
69
+ else
70
+ load_attributes attributes
71
+ end
72
+ end
73
+
74
+ def load_attributes(attributes)
67
75
  attributes.each do |name, value|
68
76
  send("#{name}=", value)
69
- end
77
+ end
70
78
  end
71
79
 
72
80
  def persisted?
@@ -82,7 +90,7 @@ module Gendalf
82
90
  end
83
91
 
84
92
  # give user a chance to add the validations
85
- step_model_class.instance_eval(&validations_block)
93
+ step_model_class.class_eval(&validations_block)
86
94
 
87
95
  return step_model_class
88
96
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gendalf
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- version: "0.2"
8
+ - 3
9
+ version: "0.3"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ivan Kasatenko
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-16 00:00:00 +03:00
17
+ date: 2011-02-17 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -75,11 +75,11 @@ files:
75
75
  - CHANGELOG
76
76
  - Manifest
77
77
  - Rakefile
78
- - gendalf.gemspec
79
78
  - lib/controllers/wizard_controller.rb
80
79
  - lib/extensions/routes.rb
81
80
  - lib/gendalf.rb
82
81
  - lib/models/wizard_model.rb
82
+ - gendalf.gemspec
83
83
  has_rdoc: true
84
84
  homepage: http://github.com/skywriter/gendalf
85
85
  licenses: []
@@ -90,6 +90,8 @@ rdoc_options:
90
90
  - --inline-source
91
91
  - --title
92
92
  - Gendalf
93
+ - --main
94
+ - README.markdown
93
95
  require_paths:
94
96
  - lib
95
97
  required_ruby_version: !ruby/object:Gem::Requirement