kspencer

Activity Graph

Page 1 of 3 | Next »

2019-04-22

[20:55:07] kspencer: Ping timeout: 264 seconds
[21:42:38] kspencer: Excess Flood
[21:42:38] kspencer: has joined #ruby
[22:01:49] kspencer: has joined #ruby
[22:19:39] kspencer: has joined #ruby
[22:19:44] kspencer: Excess Flood

2019-04-13

[00:13:19] kspencer: Ping timeout: 252 seconds
[00:36:59] kspencer: has joined #ruby
[00:40:28] kspencer: Excess Flood
[00:41:21] kspencer: has joined #ruby
[16:50:15] kspencer: *.net *.split

2019-03-22

[04:33:08] kspencer: Ping timeout: 268 seconds
[04:36:42] kspencer: has joined #ruby

2019-02-27

[14:10:49] kspencer: has joined #ruby

2018-12-19

[21:20:04] kspencer: Which yes, I do know is not a bug, but a feature of 2.5.* but is a bug with the documentation documents. Just letting more people know
[21:20:04] kspencer: But the documentation for Struct asks you to use a 'Customer' constant, which in affected versions of ruby will raise a Dynamic Constant Assignment Error
[21:20:04] kspencer: So I'm pretty sure someone has already noticed this, but ruby-doc.org/core-2.5.*/Struct.html (I did put an asterisk in there because it affects 2.5.0-2.5.3)
[21:22:11] kspencer: right, but why show an example of it, if its going to cause an exception
[21:25:32] kspencer: https://dpaste.de/Xkvo
[21:29:27] kspencer: https://dpaste.de/ipEc
[21:29:33] kspencer: lines 11-24
[21:31:16] kspencer: my problem is not with the code I have, its that the docs say its allowed in 2.5 when its not, before with 2.3 i'd get a warning but with 2.5 I'm getting an exception, with the docs, that's a bit of a issue when it says it would be allowed and not saying anything about it causing an exception
[21:35:40] kspencer: https://dpaste.de/Boz2
[21:37:50] kspencer: pretty sure in 2.3 you'd get a warning but it would still work
[21:38:51] kspencer: I only have 2.5.3 on my computer
[21:39:32] kspencer: and I don't use rvm or anything because it causes me too many problems with scope when i want something to use the full user etc.
[21:40:07] kspencer: i may checkout chruby then
[21:42:41] kspencer: will chruby play nice with rubymine?

2018-11-28

[00:26:08] kspencer: Is there a easy way to basically turn url endpoints into chained attributes?
[00:33:42] kspencer: Not so much an issue as it is an inconvenience, I basically want to turn GET api.site.tld/node/endpoint into STATE.get.node.endpoint(args)

2018-11-03

[21:11:40] kspencer: I'm subclassing TCPSocket to add irc commands and such, since the IRC frameworks I usually use have bugs I want to avoid, and so I was wondering what the best way to encapsulate the while True ... data = @sock.sysread(...) # run code on data ... end
[21:14:23] kspencer: cinch mostly, which when the bot gets opered it hangs
[21:17:59] kspencer: should I extend TCPSocket then
[21:19:22] kspencer: like i said, when cinch gets opered and modes are added to it, it hangs
[21:21:05] kspencer: If it didn't hang on oper I'd be using it
[21:22:43] kspencer: did it get server notice masks added to it?
[21:29:04] kspencer: <dominikh> nobody is fixing anything, for Cinch has no maintainer
[21:38:02] kspencer: so 'class IRCSocket; extend Forwardable; def initialize; @sock = TCPSocket; end; def_delegators @sock, :connect; end'
[21:41:29] kspencer: and then what would the best way of encapsulating the socket loop be
[21:48:10] kspencer: you mean like setting user and nick in initialize and channel joining by method etc kind of stuff
[22:07:08] kspencer: hmm actually i might grab leejarvis/ircsocket and go from there, just saw that
[22:08:58] kspencer: irc-socket rather

2018-08-31

[20:54:50] kspencer: has joined #ruby

2018-08-29

[01:49:07] kspencer: *.net *.split

2018-08-19

