-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_example_suggested_para.rb
74 lines (58 loc) · 3.1 KB
/
add_example_suggested_para.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require './local_sequel'
name = "The adventure(s) of Tommy Genericname"
firstpara = <<END
Once upon a time, there was a manish boy named Tommy Jenericnaem. He lived a long full life, and died of old age at 87 with a smile on his face. As per his will, he was buried in the ground without a coffin, and he slowly degraded, and became part of the grass around him. Later, this grass was eaten by a cow, who was slaughtered, and the beef produced was then put on a truck and driven to That Store Around The Corner, where Mommy Genericname was 'shopping' one fine day.
Mommy pushed her cart around the corner, her feet pounding against the linelium. She had to win this race, she just HAD to. Her honour depended on --
"AAHH!" *crash*
/Oh dear, not again./ She had crashed into the meat stand, AGAIN.
"You're gonna pay for that!"
"Okay..." She payed for the perfectly fine meat that she had apparently ruined, figuring she'd make dinner with it tonight. Her racing adventures over, Mommy walked back to the car with her beef, and drove home.
...
"Bleh, what is this stuff?" spat 24-year-old Tommy Genericname.
"Did you put spinach in it again? I feel like I'm getting stronger"
END
puts 'loaded'
authid = DB[:users].where(:user => "shelvacu").first[:id]
nameid = DB[:names].insert(:auth => authid,
:name => name,
:upvotes => makearray,
:downvotes => makearray,
:fin => false)
puts 'got author id'
chapsid = makearray
pparas = makearray
bookid = DB[:books].insert(:auth => authid,
:chaps => chapsid,
:endvotes => makearray,
:noendvotes => makearray,
:pparas => makearray,
:fin => false,
:pnames => makearray,
:name => nameid)
puts 'inserted book'
parasid = makearray
puts 'is it getarray()?'
paras = getarray(parasid)
puts 'NOO!'
chap1 = DB[:chaps].insert(:name => 'Chapter 1',
:paras => parasid)
puts 'made chapter'
getarray(chapsid).insert(:val => chap1)
para = DB[:paras].insert(:auth => authid,
:an => "I don't even know man, it was just, whatever came to my head.",
:text => firstpara,
:upvotes => makearray,
:downvotes => makearray)
puts 'made para'
paras.insert(:val => para)
puts 'inserted para'
puts "almost done!"
getarray(pparas).insert(:val => DB[:paras].insert(:auth => authid,
:an => "the 'youre' instead of 'your' is on purpose, so i can test the edit feature",
:text => '
"OH MY GOD!!" screamed Mommy, "YOU\'RE MUSCLES!"
"What are you--WBLAH!"
Tommy slowly realized that his muscles were bigger than normal human beings. He had begun to wonder why the table and his mother had gotten so small',
:upvotes => makearray,
:downvotes => makearray))
puts "I /think/ it's done, but i have NO idea."