configurable_engine 0.1.2 → 0.2.0

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/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ Mon, Jan 10, 2010
2
+ - - - - - - - - -
3
+ - Add support for 'list' type
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.0
@@ -21,6 +21,9 @@ class Configurable < ActiveRecord::Base
21
21
  BigDecimal.new(value.to_s)
22
22
  when 'integer'
23
23
  value.to_i
24
+ when 'list'
25
+ return value if value.is_a?(Array)
26
+ value.split("\n").collect{ |v| v.split(',') } unless value.is_a?(Array)
24
27
  else
25
28
  value
26
29
  end
@@ -4,9 +4,11 @@
4
4
  <%- Configurable.defaults.each do |key, options| -%>
5
5
  <%= label_tag key, options[:name] %>
6
6
  <%- if options[:type] == 'password' -%>
7
- <%= text_area_tag key, Configurable.send(key) %>
8
- <%- elsif options[:type] == 'text' -%>
9
7
  <%= password_field_tag key, Configurable.send(key) %>
8
+ <%- elsif options[:type] == 'text' -%>
9
+ <%= text_area_tag key, Configurable.send(key) %>
10
+ <%- elsif options[:type] == 'list' -%>
11
+ <%= text_area_tag key, Configurable.send(key).collect{ |a| a.join(",")}.join("\n") %>
10
12
  <%- else -%>
11
13
  <%= text_field_tag key, Configurable.send(key) %>
12
14
  <%- end -%>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{configurable_engine}
8
- s.version = "0.1.2"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Campbell"]
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  "README.md"
18
18
  ]
19
19
  s.files = [
20
+ "CHANGELOG",
20
21
  "Gemfile",
21
22
  "Gemfile.lock",
22
23
  "LICENSE.txt",
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
7
  - 2
9
- version: 0.1.2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paul Campbell
@@ -94,6 +94,7 @@ extra_rdoc_files:
94
94
  - LICENSE.txt
95
95
  - README.md
96
96
  files:
97
+ - CHANGELOG
97
98
  - Gemfile
98
99
  - Gemfile.lock
99
100
  - LICENSE.txt
@@ -125,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
127
  - - ">="
127
128
  - !ruby/object:Gem::Version
128
- hash: 2410880943193149020
129
+ hash: -4354704404972552029
129
130
  segments:
130
131
  - 0
131
132
  version: "0"