[23:29:25] kspencer: has anyone ever messed around with talkd and using ruby to interface with it, because I'm getting the urge to and I want to know if any has aver thought of it

2018-07-30

[12:46:27] kspencer: Has anyone else noticed that the cert for ruby-lang.org has been getting rejected since its for lists.ruby-lang.org

2018-07-20

[00:07:10] kspencer: *.net *.split
[00:15:45] kspencer: has joined #ruby

2018-06-20

[03:50:30] kspencer: Ping timeout: 276 seconds
[06:10:05] kspencer: has joined #ruby
[06:20:20] kspencer: Ping timeout: 256 seconds

2018-06-11

[21:13:22] kspencer: zenspider: AltGr+0
[21:15:27] kspencer: how bout qwerty so you can type like a human
[21:18:44] kspencer: whats your aversion to qwerty
[21:20:54] kspencer: sucks, objective, but yeah I guess I'm on the other boat, I've typed in qwerty all my life, not wanting to go dvorak or azerty because it would be hell trying to learn it and switch between it depending on the computer

2018-06-02

[22:02:56] kspencer: in psych, is there a way to declare the root node or any node as a specific class and have ruby recognize that? I want the node to be an Array/sequence, everything I try doesn't seem to work, and I basically want a yaml->ruby conversion to output [] instead of nil
[22:03:45] kspencer: I want to be able to Array.push into it, but so far no go on anything

2018-06-01

[03:44:47] kspencer: *.net *.split
[07:47:36] kspencer: has joined #ruby

2018-05-29

[02:47:14] kspencer: *.net *.split
[02:48:01] kspencer: has joined #ruby

2018-05-19

[15:33:50] kspencer: Remote host closed the connection
[15:38:11] kspencer: has joined #ruby

2018-05-06

[12:53:47] kspencer: has joined #ruby

2018-04-25

[12:26:01] kspencer: *.net *.split
[12:27:29] kspencer: has joined #ruby
[15:01:32] kspencer: *.net *.split
[15:03:12] kspencer: has joined #ruby

2018-04-17

[03:02:41] kspencer: I use rubymine <3
[03:03:37] kspencer: never understood the difference between neovim and regular vim

2018-04-16

[18:57:50] kspencer: I have code where a webhook receiver is catching x-gitlab-event, x-github-event, and x-gogs-event, and to differentiate and be 'error-proof' I want to make sure only one of them ever returns anything other than nil, basically making them 'there can only be one', if x-github-event and x-gitlab-event exist, then the request should 400 telling the user there is more than one event defined
[18:58:31] kspencer: the goes for any combination of the three
[19:02:57] kspencer: https://github.com/IotaSpencer/site_hook/blob/dev/lib/site_hook.rb#L106-L181
[21:42:02] kspencer: I kinda figured it out, using Enumerable.one?
[22:46:10] kspencer: havenwood: https://bugs.ruby-lang.org/issues/13683#note-11

2018-03-20

[08:30:15] kspencer: Ping timeout: 256 seconds
[08:32:29] kspencer: has joined #ruby

2018-03-13

[16:50:22] kspencer: I've got a thor class and a Sinatra::Base subclass in separate files but are in the same gem, I want to be able to pass in the command line options or at least set some settings in the server to be able to pull from at runtime, but I'm not seeing a way to do it without mudding up my code
[16:51:19] kspencer: tldr how can i pass in some variables into a Sinatra::Base subclass server before its initialized and started, and when its in another file
[16:58:38] kspencer: Code here -> https://github.com/IotaSpencer/site_hook/tree/dev the thor subclass is in bin/site_hook, and the sinatra::base subclass is in lib/site_hook.rb
[17:02:18] kspencer: although i may be able to set some module variables, I'll see if that works

2018-03-05

[14:57:35] kspencer: Ping timeout: 276 seconds
[15:16:15] kspencer: why not use #rubyonrails

2018-03-02

