fredlinhares has quit [Read error: Connection reset by peer]
fredlinhares has joined #ruby
jhass|off is now known as jhass
Inline has joined #ruby
<weaksauce>
congrats wannadance
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #ruby
goldfish has joined #ruby
<adam12>
wannadance: nice!
<adam12>
wannadance: I've been working on my own app for something like 10 years too. It's rediculous. But I spend at least 50% of my time consulting for others, and have launched apps for them... in fareness.
darkxploit has joined #ruby
husam212 has joined #ruby
<husam212>
Hi, I'm wondering how can I make class be called like a method? For example String(1) will convert the integer 1 to a string "1"
justache is now known as justBOOMER
<adam12>
husam212: Define it on Kernel is one way.
<adam12>
husam212: Alternatively, if you're OK with square brackets, you can define self.[] on the class.
<adam12>
module Kernel; def YourMethod(args);
<adam12>
I prefer the square bracket notation as it's a bit cleaner.
random-jellyfish has quit [Ping timeout: 256 seconds]
<apple-corps>
Hello, I'm using rspec tests around logstash and the logstash/dev-utils ruby gem. I'm trying to get a debugger attached or perhaps first log to standard out so I can try to understand the logstash / dev-utils and ruby testing framework. I have yet been able to get logging messages via a logging library or puts when executing the rspec tests.
<apple-corps>
Similarly I have not yet been able to make a debugger work. I am wondering if anyone would try to help work with me towards this solution before I give in.
<apple-corps>
So I guess a good place to start would be to look for assistance for the logging. I would expect that to be the easiest thing to do,
<apple-corps>
So my first goal is to write some logging to STD out interlaced with the rspec output so I can get a handle on the testing setup. I will try this again but I'm intimidated by the ruby world
<apple-corps>
So do any folks know a good way to write logs from an rspec test / ruby test?
<weaksauce>
have you tried "require 'pry'; binding.pry"
<apple-corps>
Not yet. I was going to try that when I got to the debugging. I was trying to make logging work. But I can try that now. I think one problem I have is managing gems. It's very difficult for me working with the logstash / jruby setup. I started using docker containers because I was having trouble setting up locally on the mac. Let me go this route
<apple-corps>
I've also explored using https://github.com/cameronkerrnz/logstash-plugin-dev but I haven't been successful in triggering the rspec tests from that container. But I think it's Dockerfile more clearly defines the build platform including bundler calls.
<apple-corps>
In short it seems like the first container is just providing an execution engine to run rspec tests while the later is providing a ruby stack to build plugins. I don't need to build plugins but I am trying to test logstash configurations.
<weaksauce>
yeah i don't know anything about logstash
fredlinhares has quit [Quit: WeeChat 3.3]
<apple-corps>
Looking at those two docker containers, do you think I should continue with the one that currently executes the tests or work with the one that has the clear-er use of bundler, etc and try to make it's rspec work?
<apple-corps>
Maybe I will drop some output from working on the later
<weaksauce>
does the first one work at all?
<weaksauce>
i'd think that the bundled rspec should work ootb
<weaksauce>
the plugin one seems pretty heavy handed
hololeap has quit [Ping timeout: 276 seconds]
hololeap_ has joined #ruby
<apple-corps>
the first one works to execute the tests
ur5us has joined #ruby
<apple-corps>
I'm not sure how to use bundler or gem in that one to install required dependencies if for example pry is missing.
<weaksauce>
i'd just add a new run command "RUN gem install pry"
<weaksauce>
or if you don't want a layer append it
<weaksauce>
that said i have no clue how bare bones the ruby is in that dockerfile
<apple-corps>
hmm i seem to have had luck with the more involved container. I ran `rake test:install-default` and I seem to be installing required dependencies and I think I made rspec work in that environment where I did not before. I think this might be better because it seems to have bundler setup.
<weaksauce>
seems pretty well thought out so
<apple-corps>
But I'm still not terribly familiar here. I think some ruby knowledge of tooling might help
<weaksauce>
not a bad path
<apple-corps>
So if I want to install another gem, what route do I go
<weaksauce>
bundler is the main way people generally interact with gems for a project
<weaksauce>
docker kinda changes that a touch but you can do it
<weaksauce>
you have a gemfile and a gemfile.lock that lists all the gems you use and bundle install installs them
<weaksauce>
bundle exec will run whatever command in the context of those gems
<weaksauce>
bundle add pry would append pry to the gemfile and install it
<apple-corps>
ok let me try this. And what was that rake test:install-default. That seemed to get a bunch of needed things ...
<weaksauce>
rake is rubymake
<apple-corps>
Ah rake is like make. doh. hmm
<weaksauce>
so it is used to run things and install things
<apple-corps>
So where do I find the makefile def of that test:install-default ?
<weaksauce>
it's gonna be in a Rakefile
<weaksauce>
or a rake subdirectory
<apple-corps>
I see the Rakefile and it looks like it reads a bunch of lib dirs. But now I have some ideas what is going on. I will try bundle add something. Thanks!
<apple-corps>
yeah all this logstash uses jruby. I think there might be a java core and jruby. I ran bundler and it installed a bunch of stuff.
<apple-corps>
so if you're a java dev or a ruby dev you don't know what the hell is going on unless you know both && jruby :D
<weaksauce>
hah pretty much
<apple-corps>
seems like the bundler is confused. I ran bundle add and it fetched a bunch of deps. Then I ran the rspec test and got an error Bundler:FemNotFound: Could not find little-plugger-1.1.4 in any of the sources.
<apple-corps>
maybe I installed a bad requirement for the jruby world?
<apple-corps>
I was trying to install the logging library
<weaksauce>
actually the log thing is referenced in that issue
<weaksauce>
This is creating an issue for us in Logstash as we install our own version of Bundler
<apple-corps>
Ok, so I assume I want to invoke the logstash bundler if I want to add a gme
<weaksauce>
yeah
<weaksauce>
they usually have binstubs for things so that might be something to look into
<apple-corps>
I was trying to dig through the rake tasks to see where they provide the gem list for the development dependencies but maybe just looking for their bundler would be simpler