behavior 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ Mon Feb 22 2010
2
+ --------------
3
+ - Added "options" type for list
4
+
1
5
  Mon Feb 8 2010
2
6
  --------------
3
7
  - Added "integer" and "decimal" types
data/README.md CHANGED
@@ -90,6 +90,15 @@ If you want to control how the fields in the admin interface appear, you can add
90
90
  name: A price # sets the edit label
91
91
  default: "10.00" # sets the default value
92
92
  type: decimal # coerces the value to a decimal
93
+
94
+ options:
95
+ name: Select Options
96
+ default: 1
97
+ type: select
98
+ options:
99
+ - [ One, 1 ]
100
+ - [ Two, 2 ]
101
+ - [ Three, 3 ]
93
102
 
94
103
  Running the tests
95
104
  =================
data/Rakefile CHANGED
@@ -25,7 +25,7 @@ begin
25
25
  require 'jeweler'
26
26
  Jeweler::Tasks.new do |s|
27
27
  s.name = "behavior"
28
- s.version = "0.1.2"
28
+ s.version = "0.2.0"
29
29
  s.author = "Paul Campbell"
30
30
  s.email = "paul@rslw.com"
31
31
  s.homepage = "http://www.github.com/paulca/behavior"
@@ -1,8 +1,15 @@
1
1
  module BehaviorHelper
2
2
 
3
3
  def behavior_tag(conf)
4
- return text_area_tag("conf[#{conf}]", config[conf], :id => conf) if config.meta[conf][:type] == 'text'
5
- return password_field_tag("conf[#{conf}]", config[conf], :id => conf) if config.meta[conf][:type] == 'password'
6
- text_field_tag("conf[#{conf}]", config[conf], :id => conf)
4
+ case config.meta[conf][:type]
5
+ when 'text'
6
+ text_area_tag("conf[#{conf}]", config[conf], :id => conf)
7
+ when 'password'
8
+ password_field_tag("conf[#{conf}]", config[conf], :id => conf)
9
+ when 'select'
10
+ select_tag("conf[#{conf}]", options_for_select(config.meta[conf][:options]), :id => conf)
11
+ else
12
+ text_field_tag("conf[#{conf}]", config[conf], :id => conf)
13
+ end
7
14
  end
8
15
  end
data/behavior.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{behavior}
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"]
12
- s.date = %q{2010-02-08}
12
+ s.date = %q{2010-02-22}
13
13
  s.email = %q{paul@rslw.com}
14
14
  s.files = [
15
15
  "CHANGELOG",
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
44
44
  "spec/schema.rb",
45
45
  "spec/spec_helper.rb"
46
46
  ]