[04:11:02] kspencer: Ping timeout: 245 seconds
[05:01:26] kspencer: has joined #ruby
[21:23:48] kspencer: best way to check if a certain directory (specifically '$HOME/.local/bin') is in the $PATH
[21:23:59] kspencer: any one have any ideas?
[21:31:40] kspencer: did find this way, paths = [];ENV['PATH'].split(':').each { |path| paths << Pathname(path) }
[21:32:13] kspencer: though that may not be very platform independent
[21:35:27] kspencer: although I kinda want to cut out the << bit but can't think how, I want to say map could do it.. but not to sure on classes
[22:05:46] kspencer: qyliss: thanks for that, though i'm having another problem, I'm unsure how to have my script check if PATH contains that path, providing that it seems since I have it set in .profile, but yet when it grabs the list, that directory isn't in there, though I assume that's due to how ENV pulls its variables (shell wise)
[22:06:58] kspencer: bundler i guess, bundler exec gem-executable
[22:09:26] kspencer: qyliss: its in ruby -e "puts ENV['PATH']"
[22:10:02] kspencer: bundle exec ruby -e ...?
[22:11:33] kspencer: qyliss: its in there too o_O

2018-02-28

[23:16:22] kspencer: Read error: Connection reset by peer
[23:17:10] kspencer: has joined #ruby
[23:17:59] kspencer: Max SendQ exceeded
[23:18:43] kspencer: has joined #ruby

2018-02-27

[12:44:33] kspencer: requiring 'rubygems/package' is less taboo in a gem than regular 'rubygems' correct?
[12:48:41] kspencer: i'm trying make a script that downloads a tar.gz file and unzips it for you and rubygems/package is the only updated non-shell-out that I can find, and I want to make sure I'm not breaking the 'don't require rubygems in code' bit
[12:51:51] kspencer: so basically no need to require, just use Gem::Package::TarReader
[12:52:55] kspencer: that answers my question, thanks a bunch
[12:56:00] kspencer: no, in the script I've already downloaded the tar.gz, but I'm unzipping it after its downloaded
[14:03:52] kspencer: hmm so far I'm just getting GzipFile errors when I try to unzip the tar.gz file
[14:06:15] kspencer: https://gist.github.com/IotaSpencer/d9da017b7d41df781df3c833bc0e43cf
[14:08:05] kspencer: I've tried with both 'w' and 'wb' in the open() block
[14:15:35] kspencer: I can download the file otherwise just fine, but once I try it with ruby it breaks
[14:16:35] kspencer: if I download it via chrome it works fine extracting, but downloading via ruby with the code i have is erroring out with that such error
[14:18:25] kspencer: but there you go, stacktrace is added to the gist
[14:23:54] kspencer: would you rather I have said 'I am getting Zlib::GzipFile::Error' when x
[14:24:42] kspencer: nor does it in the code because of bundler
[14:26:47] kspencer: although v1.4.0, so that the gsub works
[14:27:31] kspencer: i can give you my gemspec instead
[14:28:43] kspencer: what are you running atm
[14:31:00] kspencer: dminuoso: gist updated with gemspec
[14:33:35] kspencer: by below you mean the unzipping and just open the file with a text editor
[14:35:56] kspencer: I feared that, thanks for pointing me in the right direction

2018-02-26

[19:30:07] kspencer: what would the best way be if I'm trying to bundle a gem and also run a curl command to download 'micro' (a nano-like text editor with gui-editor-like extensibility) for use by the gem
[19:31:58] kspencer: i'm distributing the binary from the curl command for micro
[19:33:41] kspencer: as I've already gotten permission from the owner of micro to bundle it with it, thankfully
[19:35:43] kspencer: i'm actually going this route 'https://getmic.ro/' and I'm hoping to make and move the binary to the user's bin directory
[19:35:52] kspencer: using fileutils
[19:37:19] kspencer: I mean I probably could, to be honest, but then the other thing is how to make it run immediately after gem install or bundle install
[19:38:16] kspencer: so rake install and rake install-micro perhaps?
[19:38:56] kspencer: or even override the regular install to run them both at the 'same' time
[19:44:41] kspencer: hmm I could bundle the micro install script as a executable in the gemspec providing I port it to ruby, that way I have people run x then y, then you're good
[21:43:30] kspencer: havenwood: I'm actually porting the getmic.ro script to ruby within a gem, and adding a dependency to my other gem for it, then having a post_install_message let the user know, and also putting checks in my own code to check to see if its installed in the correct directory

