formize 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -32,7 +32,8 @@ Jeweler::Tasks.new do |gem|
32
32
  # gem.add_runtime_dependency 'jabber4r', '> 0.1'
33
33
  # gem.add_development_dependency 'rspec', '> 1.2.3'
34
34
  gem.add_development_dependency "rcov", ">= 0"
35
- gem.add_development_dependency "actionpack", ">= 0"
35
+ gem.add_runtime_dependency "actionpack", ">= 0"
36
+ gem.add_runtime_dependency "activesupport", ">= 0"
36
37
  end
37
38
  Jeweler::RubygemsDotOrgTasks.new
38
39
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/formize.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{formize}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Brice Texier}]
12
- s.date = %q{2011-08-12}
12
+ s.date = %q{2011-08-23}
13
13
  s.description = %q{Like simple_form or formtastic, it aims to handle easily forms but taking in account AJAX and HTML5 on depending fields mainly.}
14
14
  s.email = %q{brice.texier@ekylibre.org}
15
15
  s.extra_rdoc_files = [
@@ -49,16 +49,19 @@ Gem::Specification.new do |s|
49
49
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
50
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
51
51
  s.add_development_dependency(%q<rcov>, [">= 0"])
52
- s.add_development_dependency(%q<actionpack>, [">= 0"])
52
+ s.add_runtime_dependency(%q<actionpack>, [">= 0"])
53
+ s.add_runtime_dependency(%q<activesupport>, [">= 0"])
53
54
  else
54
55
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
55
56
  s.add_dependency(%q<rcov>, [">= 0"])
56
57
  s.add_dependency(%q<actionpack>, [">= 0"])
58
+ s.add_dependency(%q<activesupport>, [">= 0"])
57
59
  end
58
60
  else
59
61
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
60
62
  s.add_dependency(%q<rcov>, [">= 0"])
61
63
  s.add_dependency(%q<actionpack>, [">= 0"])
64
+ s.add_dependency(%q<activesupport>, [">= 0"])
62
65
  end
63
66
  end
64
67
 
data/lib/formize.rb CHANGED
@@ -1,9 +1,20 @@
1
+ require 'active_support'
1
2
  # Formize provides controller's side defined forms.
2
3
  module Formize
3
4
 
4
5
  def self.configure(name, value = nil)
5
6
  unless self.respond_to?("#{name}=")
6
- mattr_accessor(name)
7
+ mattr_accessor(name)
8
+ # code = "unless defined?(@@#{name})\n"
9
+ # code << " @@#{name} = nil\n"
10
+ # code << "end\n"
11
+ # code << "def self.#{name}\n"
12
+ # code << " @@#{name}\n"
13
+ # code << "end\n"
14
+ # code << "def self.#{name}=(obj)\n"
15
+ # code << " @@#{name} = obj\n"
16
+ # code << "end\n"
17
+ # class_eval(code, __FILE__, __LINE__ + 1)
7
18
  self.send("#{name}=", value)
8
19
  end
9
20
  end
@@ -60,4 +60,5 @@ module Formize
60
60
 
61
61
  end
62
62
 
63
+ require 'action_controller'
63
64
  ActionController::Base.send(:include, Formize::ActionController)
@@ -73,7 +73,7 @@ module Formize
73
73
  code << "end\n"
74
74
  code.gsub!(/end\s*if/, 'elsif')
75
75
  # raise code
76
- list = code.split("\n"); list.each_index{|x| puts((x+1).to_s.rjust(4)+": "+list[x])}
76
+ # list = code.split("\n"); list.each_index{|x| puts((x+1).to_s.rjust(4)+": "+list[x])}
77
77
  return code
78
78
  end
79
79
 
@@ -112,7 +112,7 @@ module Formize
112
112
  code << "end\n"
113
113
 
114
114
  # raise code
115
- list = code.split("\n"); list.each_index{|x| puts((x+1).to_s.rjust(4)+": "+list[x])}
115
+ # list = code.split("\n"); list.each_index{|x| puts((x+1).to_s.rjust(4)+": "+list[x])}
116
116
  return code
117
117
  end
118
118
 
data/test/test_formize.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestFormize < Test::Unit::TestCase
4
- def test_something_for_real
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
4
+ def test_configuration
5
+ assert_not_nil Formize.default_source
6
+ assert_not_nil Formize.radio_count_max
7
+ assert_not_nil Formize.select_count_max
6
8
  end
7
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-12 00:00:00.000000000Z
12
+ date: 2011-08-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jeweler
16
- requirement: &8348360 !ruby/object:Gem::Requirement
16
+ requirement: &20714720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.4
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *8348360
24
+ version_requirements: *20714720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rcov
27
- requirement: &8322560 !ruby/object:Gem::Requirement
27
+ requirement: &20713980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,18 +32,29 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *8322560
35
+ version_requirements: *20713980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: actionpack
38
- requirement: &8320240 !ruby/object:Gem::Requirement
38
+ requirement: &20279180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
- type: :development
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *20279180
47
+ - !ruby/object:Gem::Dependency
48
+ name: activesupport
49
+ requirement: &20277520 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
45
56
  prerelease: false
46
- version_requirements: *8320240
57
+ version_requirements: *20277520
47
58
  description: Like simple_form or formtastic, it aims to handle easily forms but taking
48
59
  in account AJAX and HTML5 on depending fields mainly.
49
60
  email: brice.texier@ekylibre.org