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 +4 -0
- data/README.md +9 -0
- data/Rakefile +1 -1
- data/app/helpers/behavior_helper.rb +10 -3
- data/behavior.gemspec +3 -2
- data/config/behavior.yml +10 -1
- data/spec/behavior_generator_spec.rb +1 -1
- data/spec/behavior_spec.rb +1 -1
- data/spec/debug.log +287 -0
- data/spec/helpers/behavior_helper_spec.rb +5 -0
- metadata +3 -3
data/CHANGELOG
CHANGED
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
@@ -1,8 +1,15 @@
|
|
1
1
|
module BehaviorHelper
|
2
2
|
|
3
3
|
def behavior_tag(conf)
|
4
|
-
|
5
|
-
|
6
|
-
|
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.
|
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-
|
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
data/spec/behavior_spec.rb
CHANGED
@@ -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
|
[4;35;1mBehaviorConfig Create (0.9ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2190
2190
|
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2191
2191
|
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2192
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2193
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2194
|
+
FROM sqlite_master
|
2195
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2196
|
+
[0m
|
2197
|
+
[4;36;1mSQL (2.7ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2198
|
+
[4;35;1mSQL (1.8ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2199
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2200
|
+
FROM sqlite_master
|
2201
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2202
|
+
[0m
|
2203
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2204
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2205
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2206
|
+
FROM sqlite_master
|
2207
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2208
|
+
[0m
|
2209
|
+
[4;36;1mSQL (1.1ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2210
|
+
[4;35;1mSQL (1.0ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2211
|
+
[4;36;1mSQL (0.2ms)[0m [0;1m SELECT name
|
2212
|
+
FROM sqlite_master
|
2213
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2214
|
+
[0m
|
2215
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2216
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
2217
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2218
|
+
[4;36;1mBehaviorConfig Create (0.5ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2219
|
+
[4;35;1mBehaviorConfig Load (0.3ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2220
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2221
|
+
[4;35;1mBehaviorConfig Update (0.1ms)[0m [0mUPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1[0m
|
2222
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2223
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2224
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2225
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2226
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2227
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2228
|
+
[4;36;1mBehaviorConfig Load (1.4ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2229
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2230
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2231
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2232
|
+
[4;36;1mBehaviorConfig Create (1.9ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2233
|
+
[4;35;1mBehaviorConfig Load (0.4ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2234
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2235
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2236
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2237
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2238
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2239
|
+
[4;35;1mSQL (0.2ms)[0m [0m SELECT name
|
2240
|
+
FROM sqlite_master
|
2241
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2242
|
+
[0m
|
2243
|
+
[4;36;1mSQL (1.2ms)[0m [0;1mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2244
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2245
|
+
FROM sqlite_master
|
2246
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2247
|
+
[0m
|
2248
|
+
[4;36;1mSQL (2.3ms)[0m [0;1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2249
|
+
[4;35;1mSQL (35.2ms)[0m [0mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
2250
|
+
[4;36;1mSQL (0.4ms)[0m [0;1m SELECT name
|
2251
|
+
FROM sqlite_master
|
2252
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2253
|
+
[0m
|
2254
|
+
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2255
|
+
[4;36;1mSQL (1.5ms)[0m [0;1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
2256
|
+
[4;35;1mSQL (0.4ms)[0m [0mselect sqlite_version(*)[0m
|
2257
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2258
|
+
FROM sqlite_master
|
2259
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2260
|
+
[0m
|
2261
|
+
[4;35;1mSQL (1.4ms)[0m [0mDROP TABLE "behavior_configs"[0m
|
2262
|
+
[4;36;1mSQL (1.9ms)[0m [0;1mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2263
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2264
|
+
FROM sqlite_master
|
2265
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2266
|
+
[0m
|
2267
|
+
[4;36;1mSQL (0.4ms)[0m [0;1mSELECT version FROM "schema_migrations"[0m
|
2268
|
+
[4;35;1mSQL (0.2ms)[0m [0mselect sqlite_version(*)[0m
|
2269
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2270
|
+
FROM sqlite_master
|
2271
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2272
|
+
[0m
|
2273
|
+
[4;35;1mSQL (1.4ms)[0m [0mDROP TABLE "behavior_configs"[0m
|
2274
|
+
[4;36;1mSQL (1.8ms)[0m [0;1mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2275
|
+
[4;35;1mSQL (0.2ms)[0m [0m SELECT name
|
2276
|
+
FROM sqlite_master
|
2277
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2278
|
+
[0m
|
2279
|
+
[4;36;1mSQL (0.1ms)[0m [0;1mSELECT version FROM "schema_migrations"[0m
|
2280
|
+
[4;35;1mBehaviorConfig Create (0.4ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2281
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2282
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2283
|
+
[4;36;1mBehaviorConfig Update (0.1ms)[0m [0;1mUPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1[0m
|
2284
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2285
|
+
[4;36;1mBehaviorConfig Create (0.9ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2286
|
+
[4;35;1mBehaviorConfig Load (0.3ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2287
|
+
[4;36;1mBehaviorConfig Create (0.4ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2288
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2289
|
+
[4;36;1mBehaviorConfig Create (1.1ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2290
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2291
|
+
[4;36;1mBehaviorConfig Create (0.3ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2292
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2293
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2294
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2295
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2296
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2297
|
+
[4;36;1mBehaviorConfig Create (0.3ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2298
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2299
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2300
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
2301
|
+
[4;36;1mBehaviorConfig Load (0.4ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2302
|
+
[4;35;1mBehaviorConfig Load (0.3ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'options') LIMIT 1[0m
|
2303
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2304
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2305
|
+
FROM sqlite_master
|
2306
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2307
|
+
[0m
|
2308
|
+
[4;36;1mSQL (2.4ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2309
|
+
[4;35;1mSQL (1.3ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2310
|
+
[4;36;1mSQL (0.2ms)[0m [0;1m SELECT name
|
2311
|
+
FROM sqlite_master
|
2312
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2313
|
+
[0m
|
2314
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2315
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2316
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2317
|
+
FROM sqlite_master
|
2318
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2319
|
+
[0m
|
2320
|
+
[4;36;1mSQL (1.5ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2321
|
+
[4;35;1mSQL (1.3ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2322
|
+
[4;36;1mSQL (0.2ms)[0m [0;1m SELECT name
|
2323
|
+
FROM sqlite_master
|
2324
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2325
|
+
[0m
|
2326
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2327
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2328
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2329
|
+
FROM sqlite_master
|
2330
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2331
|
+
[0m
|
2332
|
+
[4;36;1mSQL (1.7ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2333
|
+
[4;35;1mSQL (1.5ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2334
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2335
|
+
FROM sqlite_master
|
2336
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2337
|
+
[0m
|
2338
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2339
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
2340
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2341
|
+
[4;36;1mBehaviorConfig Create (0.5ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2342
|
+
[4;35;1mBehaviorConfig Load (0.3ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2343
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2344
|
+
[4;35;1mBehaviorConfig Update (0.2ms)[0m [0mUPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1[0m
|
2345
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2346
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2347
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2348
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2349
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2350
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2351
|
+
[4;36;1mBehaviorConfig Load (1.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2352
|
+
[4;35;1mBehaviorConfig Create (0.5ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2353
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2354
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2355
|
+
[4;36;1mBehaviorConfig Create (0.3ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2356
|
+
[4;35;1mBehaviorConfig Load (0.5ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2357
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2358
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2359
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2360
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2361
|
+
[4;36;1mSQL (0.3ms)[0m [0;1mselect sqlite_version(*)[0m
|
2362
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2363
|
+
FROM sqlite_master
|
2364
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2365
|
+
[0m
|
2366
|
+
[4;36;1mSQL (2.7ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2367
|
+
[4;35;1mSQL (1.5ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2368
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2369
|
+
FROM sqlite_master
|
2370
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2371
|
+
[0m
|
2372
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2373
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2374
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2375
|
+
FROM sqlite_master
|
2376
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2377
|
+
[0m
|
2378
|
+
[4;36;1mSQL (1.6ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2379
|
+
[4;35;1mSQL (1.3ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2380
|
+
[4;36;1mSQL (0.2ms)[0m [0;1m SELECT name
|
2381
|
+
FROM sqlite_master
|
2382
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2383
|
+
[0m
|
2384
|
+
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2385
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2386
|
+
[4;35;1mSQL (0.5ms)[0m [0m SELECT name
|
2387
|
+
FROM sqlite_master
|
2388
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2389
|
+
[0m
|
2390
|
+
[4;36;1mSQL (3.2ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2391
|
+
[4;35;1mSQL (1.4ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2392
|
+
[4;36;1mSQL (0.2ms)[0m [0;1m SELECT name
|
2393
|
+
FROM sqlite_master
|
2394
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2395
|
+
[0m
|
2396
|
+
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2397
|
+
[4;36;1mBehaviorConfig Create (0.5ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2398
|
+
[4;35;1mBehaviorConfig Load (0.3ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2399
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2400
|
+
[4;35;1mBehaviorConfig Update (0.1ms)[0m [0mUPDATE "behavior_configs" SET "value" = 'joe@putplace.com' WHERE "id" = 1[0m
|
2401
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2402
|
+
[4;35;1mBehaviorConfig Create (0.5ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2403
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2404
|
+
[4;35;1mBehaviorConfig Create (0.4ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2405
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2406
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2407
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2408
|
+
[4;35;1mBehaviorConfig Create (0.3ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2409
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2410
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2411
|
+
[4;36;1mBehaviorConfig Create (0.3ms)[0m [0;1mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2412
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2413
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2414
|
+
[4;35;1mBehaviorConfig Create (0.5ms)[0m [0mINSERT INTO "behavior_configs" ("value", "key") VALUES('paul@rslw.com', 'email_address')[0m
|
2415
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."id" = 1) [0m
|
2416
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2417
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
2418
|
+
[4;35;1mBehaviorConfig Load (0.2ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2419
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2420
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2421
|
+
FROM sqlite_master
|
2422
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2423
|
+
[0m
|
2424
|
+
[4;36;1mSQL (2.7ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2425
|
+
[4;35;1mSQL (1.3ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2426
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2427
|
+
FROM sqlite_master
|
2428
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2429
|
+
[0m
|
2430
|
+
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2431
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2432
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2433
|
+
FROM sqlite_master
|
2434
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2435
|
+
[0m
|
2436
|
+
[4;36;1mSQL (1.9ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2437
|
+
[4;35;1mSQL (1.3ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2438
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2439
|
+
FROM sqlite_master
|
2440
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2441
|
+
[0m
|
2442
|
+
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2443
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'price') LIMIT 1[0m
|
2444
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2445
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2446
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2447
|
+
[4;36;1mBehaviorConfig Load (0.2ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2448
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
2449
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2450
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2451
|
+
FROM sqlite_master
|
2452
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2453
|
+
[0m
|
2454
|
+
[4;36;1mSQL (2.8ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2455
|
+
[4;35;1mSQL (1.6ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2456
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2457
|
+
FROM sqlite_master
|
2458
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2459
|
+
[0m
|
2460
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2461
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2462
|
+
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
2463
|
+
FROM sqlite_master
|
2464
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2465
|
+
[0m
|
2466
|
+
[4;36;1mSQL (1.3ms)[0m [0;1mDROP TABLE "behavior_configs"[0m
|
2467
|
+
[4;35;1mSQL (1.1ms)[0m [0mCREATE TABLE "behavior_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" varchar(255)) [0m
|
2468
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2469
|
+
FROM sqlite_master
|
2470
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2471
|
+
[0m
|
2472
|
+
[4;35;1mSQL (0.8ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2473
|
+
[4;36;1mBehaviorConfig Load (0.3ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'price') LIMIT 1[0m
|
2474
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_name') LIMIT 1[0m
|
2475
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'value') LIMIT 1[0m
|
2476
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'email_address') LIMIT 1[0m
|
2477
|
+
[4;36;1mBehaviorConfig Load (0.1ms)[0m [0;1mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'description') LIMIT 1[0m
|
2478
|
+
[4;35;1mBehaviorConfig Load (0.1ms)[0m [0mSELECT * FROM "behavior_configs" WHERE ("behavior_configs"."key" = 'password') LIMIT 1[0m
|
@@ -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.
|
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-
|
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:
|
56
|
+
has_rdoc: false
|
57
57
|
homepage: http://www.github.com/paulca/behavior
|
58
58
|
licenses: []
|
59
59
|
|