2018-02-23

[18:44:47] kspencer: *.net *.split

2018-02-19

[15:58:26] kspencer: I'm seeing alot of varied information about this, but if I want to write tests, what is it I should be doing in terms of gem files and vcs files, from what I read I should have a source_code_uri metadata entry, spec.files should exclude test-like directories, and I should be pushing tests to a vcs, but just the gem library itself + needed other files like Gemfile, LICENSE to rubygems.org or other gemcutter-compatible gem repository
[16:09:48] kspencer: well, I've also been looking, and my gem is a thor + highline CLI app, and I've also been wondering what the best course of action is with making tests, I see many different ways, although I'm currently trying out is https://github.com/dergachev/rspec-tutorial/tree/master/spec
[16:10:25] kspencer: apeiros: yes but then there's also the https://github.com/rubygems/rubygems/issues/735
[16:11:03] kspencer: aka 'test files should not be installed'
[16:11:48] kspencer: I've not seen many minitest with cli's though so I can't say I'd have any luck with that out of the box
[16:12:29] kspencer: I don't see many cli's with minitest testing, unless I'm looking in the wrong place
[16:14:55] kspencer: My code may be a mess, but if I could properly make that distinction, I'll send you the gh repo if that's alright? apeiros
[16:16:24] kspencer: https://github.com/IotaSpencer/mkmatter/tree/dev
[16:22:50] kspencer: workmad3: Thor (the gem I'm using for the #start method) allows you to create an instance of your 'App' without running it using #new, as #start will run everything
[16:23:54] kspencer: so how should I go about creating a test for say the outputs or should I test for status on some and regex and success on others
[16:30:21] kspencer: I'll see what I can do with this but I'm not too sure how to go from here

2018-02-16

[23:04:37] kspencer: if someone who has used thor more than me, is there a way to prompt a user to pick between subcommands when they only give the parent command e.g. they gave 'script parent' instead of 'script parent child', the no_commands block doesn't seem to be working in that way nor does adding it as a default command as far as i've seen
[23:15:19] kspencer: yeah so tefa, try #haskell
[23:16:56] kspencer: ACTION waits for an answer to his question, though its kinda scrolled up so I'll post it again
[23:17:35] kspencer: if someone who has used thor more than me has an idea, is there a way to prompt a user to pick between subcommands when they only give the parent command e.g. they gave 'script parent' instead of 'script parent child', the no_commands block doesn't seem to be working in that way nor does adding it as a default command as far as i've seen
[23:25:19] kspencer: also somehow answered my own question, idk why but before it wasn't showing the help, but now it does, i remembered it is supposed to output help if there is no default command
[23:45:12] kspencer: use method(arguments)?
[23:46:11] kspencer: eg def update_wallet(currency, target_currency) ... end
[23:48:47] kspencer: then I'd probably have it send a hash that you put {target: x, primary: y}
[23:49:08] kspencer: or something similar
[23:49:27] kspencer: I'm basically brainstorming along with you
[23:51:48] kspencer: and basically run some if ... elsif ... else ... end to check if both were given, none were given (would most likely error out), and one or the other were given
[23:52:45] kspencer: and validation if need be
[23:53:15] kspencer: although you can kinda build that into else

2018-01-20

[22:05:50] kspencer: *.net *.split
[22:06:28] kspencer: has joined #ruby
[23:27:20] kspencer: Does anyone know of a markdown linter that can be used easily inside code, instead of using it as a shell command, I'd like to lint markdown given as input, but can't find any libraries where thats easily accessible, mdl/markdownlint are both 99% just used as a executable, and i don't see an easy entry point

2018-01-17

[18:07:32] kspencer: so I see a '->(var)' in a peice of code I'm looking at, and I don't know what it is
[18:15:30] kspencer: havenwood: apeiros thanks, yeah once i heard lambda I figured out what it was

2017-12-27

[19:13:37] kspencer: Read error: Connection reset by peer
[19:44:53] kspencer: has joined #ruby

2017-12-12

[14:56:18] kspencer: this may sound a bit weird, but if I create a file that i 'require' that has classes like Sequel Models, and require them into Cinch plugins, that's completely fine and valid use of them right?
[14:59:27] kspencer: yeah, its more because I want to have valid paths from each class or constant and not have to use $vars in all my code :|

2017-12-01

[02:28:42] kspencer: has joined #ruby

2017-11-28

[11:33:06] kspencer: has joined #ruby

2017-10-06

[02:12:37] kspencer: Ping timeout: 255 seconds

2017-09-28

[18:32:25] kspencer: has joined #ruby

2017-09-09

[18:54:41] kspencer: umm, would there be a reason why there is no AF_INET when there is a AF_INET6, I'm trying to filter ip addresses based on family using IPAddr and I can't really do that if Socket doesn't have INET(4)

2017-08-28

[19:13:20] kspencer: anyone here used sequel?
[19:14:30] kspencer: dminuoso: did you have problems with loads of sleeping db connections?

2017-08-03

[05:16:56] kspencer: Ping timeout: 255 seconds
[05:18:34] kspencer: has joined #ruby

2017-07-26

[09:49:01] kspencer: Quit: ZNC 1.6.3+deb1 - http://znc.in
[09:50:09] kspencer: Excess Flood
[09:50:09] kspencer: has joined #ruby
[09:50:27] kspencer: has joined #ruby

2017-07-18

[17:12:04] kspencer: I'm trying to conditionally either return a given string if it doesn't have a newline, or return only the string upto the first \n then cut the rest, but currently its just clearing out the line, I currently have 'some string'.lines[0].chomp!, but that kinda kills the line when it doesn't have a newline,so I'm trying to figure a really easy to do that
[17:12:58] kspencer: use case being commit messages
[17:29:50] kspencer: I see, I'll a change of that out then

2017-06-28

[11:31:37] kspencer: How can I add my ~/.gem/... path to the ruby load path? As I'm looking and only seeing how to add 'lib' directories, not user gem directories

2017-06-21

[15:56:46] kspencer: for those that have used yard markup, is there a way because html entities and using \[ is not working
[15:56:56] kspencer: a way to escape [*
[16:10:50] kspencer: for those that have used yard markup, is there a way to escape [], so it doesn't make links, because html entities or using \[ is not working, trying to document a query parameter 'domain[id]'
[16:13:18] kspencer: patarr: like Class.varible?
[16:14:40] kspencer: as far as I know :: is module variables
[16:15:32] kspencer: but its @var in class scope, VAR in module scope
[16:16:17] kspencer: although I might be wrong
[16:16:21] kspencer: let me check

2017-06-20

[00:17:25] kspencer: *.net *.split
[00:23:01] kspencer: has joined #ruby

2017-06-17

[15:19:05] kspencer: Ping timeout: 246 seconds

2017-06-16

[11:50:47] kspencer: when you use begin->rescue, is it a bug that my begin code still totally runs even with an exception, or is there a way for it to abort right when it tries to run, as I'm running a db operation and I'm checking for whether there is already a record in the database, but all the code is getting ran instead of just the insert->which should then cause the 'duplicate entry' exception, and run my rescue code (Using
[11:50:50] kspencer: Sequel which exception is Sequel::UniqueConstraintViolation)
[14:25:49] kspencer: when you use begin->rescue, is it a bug that my begin code still totally runs even with an exception, or is there a way for it to abort right when it tries to run, as I'm running a db operation and I'm checking for whether there is already a record in the database, but all the code is getting ran instead of just the insert->which should then cause the 'duplicate entry' exception, and run my rescue code (Using
[14:25:52] kspencer: Sequel which exception is Sequel::UniqueConstraintViolation)
[14:30:10] kspencer: i'll have to pastebin it later, as i need to get back to work.
[18:00:06] kspencer: adam12: https://paste.ofcode.org/5cLibcJftaXXV9qT9cJfWG
[18:07:49] kspencer: ivanskie: well we don't know your problem without you posting it
[18:08:55] kspencer: :| I was just about to say we're not mind readers, as its a general thing that's said in help channels when people ask to ask
[18:09:22] kspencer: imgur or lightshot
[18:18:48] kspencer: https://paste.ofcode.org/5cLibcJftaXXV9qT9cJfWG <-- here's my problem if anyones got any ideas on why all code in the begin (the insert is anticipated to raise Sequel::UniqueConstraintViolation when there is already the same ip in the database) and all the code in the rescue is ran, which means my log returns empty fields, and runs the Log#import Log#dupe and Log#db functions (which write templated log lines)
[18:28:46] kspencer: adam12: there's 2 that are in the rescue clause, all 3 run even when I've deleted the rows
[18:29:51] kspencer: l2f.dupe and l2f.db are both loggers
[18:36:29] kspencer: even if there is no duplicates (DELETE FROM table WHERE `column` LIKE '127.%'; before checking) and then import the ips, the whole begin and the whole rescue clause run, instead of tripping up on just the insert and raising the exception
[18:38:05] kspencer: so when there are no duplicates, it runs the insert and Log.import() yet also runs the rescue clause for each address
[18:45:22] kspencer: ACTION claps
[18:48:50] kspencer: adam12: any headway?
[18:51:07] kspencer: thanks adam12
[20:14:38] kspencer: Id like some gems to pay off my student loans
[20:17:48] kspencer: Zarthus: I've only got 1300ish a few gems should take care of it

2017-06-15

[19:35:49] kspencer: confused on why I'm getting an 'incompatible library version' for the mysql gem, I know it says 'incompatible' but I don't see any other versions of the libmysqlclient-dev
[19:41:42] kspencer: welp lets stop the app and see if it works
[19:50:07] kspencer: I'm also rvm it seems, does that do anything different?

2017-06-07

[11:41:37] kspencer: has joined #ruby
[11:41:37] kspencer: Changing host
[21:29:25] kspencer: Ping timeout: 240 seconds

2017-05-24

[00:22:11] kspencer: for some reason nothing works when trying to verify github signatures, I have no clue whats wrong, and have followed all documentation to the best of my ability
[00:23:11] kspencer: signature = "sha1=#{OpenSSL::HMAC.hexdigest('sha1', token, request.body.read)}"
[00:26:28] kspencer: havenwood: I'm doing webhooks, I'm 99% sure I don't need to gist .gitconfig (granted I didn't say webhook before sorry)
[00:29:36] kspencer: havenwood: Well I'm having to use ruby's openssl library to compare the sha1+hmac signatures
[00:29:59] kspencer: I've already sent them a message
[00:32:38] kspencer: :| GitHub's Webhook payloads to endpoints that have 'secrets' are hashed behind a hmac+sha1, otherwise I have to go by IP for github, and secret for gitlab
[00:40:32] kspencer: havenwood: GitHub's Webhook payloads are sent with a header hashed behind a hmac+sha1 'X-Hub-Signature: sha1=dsd4f56sdf465dsf64sd', otherwise I have to go by IP for github, and secret for gitlab
[02:14:27] kspencer: havenwood: :| my problem was '\n' in part of it, so i had to .chomp
[02:15:39] kspencer: per github support email

2017-05-23

[05:40:55] kspencer: Unexpected error while processing request: undefined method `bytesize' for [...]:Array
[05:41:11] kspencer: I'm stumped currently on why this is happening
[05:42:19] kspencer: I don't have 'bytesize' on anything connected to it, but I also don't get a line to go to either
[05:50:06] kspencer: https://gist.github.com/IotaSpencer/310cc1084b232e557251000fef473049#file-girc-rb-L99-L138
[23:36:39] kspencer: for some reason nothing works when trying to verify github signatures, I have no clue whats wrong, and have followed all documentation to the best of my ability

2017-05-09

[14:17:39] kspencer: /var/lib/gems/2.3.0/gems/cinch-2.3.3/lib/cinch/irc.rb:101:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (OpenSSL::SSL::SSLError)
[14:18:06] kspencer: actually this should go in cinch, sorry