00:03
jcarl43 has quit [Quit: WeeChat 2.2]
00:22
knight33 has joined #ruby
00:23
knight33 has quit [Max SendQ exceeded]
00:24
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:25
venmx has quit [Ping timeout: 268 seconds]
00:29
marmotini has joined #ruby
00:30
marmotini_ has quit [Ping timeout: 246 seconds]
00:30
RougeR has joined #ruby
00:38
kurko_ has joined #ruby
00:38
kurko_ has quit [Client Quit]
00:38
kurko_ has joined #ruby
00:39
kurko_ has quit [Client Quit]
00:39
kurko_ has joined #ruby
00:40
kurko_ has quit [Client Quit]
00:40
kurko_ has joined #ruby
00:40
kurko_ has quit [Client Quit]
00:41
kurko_ has joined #ruby
00:41
kurko_ has quit [Client Quit]
00:42
kurko_ has joined #ruby
00:42
kurko_ has quit [Client Quit]
00:43
kurko_ has joined #ruby
00:43
kurko_ has quit [Client Quit]
00:43
dviola has joined #ruby
00:47
wojnar has joined #ruby
01:03
akaiiro has quit [Remote host closed the connection]
01:04
dviola has quit [Quit: WeeChat 2.2]
01:04
zwliew has joined #ruby
01:05
donofrio_ has quit [Remote host closed the connection]
01:05
donofrio_ has joined #ruby
01:09
SeepingN has quit [Quit: The system is going down for reboot NOW!]
01:11
AJA4350 has quit [Quit: AJA4350]
01:15
Bacteria has quit [Quit: Lost terminal]
01:16
xfbs has quit [Quit: afk]
01:16
orbyt_ has joined #ruby
01:29
eckhardt has joined #ruby
01:32
patr0clus has joined #ruby
01:44
joast has quit [Quit: Leaving.]
01:46
akem has quit [Ping timeout: 252 seconds]
01:48
pskosinski has quit [Ping timeout: 268 seconds]
01:48
cagomez has joined #ruby
01:50
pskosinski has joined #ruby
01:52
joast has joined #ruby
01:53
Dimik has joined #ruby
01:54
lightstalker has quit [Remote host closed the connection]
01:57
dinfuehr has quit [Ping timeout: 272 seconds]
01:57
dviola has joined #ruby
01:58
dinfuehr has joined #ruby
02:00
lightstalker has joined #ruby
02:08
DTZUZO_ has quit [Ping timeout: 245 seconds]
02:08
cliluw has quit [Read error: Connection reset by peer]
02:10
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:10
cliluw has joined #ruby
02:15
Fusl has quit [Read error: Connection reset by peer]
02:16
wojnar has quit [Remote host closed the connection]
02:17
Fusl has joined #ruby
02:21
arescorpio has joined #ruby
02:26
apparition has joined #ruby
02:29
<
JasonO >
hello, I am trying to seed some data using rake. however, I receive the following error:
02:30
<
JasonO >
rake aborted!
02:30
<
JasonO >
NameError: uninitialized constant DeliveryPerson
02:30
<
JasonO >
db/seeds.rb:2:in `<top (required)>'
02:30
<
JasonO >
my models are accurate as well. any help would be appreciated
02:39
patr0clus has quit [Ping timeout: 244 seconds]
02:40
fluxAeon has joined #ruby
02:41
BTRE has quit [Remote host closed the connection]
02:42
patr0clus has joined #ruby
02:42
patr0clus is now known as s3nd1v0g1us
02:43
<
JasonO >
anyone here?
02:43
<
JasonO >
I am trying to seed some data using rake. however, I receive the following error:
02:43
<
JasonO >
db/seeds.rb:2:in `<top (required)>'
02:43
<
JasonO >
my models are accurate as well. any help would be appreciated
02:45
BTRE has joined #ruby
02:48
dviola has quit [Quit: WeeChat 2.2]
02:51
s3nd1v0g1us has quit [Ping timeout: 252 seconds]
02:53
s3nd1v0g1us has joined #ruby
02:54
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
03:03
noobineer has joined #ruby
03:05
def_jam has joined #ruby
03:05
eb0t_ has joined #ruby
03:05
braincrash has quit [Quit: bye bye]
03:05
s3nd1v0g1us has quit [Remote host closed the connection]
03:06
za1b1tsu has joined #ruby
03:06
eblip has quit [Ping timeout: 250 seconds]
03:07
eb0t has quit [Ping timeout: 246 seconds]
03:09
braincrash has joined #ruby
03:13
apparition has joined #ruby
03:13
zwliew has quit [Quit: Connection closed for inactivity]
03:16
nadir has joined #ruby
03:18
hahuang6- has joined #ruby
03:20
hahuang65 has quit [Ping timeout: 276 seconds]
03:28
MoritaShinobu has joined #ruby
03:31
KeyJoo has joined #ruby
03:32
<
JasonO >
figured it out
03:34
Dimik has quit [Ping timeout: 244 seconds]
03:52
qolq has quit [Read error: Connection reset by peer]
03:52
qolq has joined #ruby
04:00
mangold has joined #ruby
04:03
KeyJoo has quit [Read error: Connection reset by peer]
04:11
eckhardt has joined #ruby
04:21
orbyt_ has joined #ruby
04:26
za1b1tsu has quit [Quit: WeeChat 2.1]
04:36
mangold has quit [Quit: This computer has gone to sleep]
04:40
xuanrui has joined #ruby
04:43
johnny56 has quit [Ping timeout: 272 seconds]
04:43
cagomez has quit [Remote host closed the connection]
04:43
kurko_ has joined #ruby
04:43
cagomez has joined #ruby
04:44
kurko_ has quit [Client Quit]
04:44
kurko_ has joined #ruby
04:44
kurko_ has quit [Client Quit]
04:45
kurko_ has joined #ruby
04:45
kurko_ has quit [Client Quit]
04:46
kurko_ has joined #ruby
04:46
kurko_ has quit [Client Quit]
04:47
kurko_ has joined #ruby
04:47
kurko_ has quit [Client Quit]
04:47
kurko_ has joined #ruby
04:48
kurko_ has quit [Client Quit]
04:52
tdy has quit [Ping timeout: 245 seconds]
04:56
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:56
cagomez has quit [Remote host closed the connection]
04:56
za1b1tsu has joined #ruby
05:00
_whitelogger has joined #ruby
05:15
johnny56 has joined #ruby
05:16
arescorpio has quit [Quit: Leaving.]
05:20
gnufied has quit [Ping timeout: 246 seconds]
05:20
xuanrui has quit [Remote host closed the connection]
05:22
ua has quit [Ping timeout: 252 seconds]
05:24
cliluw has quit [Read error: Connection reset by peer]
05:36
petemoore has quit [Ping timeout: 276 seconds]
05:36
vdl has quit [Ping timeout: 272 seconds]
05:38
RougeR has quit [Ping timeout: 272 seconds]
05:39
reber has joined #ruby
05:39
petemoore has joined #ruby
05:40
leonthemisfit has quit [Ping timeout: 272 seconds]
05:42
leonthemisfit has joined #ruby
05:42
vdl has joined #ruby
05:51
segy has joined #ruby
05:57
eckhardt_ has joined #ruby
05:58
jetchisel has joined #ruby
06:05
rippa has joined #ruby
06:05
kapil____ has joined #ruby
06:05
venmx has joined #ruby
06:05
mangold has joined #ruby
06:06
dellavg_ has joined #ruby
06:06
endemic has quit [Ping timeout: 264 seconds]
06:09
noobineer has quit [Ping timeout: 252 seconds]
06:13
doubledup has joined #ruby
06:18
segy has quit [Read error: Connection reset by peer]
06:18
petemoore has quit [Ping timeout: 250 seconds]
06:21
petemoore has joined #ruby
06:22
segy has joined #ruby
06:31
whysthatso has quit [Quit: whysthatso]
06:32
eckhardt_ has joined #ruby
06:34
LiftLeft has quit [Ping timeout: 260 seconds]
06:36
eckhardt_ has quit [Client Quit]
06:38
apparition has quit [Quit: Bye]
06:42
eckhardt_ has joined #ruby
06:47
LiftLeft has joined #ruby
06:50
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:52
marmotini has quit [Ping timeout: 244 seconds]
07:01
apparition has joined #ruby
07:03
venmx has quit [Ping timeout: 272 seconds]
07:05
rwb has quit [Ping timeout: 252 seconds]
07:10
tdy has joined #ruby
07:11
whysthatso has joined #ruby
07:12
chorler has joined #ruby
07:13
vondruch has quit [Quit: vondruch]
07:13
vondruch has joined #ruby
07:14
petemoore has quit [Ping timeout: 252 seconds]
07:15
mangold has quit [Quit: This computer has gone to sleep]
07:16
petemoore has joined #ruby
07:27
xuanrui has joined #ruby
07:28
za1b1tsu has quit [Ping timeout: 252 seconds]
07:43
GodFather has quit [Read error: Connection reset by peer]
07:56
sameerynho has joined #ruby
07:58
vondruch has quit [Quit: vondruch]
07:59
vondruch has joined #ruby
07:59
vondruch has quit [Client Quit]
08:00
vondruch has joined #ruby
08:00
GodFather has joined #ruby
08:01
doubledup has quit [Quit: Leaving]
08:10
phaul has joined #ruby
08:12
doubledup has joined #ruby
08:12
doubledup has quit [Remote host closed the connection]
08:23
venmx has joined #ruby
08:27
ellcs has joined #ruby
08:33
ellcs has quit [Ping timeout: 252 seconds]
08:38
chorler has left #ruby ["Konversation terminated!"]
08:40
apeiros_ has quit [Remote host closed the connection]
08:43
mikecmpbll has quit [Quit: inabit. zz.]
08:48
discopatrick has quit [Quit: Connection closed for inactivity]
08:48
kurko_ has joined #ruby
08:48
kurko_ has quit [Client Quit]
08:49
kurko_ has joined #ruby
08:49
jetchisel has quit [Ping timeout: 246 seconds]
08:49
kurko_ has quit [Client Quit]
08:50
kurko_ has joined #ruby
08:50
kurko_ has quit [Client Quit]
08:51
kurko_ has joined #ruby
08:51
kurko_ has quit [Client Quit]
08:51
Nicmavr has quit [Read error: Connection reset by peer]
08:51
kurko_ has joined #ruby
08:52
kurko_ has quit [Client Quit]
08:53
kurko_ has joined #ruby
08:53
kurko_ has quit [Client Quit]
08:53
Nicmavr has joined #ruby
08:54
kurko_ has joined #ruby
08:54
kurko_ has quit [Client Quit]
08:54
kurko_ has joined #ruby
08:55
kurko_ has quit [Client Quit]
08:55
kurko_ has joined #ruby
08:55
kurko_ has quit [Client Quit]
08:57
wojnar has joined #ruby
09:00
snickers has joined #ruby
09:05
RougeR has joined #ruby
09:31
nadir has quit [Quit: Connection closed for inactivity]
09:53
rubydoc has quit [Remote host closed the connection]
09:54
Fusl has quit [Ping timeout: 256 seconds]
09:54
rubydoc has joined #ruby
09:54
<
phaul >
&ri http_default_port
09:55
<
phaul >
Now everything is linked from core & stdlib.
09:56
<
phaul >
also everything is searchable
09:56
<
phaul >
&list %HTTP::%
09:56
<
rubydoc >
Net::HTTP::Copy (net/http), Net::HTTP::Delete (net/http), Net::HTTP::Get (net/http), Net::HTTP::Head (net/http), Net::HTTP::Lock (net/http), Net::HTTP::Mkcol...
09:57
konsolebox has joined #ruby
10:00
lxsameer has joined #ruby
10:03
za1b1tsu has joined #ruby
10:05
venmx has quit [Ping timeout: 272 seconds]
10:06
lxsameer has quit [Ping timeout: 268 seconds]
10:08
za1b1tsu has quit [Ping timeout: 252 seconds]
10:12
mikecmpbll has joined #ruby
10:14
mangold has joined #ruby
10:18
konsolebox has quit [Read error: Connection reset by peer]
10:21
Fusl has joined #ruby
10:22
venmx has joined #ruby
10:24
kapil____ has quit [Quit: Connection closed for inactivity]
10:25
za1b1tsu has joined #ruby
10:29
ur5us has joined #ruby
10:33
ur5us has quit [Ping timeout: 244 seconds]
10:43
mangold has quit [Quit: This computer has gone to sleep]
10:47
mikecmpbll has quit [Quit: inabit. zz.]
10:48
apeiros_ has joined #ruby
10:52
jetchisel has joined #ruby
10:53
def_jam is now known as eblip
10:56
desperek has joined #ruby
10:57
jetchisel has quit [Ping timeout: 250 seconds]
11:04
themsay has joined #ruby
11:15
nowhere_man has quit [Ping timeout: 252 seconds]
11:26
<
JasonO >
hello, I am creating am method to assign a random number to a value when iterating. however, I want to break out of the loop then resume to ensure all elements have different values. how can i do this?
11:26
<
JasonO >
break didn't help
11:31
Hobbyboy has quit [Quit: I think the BNC broke.]
11:31
apeiros_ has joined #ruby
11:31
armyriad has joined #ruby
11:31
Eiam has quit [Read error: Connection reset by peer]
11:31
Hobbyboy has joined #ruby
11:31
evdubs_ has joined #ruby
11:31
<
apeiros_ >
JasonO: paraphrasing: you want to generate an array with N distinct random numbers?
11:31
apeiros_ has quit [Read error: Connection reset by peer]
11:31
evdubs_ has quit [Remote host closed the connection]
11:31
armyriad has quit [Read error: Connection reset by peer]
11:31
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:31
snk has quit [Ping timeout: 260 seconds]
11:31
<
phaul >
n.times.entries.shuffle
11:32
snk has joined #ruby
11:32
<
apeiros_ >
`n.times.entries` can be shortened to `[*0...n]`
11:33
<
apeiros_ >
and it assumes the pool of numbers is 0...N, but it might be unrelated to the size of the resulting array.
11:33
<
apeiros_ >
(i.e. an array of 20 elements with random values 100..200)
11:34
mangold has joined #ruby
11:35
<
JasonO >
apeiros_ phaul something like this
https://repl.it/repls/YouthfulGreenyellowCharactermapping nothing with arrays. I want to assign random ids to each user while iterating. but if I iterate at once all users will get the same random number. I need a way to break and continue so this does not happen
11:36
<
apeiros_ >
eh, gotta go. boarding starts. cya :)
11:36
apeiros_ has quit []
11:38
xfbs has joined #ruby
11:38
<
phaul >
so why don't you move random_post_office = ... into the loop.
11:39
<
phaul >
There is an other issue: I think you are iterating counter * counter times
11:40
<
phaul >
why do you need the double nested loops?
11:42
nadir has joined #ruby
11:43
<
phaul >
don't put your local variables into the class scope. It's legal and valid, but it doesn't do what you think it does.
11:44
<
phaul >
The local var name inside the class does not propagate into the methods defined with def
11:45
kapil____ has joined #ruby
11:46
<
JasonO >
okay I'll move them
11:48
<
phaul >
post what you have so far
11:48
<
JasonO >
oops, forgot index
11:49
<
JasonO >
nice. it worked!
11:49
<
JasonO >
just needed the index
11:49
<
JasonO >
thanks phaul \
11:49
<
phaul >
&ri Array#rand
11:49
<
rubydoc >
Found no entry that matches class Array instance method rand
11:49
<
JasonO >
*thanks phaul
11:50
<
phaul >
&ri Array.sample
11:50
<
rubydoc >
Found no entry that matches class Array class method sample
11:50
<
phaul >
&ri Array#sample
11:51
<
JasonO >
aah. okay I'll use sample so no need for ikndex
11:51
<
phaul >
sad thing is that its my own bot :D
11:52
Tempesta has quit [Ping timeout: 268 seconds]
11:52
tbuehlmann has quit [Ping timeout: 252 seconds]
11:53
tbuehlmann has joined #ruby
11:54
AJA4350 has joined #ruby
11:55
Inline has quit [Quit: Leaving]
11:56
Inline has joined #ruby
12:12
nowhere_man has joined #ruby
12:15
Puffball has quit [Remote host closed the connection]
12:22
Puffball has joined #ruby
12:25
za1b1tsu has quit [Ping timeout: 246 seconds]
12:47
nowhere_man has quit [Ping timeout: 252 seconds]
12:56
kurko_ has joined #ruby
12:56
kurko_ has quit [Client Quit]
12:57
kurko_ has joined #ruby
12:57
kurko_ has quit [Client Quit]
12:57
za1b1tsu has joined #ruby
12:58
kurko_ has joined #ruby
12:58
kurko_ has quit [Client Quit]
12:58
kurko_ has joined #ruby
12:58
themsay has quit [Ping timeout: 268 seconds]
12:59
kurko_ has quit [Client Quit]
12:59
kurko_ has joined #ruby
12:59
kurko_ has quit [Client Quit]
13:00
kurko_ has joined #ruby
13:00
kurko_ has quit [Client Quit]
13:01
kurko_ has joined #ruby
13:01
kurko_ has quit [Client Quit]
13:03
mangold has quit [Quit: This computer has gone to sleep]
13:04
marmotini_ has joined #ruby
13:33
ule has quit [Quit: WeeChat 1.9.1]
13:41
mikecmpbll has joined #ruby
13:44
Dbugger has joined #ruby
13:46
jetchisel has joined #ruby
13:47
marmotini_ has quit [Ping timeout: 252 seconds]
13:47
Dimik has joined #ruby
13:50
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
13:52
DTZUZO has joined #ruby
13:58
wojnar has quit [Remote host closed the connection]
14:00
jetchisel has joined #ruby
14:04
ta_ has joined #ruby
14:09
Dbugger has quit [Ping timeout: 276 seconds]
14:09
discopatrick has joined #ruby
14:40
oleo2 has joined #ruby
14:48
oleo2 has quit [Ping timeout: 260 seconds]
14:49
oleo2 has joined #ruby
14:53
apparition has quit [Quit: Bye]
14:57
marmotini_ has joined #ruby
14:58
desperek has quit [Read error: Connection reset by peer]
15:01
phaul has quit [Quit: bye]
15:01
phaul has joined #ruby
15:04
venmx has quit [Ping timeout: 246 seconds]
15:12
marmotini_ has quit [Ping timeout: 252 seconds]
15:13
ule has joined #ruby
15:14
marmotini_ has joined #ruby
15:15
xfbs has quit [Quit: afk]
15:24
kapil____ has quit [Quit: Connection closed for inactivity]
15:38
fluxAeon has quit [Ping timeout: 246 seconds]
15:41
houhoulis has joined #ruby
15:44
al2o3-cr has quit [Quit: WeeChat 2.2]
15:45
al2o3-cr has joined #ruby
15:46
marmotini_ has quit [Ping timeout: 252 seconds]
15:46
sticaz has joined #ruby
15:54
marmotini_ has joined #ruby
15:56
rivalomega has joined #ruby
16:08
Yxhuvud has quit [Remote host closed the connection]
16:09
dcope has joined #ruby
16:15
Yxhuvud has joined #ruby
16:17
RougeR has quit [Ping timeout: 245 seconds]
16:19
dcope has left #ruby [#ruby]
16:20
Dbugger has joined #ruby
16:22
venmx has joined #ruby
16:31
MoritaShinobu has quit [Remote host closed the connection]
16:58
akaiiro has joined #ruby
17:01
armyriad has quit [Quit: Leaving]
17:02
Yxhuvud has quit [Remote host closed the connection]
17:02
kurko_ has joined #ruby
17:02
kurko_ has quit [Client Quit]
17:03
Yxhuvud has joined #ruby
17:03
kurko_ has joined #ruby
17:03
kurko_ has quit [Client Quit]
17:04
kurko_ has joined #ruby
17:04
kurko_ has quit [Client Quit]
17:05
MoritaShinobu has joined #ruby
17:05
kurko_ has joined #ruby
17:06
kurko_ has quit [Client Quit]
17:06
uplime has quit [Ping timeout: 252 seconds]
17:14
orbyt_ has joined #ruby
17:15
MoritaShinobu has quit [Quit: Leaving]
17:18
za1b1tsu has quit [Ping timeout: 246 seconds]
17:21
akaiiro has quit [Remote host closed the connection]
17:22
akaiiro has joined #ruby
17:24
whysthatso_ has joined #ruby
17:26
whysthatso has quit [Ping timeout: 260 seconds]
17:26
whysthatso_ is now known as whysthatso
17:34
whysthatso has quit [Quit: whysthatso]
17:35
whysthatso has joined #ruby
17:35
bdnelson has joined #ruby
17:36
bdnelson has quit [Client Quit]
17:37
rkoller has joined #ruby
17:37
akaiiro has quit [Ping timeout: 252 seconds]
17:38
phaul has quit [Quit: bye]
17:39
phaul has joined #ruby
17:41
DTZUZO has quit [Ping timeout: 245 seconds]
17:43
armyriad has joined #ruby
17:45
uplime has joined #ruby
17:50
marmotini has joined #ruby
17:54
marmotini_ has quit [Ping timeout: 268 seconds]
18:11
nadir has quit [Quit: Connection closed for inactivity]
18:19
snickers has joined #ruby
18:25
rivalomega has quit [Read error: Connection reset by peer]
18:25
rivalomega has joined #ruby
18:28
marmotini has quit [Ping timeout: 260 seconds]
18:33
tdy has quit [Ping timeout: 252 seconds]
18:36
jackrandom has joined #ruby
18:40
Yxhuvud has quit [Remote host closed the connection]
18:41
Yxhuvud has joined #ruby
18:46
rivalomega has quit [Read error: Connection reset by peer]
18:46
rivalomega has joined #ruby
18:49
GodFather has quit [Ping timeout: 272 seconds]
19:01
GodFather has joined #ruby
19:01
marmotini has joined #ruby
19:02
Dbugger has quit [Remote host closed the connection]
19:08
jasmith has quit [Ping timeout: 244 seconds]
19:10
im0nde has quit [Ping timeout: 252 seconds]
19:15
Dbugger has joined #ruby
19:17
oleo2 has quit [Ping timeout: 252 seconds]
19:20
RougeR has joined #ruby
19:21
marmotini has quit [Ping timeout: 252 seconds]
19:23
patr0clus has joined #ruby
19:24
im0nde has joined #ruby
19:25
patr0clus is now known as s3nd1vog1us
19:25
s3nd1vog1us is now known as s3nd1v0g1us
19:28
discopatrick has quit [Quit: Connection closed for inactivity]
19:30
troulouliou_dev has joined #ruby
19:33
oleo2 has joined #ruby
19:41
oleo2 has quit [Ping timeout: 260 seconds]
19:45
djellemah has quit [Remote host closed the connection]
19:54
Fusl has quit [Ping timeout: 256 seconds]
19:55
jiffe has joined #ruby
19:58
Fusl has joined #ruby
20:00
nowhere_man has joined #ruby
20:05
RougeR has quit [Ping timeout: 244 seconds]
20:10
ua has joined #ruby
20:16
RougeR has joined #ruby
20:20
weaksauce has joined #ruby
20:21
cd has quit [Quit: cd]
20:24
cd has joined #ruby
20:25
tdy has joined #ruby
20:33
dinfuehr_ has joined #ruby
20:33
dinfuehr has quit [Ping timeout: 268 seconds]
20:36
apeiros_ has joined #ruby
20:40
Dbugger has quit [Ping timeout: 264 seconds]
20:41
<
jiffe >
so I am trying to get a ruby application [
https://github.com/Mpompili/vibesky ] going. I'm not familiar with ruby atm, but I was able to run through the setup which installed dependencies and created the necessary database. Running rails server I am able to get what looks like the api going, but I'm not sure how to get the frontend going which looks like it also runs through ruby
20:42
nowhere_man has quit [Ping timeout: 264 seconds]
20:42
<
jiffe >
I can find the associated html, but I'm not sure what needs to be done to expose it, I don't know if anyone sees anything obvious that I'm missing
20:47
c-c has joined #ruby
20:48
<
c-c >
I have a mind-effing case-when problem, involving a string split into an array + call to a function from one when block.
20:49
<
c-c >
- For some reason I can p the arr[1] inside the when, but passing it as an argument to another method from inside the when statement causes an error --> proggy dies
20:49
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:49
<
phaul >
c-c: easiest way to describe it is to show us code
20:51
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:52
<
phaul >
topic these days suggests dpaste.de but gist.github is also fine. Channel bot will tell you off for pastebin. But honestly, whatever you are more familiar with
20:52
<
c-c >
- when making the paste, I noticed the method was declared outside the class
20:52
bak1an has joined #ruby
20:53
<
c-c >
I usually use gist. Anyway, so found the problem: code blindness. Thank you
21:00
s3nd1v0g1us has quit [Ping timeout: 252 seconds]
21:00
dellavg_ has quit [Ping timeout: 246 seconds]
21:02
s3nd1v0g1us has joined #ruby
21:04
uplime is now known as Frankenstein
21:04
<
jiffe >
so I created a new rail, its listening on port 3000 and I see 'Yay! You’re on Rails!', trying to grep for that title in the created directory I don't see it anywhere, where does that come from?
21:08
icarus has joined #ruby
21:09
houhoulis has quit [Remote host closed the connection]
21:09
<
jiffe >
ah nm found it in a global template directory
21:10
<
icarus >
hello all, I have an endpoint that needs a post request (IE, curl --data '{"example":"data"}'), is anyone familiar with out to do this with httparty?
21:11
<
icarus >
with curl, this looks like: curl --data '{"example":"data"}' $url
21:11
<
icarus >
same for httparty via cli: httparty --data '{"example":"data"}' $url
21:17
ur5us has joined #ruby
21:19
sticaz has quit [Quit: sticaz]
21:22
<
icarus >
ah screw it, im just going to hard code `httparty --data '{"example":"data"}' $url`, yolo
21:22
ur5us has quit [Ping timeout: 264 seconds]
21:22
<
c-c >
so "return if in_str == nil" errors, but "return if in_str==nil" doesn't?
21:24
<
c-c >
but "p in_str == nil" does not error?
21:26
whysthatso has quit [Quit: whysthatso]
21:26
<
baweaver >
c-c: what's the error?
21:27
<
c-c >
well the thing is I have the code running in a separate proc so I can't see the error (and thats why I'm confused)
21:28
<
c-c >
- All I see is the prog dying (it kills all procs if one fails)
21:29
<
c-c >
And, please note that my question 6 minutes before isn't correct, error was caused by something else
21:36
fredlinhares has joined #ruby
21:38
<
c-c >
kewl, is that the tokenizer?
21:44
cagomez has joined #ruby
21:47
<
c-c >
-even the read_line_nonblocking has to check for nil twice
21:48
<
c-c >
Any ideas how to avoid that in read_pipes (the method in the gist)
21:48
<
phaul >
well...maybe monad springs to mind :)
21:50
<
phaul >
there is &. inruby
21:50
<
c-c >
monads in ruby?
21:50
cagomez has quit [Remote host closed the connection]
21:50
<
phaul >
I seen implementations.. but &. would be my first try
21:51
orbyt_ has joined #ruby
21:51
<
c-c >
hm, I don't remember seeing "&.", how to use it?
21:52
<
c-c >
oh, its an operator
21:54
<
baweaver >
easy there
21:54
<
baweaver >
monads are overkill.
21:54
<
c-c >
hm, I think monads won't happen in my little game enginde
21:54
<
phaul >
we 3 are all agree
21:54
troulouliou_dev has quit [Quit: Leaving]
21:55
<
baweaver >
That's most of the reason I made Qo was to pipe input conditionally without breaking out of a flow
21:55
<
phaul >
rly? Can you show us a snippet?
21:56
<
phaul >
I never imagined Qo can do that
21:56
kurko_ has joined #ruby
21:56
<
baweaver >
One sec, let me adapt to their code.
21:59
<
c-c >
So what I always get from read_line is nil, or a string key-value (separated by " "). So unless its a nil, it should be string, split by " ", and then case applied to [0].
21:59
dviola has joined #ruby
21:59
<
phaul >
read_line&.split(' ')
22:01
<
baweaver >
It's a bit silly with the debug pipe on it, but general idea is I use it to control dispatch much like a case statement
22:02
<
baweaver >
except with some more fine grained controls. It's be more useful if there were partial message matches or other factors.
22:02
<
c-c >
baweaver: whats 'Qo'?
22:02
<
baweaver >
Pattern matching and fluent querying in Ruby
22:03
<
baweaver >
people.select(&Qo[name: /^B/, age: 10..])
22:05
<
phaul >
baweaver: is the double m.when(Qo.not(nil)) intentional in the first block?
22:05
<
baweaver >
I suppose it's redundant
22:06
<
phaul >
I don't know :) I don't understand you code :)
22:06
<
baweaver >
that makes two of us
22:07
icarus has quit [Read error: Connection reset by peer]
22:07
icarus has joined #ruby
22:10
nadir has joined #ruby
22:15
<
c-c >
I guess what I want to do is: if (msg=read_something_that_hopefully_isnt_nil).split(" ") { # do stuff with known non-nil array }
22:16
<
c-c >
Is that ugly? 8)
22:16
<
c-c >
suggest alternative syntax for this?
22:16
<
phaul >
read_something&.split(' ')&.yield_self { |obj| obj ... }
22:17
<
phaul >
it might be rough around the edges.. let me try if it works :)
22:17
s3nd1v0g1us has quit [Ping timeout: 252 seconds]
22:18
<
phaul >
this worked 'alma korte'&.split(' ')&.yield_self { |alma, korte| p alma: alma, korte: korte }
22:18
<
phaul >
with nil it's just nil
22:19
<
phaul >
the former works too..
22:20
<
phaul >
but obj is the array of the pair..
22:20
themsay has joined #ruby
22:21
<
c-c >
>> def read_sim(arg=nil); return arg; end; read_sim("CMDstr FOOBAR")&.split(' ')&.yield_self {|o| p o} && read_sim()&.split(' ')&.yield_self {|o| p o }
22:21
<
ruby[bot] >
c-c: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
22:21
reber has quit [Remote host closed the connection]
22:22
<
phaul >
the site the bot is using is broken
22:22
<
c-c >
weird, my irb responds undefined method 'yield_self'
22:22
<
phaul >
ah. you are on old ruby
22:22
<
baweaver >
2.5 intro'd it didn't it?
22:22
<
c-c >
ok, I'm on 2.3.3p222
22:23
<
c-c >
so much peeve
22:24
<
c-c >
- I have to test to for nil!
22:24
themsay has quit [Ping timeout: 244 seconds]
22:29
<
phaul >
you can suffix condition on the unhappy path... msg = read; return if msg.nil?; .... that way it's just 1 line and no end
22:33
<
c-c >
yeah have stuff like msg = rwe[0][0].gets.strip unless rwe == nil || rwe[0][0] == nil
22:34
<
c-c >
- which will fail if that returns nil
22:37
<
phaul >
actually updated the gist . with &.tap it looks almost... good :)
22:38
<
phaul >
but I broke the funtion return value :( if you care about that
22:39
<
phaul >
I assume @msg_stack.push wasn't returning anything useful anyway
22:42
<
phaul >
surely not it was in an if with no else case...
22:43
apeiros_ has quit []
22:43
<
c-c >
So, this works: msg = rwe[0][0] unless rwe == nil || rwe[0][0] == nil -- but rwe[0][0].gets.strip doesn't!
22:43
<
c-c >
its as if it ecals the strip before the unless
22:44
<
phaul >
c-c: have you seen my fork of your gist?
22:45
<
phaul >
what do you think?
22:45
<
c-c >
was struggling ther for 10 minutes with new syntax bugs
22:46
<
c-c >
aw, my ruby doesn't support &.
22:46
<
phaul >
that's a bummer :)
22:48
<
c-c >
ah well, I'll have to accept that
22:49
<
phaul >
my best is the revision before that then. still it shaves off a few lines
22:51
mangold has joined #ruby
22:52
<
c-c >
Its like I have set nil or test for nil on every 2nd line all the time
22:53
dviola has quit [Quit: WeeChat 2.2]
22:54
<
phaul >
c-c: at least msg = nil lines are redundant
22:54
<
phaul >
I also posted a revision that should work on 2.3 before the &.tap revision..
22:57
blackmesa has joined #ruby
22:58
<
c-c >
interestingly &.split seems to work.. I think
22:58
dviola has joined #ruby
22:58
venmx has quit [Ping timeout: 260 seconds]
23:01
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:04
mikecmpbll has quit [Quit: inabit. zz.]
23:05
<
phaul >
c-c: if &.split works then every method works with &. even tap. What was the issue you had exactly?
23:06
<
c-c >
having to constantly ensure the wahtever is not nil
23:07
<
phaul >
no I mean with the code I posted on my gist
23:07
<
phaul >
you said you had syntax issues
23:07
<
lupine >
so don't return nil
23:07
<
phaul >
can you post them?
23:08
<
c-c >
In fact this whole thing is "fragile" when I wanted it to just sit and run even if nothing is read
23:08
<
lupine >
aww, `undef nil` doesn't work :D
23:10
rivalomega has quit [Remote host closed the connection]
23:10
rivalomega has joined #ruby
23:11
jetchisel has quit [Ping timeout: 272 seconds]
23:12
fredlinhares has quit [Ping timeout: 240 seconds]
23:13
icarus has quit [Ping timeout: 252 seconds]
23:15
rivalomega has quit [Ping timeout: 264 seconds]
23:19
leah2 has quit [Ping timeout: 244 seconds]
23:19
mikecmpbll has joined #ruby
23:20
pharma_joe has joined #ruby
23:20
pharma_joe has quit [Client Quit]
23:23
hightower2 has quit [Ping timeout: 252 seconds]
23:23
raulp has joined #ruby
23:23
leah2 has joined #ruby
23:25
fredlinhares has joined #ruby
23:37
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:39
<
c-c >
Ok finally managed to fix the regression
23:41
<
c-c >
this seems bit exessive, given the input is always of format "VERB NOUN"
23:42
<
c-c >
- And I'm still not sure if read_line_nonblocking might return something funny when msg == nil
23:45
<
phaul >
as you seem to be completely ignoring my comments on this I am out..
23:46
<
c-c >
phaul thanks for input. I'm sorry but your comment on removing nils didnt seem to work, as "&."
23:47
<
phaul >
│235413 phaul | c-c: at least msg = nil lines are redundant
23:47
<
c-c >
yup, thats incorrect
23:48
Frankenstein has quit [Ping timeout: 250 seconds]
23:48
<
phaul >
000550 phaul | c-c: if &.split works then every method works with &. even tap. What was the issue you had │ bga57
23:48
<
phaul >
│ | exactly? y
23:49
<
c-c >
yeah, haven't managed to remove single nil yet
23:49
cd has quit [Quit: cd]
23:50
<
c-c >
I think this whole boat needs to be turned around
23:50
<
phaul >
I'm well aware. I posted something. You said it didn't work because &. Then you said &. works. Then I asked what was the error then
23:51
<
c-c >
well, stuff breaks if not watching out for nil explicitly in every turn
23:51
sameerynho has quit [Ping timeout: 272 seconds]
23:52
<
phaul >
my code was supposed to be functionally equivalent to yours. with all the ifs.
23:52
mroutis has joined #ruby
23:52
<
phaul >
I did not just post something where I just removed checks
23:53
<
phaul >
I can make an other attempt at rewriting your code. the newest gist. If you say it works at its current form.
23:55
<
c-c >
I think this whole thing is somehow wrong
23:57
<
c-c >
The basic concept is a process reading input stream, store lines in msg_stack - unless none, then read the msg_stack to see what to do with state
23:58
<
phaul >
it's a relly great video, and he solves this exact problem.