47
+ s.has_rdoc = false
47
48
  s.homepage = %q{http://www.github.com/paulca/behavior}
48
49
  s.rdoc_options = ["--charset=UTF-8"]
49
50
  s.require_paths = ["lib"]
data/config/behavior.yml CHANGED
@@ -25,4 +25,13 @@ value:
25
25
  price:
26
26
  default: "10.00"
27
27
  type: decimal
28
- name: Price
28
+ name: Price
29
+
30
+ options:
31
+ name: Select Options
32
+ default: 1
33
+ type: select
34
+ options:
35
+ - [ One, 1 ]
36
+ - [ Two, 2 ]
37
+ - [ Three, 3 ]
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
1
+ require 'spec_helper'
2
2
  require 'rails_generator'
3
3
  require 'rails_generator/scripts/generate'
4
4
 
@@ -19,7 +19,7 @@ describe Behavior do
19
19
  end
20
20
 
21
21
  it "should give me all the keys" do
22
- config.all.should == ["price", "email_name", "value", "email_address", "description", "password"]
22
+ config.all.should == ["price", "email_name", "value", "email_address", "description", "password", "options"]
23
23
  end
24
24
 
25
25
  it "should get me my value" do
data/spec/debug.log CHANGED
@@ -2189,3 +2189,290 @@
2189
2189
  BehaviorConfig Create (0.9ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2190
2190
  BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2191
2191
  BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2192
+ SQL (0.2ms) select sqlite_version(*)
2193
+ SQL (0.3ms)  SELECT name
2194
+ FROM sqlite_master
2195
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2196
+ 
2197
+ SQL (2.7ms) DROP TABLE "behavior_configs"
2198
+ SQL (1.8ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2199
+ SQL (0.3ms)  SELECT name
2200
+ FROM sqlite_master
2201
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2202
+ 
2203
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2204
+ SQL (0.2ms) select sqlite_version(*)
2205
+ SQL (0.3ms)  SELECT name
2206
+ FROM sqlite_master
2207
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2208
+ 
2209
+ SQL (1.1ms) DROP TABLE "behavior_configs"
2210
+ SQL (1.0ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2211
+ SQL (0.2ms)  SELECT name
2212
+ FROM sqlite_master
2213
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2214
+ 
2215
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2216
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
2217
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2218
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2219
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2220
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2221
+ BehaviorConfig Update (0.1ms) UPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1
2222
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2223
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2224
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2225
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2226
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2227
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2228
+ BehaviorConfig Load (1.4ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2229
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2230
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2231
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2232
+ BehaviorConfig Create (1.9ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2233
+ BehaviorConfig Load (0.4ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2234
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2235
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2236
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2237
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2238
+ SQL (0.2ms) select sqlite_version(*)
2239
+ SQL (0.2ms)  SELECT name
2240
+ FROM sqlite_master
2241
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2242
+ 
2243
+ SQL (1.2ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2244
+ SQL (0.4ms)  SELECT name
2245
+ FROM sqlite_master
2246
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2247
+ 
2248
+ SQL (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2249
+ SQL (35.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2250
+ SQL (0.4ms)  SELECT name
2251
+ FROM sqlite_master
2252
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2253
+ 
2254
+ SQL (0.2ms) SELECT version FROM "schema_migrations"
2255
+ SQL (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2256
+ SQL (0.4ms) select sqlite_version(*)
2257
+ SQL (0.3ms)  SELECT name
2258
+ FROM sqlite_master
2259
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2260
+ 
2261
+ SQL (1.4ms) DROP TABLE "behavior_configs"
2262
+ SQL (1.9ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2263
+ SQL (0.4ms)  SELECT name
2264
+ FROM sqlite_master
2265
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2266
+ 
2267
+ SQL (0.4ms) SELECT version FROM "schema_migrations"
2268
+ SQL (0.2ms) select sqlite_version(*)
2269
+ SQL (0.3ms)  SELECT name
2270
+ FROM sqlite_master
2271
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2272
+ 
2273
+ SQL (1.4ms) DROP TABLE "behavior_configs"
2274
+ SQL (1.8ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2275
+ SQL (0.2ms)  SELECT name
2276
+ FROM sqlite_master
2277
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2278
+ 
2279
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2280
+ BehaviorConfig Create (0.4ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2281
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2282
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2283
+ BehaviorConfig Update (0.1ms) UPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1
2284
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2285
+ BehaviorConfig Create (0.9ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2286
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2287
+ BehaviorConfig Create (0.4ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2288
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2289
+ BehaviorConfig Create (1.1ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2290
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2291
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2292
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2293
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2294
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2295
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2296
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2297
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2298
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2299
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2300
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
2301
+ BehaviorConfig Load (0.4ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2302
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'options') LIMIT 1
2303
+ SQL (0.2ms) select sqlite_version(*)
2304
+ SQL (0.4ms)  SELECT name
2305
+ FROM sqlite_master
2306
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2307
+ 
2308
+ SQL (2.4ms) DROP TABLE "behavior_configs"
2309
+ SQL (1.3ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2310
+ SQL (0.2ms)  SELECT name
2311
+ FROM sqlite_master
2312
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2313
+ 
2314
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2315
+ SQL (0.2ms) select sqlite_version(*)
2316
+ SQL (0.3ms)  SELECT name
2317
+ FROM sqlite_master
2318
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2319
+ 
2320
+ SQL (1.5ms) DROP TABLE "behavior_configs"
2321
+ SQL (1.3ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2322
+ SQL (0.2ms)  SELECT name
2323
+ FROM sqlite_master
2324
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2325
+ 
2326
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2327
+ SQL (0.2ms) select sqlite_version(*)
2328
+ SQL (0.3ms)  SELECT name
2329
+ FROM sqlite_master
2330
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2331
+ 
2332
+ SQL (1.7ms) DROP TABLE "behavior_configs"
2333
+ SQL (1.5ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2334
+ SQL (0.3ms)  SELECT name
2335
+ FROM sqlite_master
2336
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2337
+ 
2338
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2339
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
2340
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2341
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2342
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2343
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2344
+ BehaviorConfig Update (0.2ms) UPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1
2345
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2346
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2347
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2348
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2349
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2350
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2351
+ BehaviorConfig Load (1.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2352
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2353
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2354
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2355
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2356
+ BehaviorConfig Load (0.5ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2357
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2358
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2359
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2360
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2361
+ SQL (0.3ms) select sqlite_version(*)
2362
+ SQL (0.3ms)  SELECT name
2363
+ FROM sqlite_master
2364
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2365
+ 
2366
+ SQL (2.7ms) DROP TABLE "behavior_configs"
2367
+ SQL (1.5ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2368
+ SQL (0.3ms)  SELECT name
2369
+ FROM sqlite_master
2370
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2371
+ 
2372
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2373
+ SQL (0.2ms) select sqlite_version(*)
2374
+ SQL (0.4ms)  SELECT name
2375
+ FROM sqlite_master
2376
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2377
+ 
2378
+ SQL (1.6ms) DROP TABLE "behavior_configs"
2379
+ SQL (1.3ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2380
+ SQL (0.2ms)  SELECT name
2381
+ FROM sqlite_master
2382
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2383
+ 
2384
+ SQL (0.2ms) SELECT version FROM "schema_migrations"
2385
+ SQL (0.2ms) select sqlite_version(*)
2386
+ SQL (0.5ms)  SELECT name
2387
+ FROM sqlite_master
2388
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2389
+ 
2390
+ SQL (3.2ms) DROP TABLE "behavior_configs"
2391
+ SQL (1.4ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2392
+ SQL (0.2ms)  SELECT name
2393
+ FROM sqlite_master
2394
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2395
+ 
2396
+ SQL (0.2ms) SELECT version FROM "schema_migrations"
2397
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2398
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2399
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2400
+ BehaviorConfig Update (0.1ms) UPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1
2401
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2402
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2403
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2404
+ BehaviorConfig Create (0.4ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2405
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2406
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2407
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2408
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2409
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2410
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2411
+ BehaviorConfig Create (0.3ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2412
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2413
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2414
+ BehaviorConfig Create (0.5ms) INSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')
2415
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) 
2416
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2417
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
2418
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2419
+ SQL (0.2ms) select sqlite_version(*)
2420
+ SQL (0.3ms)  SELECT name
2421
+ FROM sqlite_master
2422
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2423
+ 
2424
+ SQL (2.7ms) DROP TABLE "behavior_configs"
2425
+ SQL (1.3ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2426
+ SQL (0.3ms)  SELECT name
2427
+ FROM sqlite_master
2428
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2429
+ 
2430
+ SQL (0.2ms) SELECT version FROM "schema_migrations"
2431
+ SQL (0.2ms) select sqlite_version(*)
2432
+ SQL (0.4ms)  SELECT name
2433
+ FROM sqlite_master
2434
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2435
+ 
2436
+ SQL (1.9ms) DROP TABLE "behavior_configs"
2437
+ SQL (1.3ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2438
+ SQL (0.3ms)  SELECT name
2439
+ FROM sqlite_master
2440
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2441
+ 
2442
+ SQL (0.2ms) SELECT version FROM "schema_migrations"
2443
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'price') LIMIT 1
2444
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2445
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2446
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2447
+ BehaviorConfig Load (0.2ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2448
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
2449
+ SQL (0.2ms) select sqlite_version(*)
2450
+ SQL (0.3ms)  SELECT name
2451
+ FROM sqlite_master
2452
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2453
+ 
2454
+ SQL (2.8ms) DROP TABLE "behavior_configs"
2455
+ SQL (1.6ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2456
+ SQL (0.3ms)  SELECT name
2457
+ FROM sqlite_master
2458
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2459
+ 
2460
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
2461
+ SQL (0.2ms) select sqlite_version(*)
2462
+ SQL (0.3ms)  SELECT name
2463
+ FROM sqlite_master
2464
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2465
+ 
2466
+ SQL (1.3ms) DROP TABLE "behavior_configs"
2467
+ SQL (1.1ms) CREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) 
2468
+ SQL (0.3ms)  SELECT name
2469
+ FROM sqlite_master
2470
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
2471
+ 
2472
+ SQL (0.8ms) SELECT version FROM "schema_migrations"
2473
+ BehaviorConfig Load (0.3ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'price') LIMIT 1
2474
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1
2475
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1
2476
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1
2477
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1
2478
+ BehaviorConfig Load (0.1ms) SELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1
@@ -15,4 +15,9 @@ describe BehaviorHelper do
15
15
  it "should give me a text area field for text" do
16
16
  behavior_tag('description').should match(/textarea/)
17
17
  end
18
+
19
+ it "should give me a select field for options" do
20
+ behavior_tag('options').should match(/select/)
21
+ behavior_tag('options').should match(/<option value="2">Two<\/option>/)
22
+ end
18
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: behavior
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Campbell
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-08 00:00:00 +00:00
12
+ date: 2010-02-22 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -53,7 +53,7 @@ files:
53
53
  - spec/helpers/behavior_helper_spec.rb
54
54
  - spec/schema.rb
55
55
  - spec/spec_helper.rb
56
- has_rdoc: true
56
+ has_rdoc: false
57
57
  homepage: http://www.github.com/paulca/behavior
58
58
  licenses: []
59
59