<simonfromspace>
A semi colon was bothering me so I used gsub to replace it.
Mallot1 has quit [Ping timeout: 260 seconds]
<simonfromspace>
But now I realized that other punctuations could be passed through the parsed page. What would be the easiest way to pass only letters, numbers, and spaces in the same order?
<simonfromspace>
By easy, I mean, a one liner.
<simonfromspace>
In my head, I'm thinking something like this -> gsub('!^[A-Za-z0-9 ]', '')
<simonfromspace>
But that just looks wrong
Mallot1 has joined #ruby
<Mallot1>
Hey @ewanchic
GodFather has joined #ruby
<simonfromspace>
I guess I'm trying to replace anything that's not an alphabet or a letter into '' in my string.
<Mallot1>
I got that working, but now I'm trying to figure out how to use ActiveRecord. I'm able to generate a migration with "rake db:create_migration NAME=db_name" but I don't know how to do C.R.U.D with it or how the migration actually connects to the controllers and views in a MVC application
<Mallot1>
ewanchic: ^^
<simonfromspace>
Figure it out, I guess. Solved my problem uuing--> gsub(/\W/, '')
simon__ has joined #ruby
simonfromspace has quit [Ping timeout: 268 seconds]
GodFather has quit [Ping timeout: 245 seconds]
TCZ has joined #ruby
nowhere_man has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mallot1 has quit [Ping timeout: 260 seconds]
Lyubo1 has quit [Ping timeout: 272 seconds]
<ewanchic>
Mallot1: Let me know when you have returned :)
citizentwo has quit [Remote host closed the connection]
<rubydoc>
# => ["^(date: \\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d+?)Z", "\\A[^:]+(?=(?::(.*?)=(.*))?\\z)", "#... check link for more (https://carc.in/#/r/8l2j)
<ewanchic>
So, trying to figure out Rails, or still with Sinatra?
<Mallot1>
Hey ewanchic
<Mallot1>
!
<Mallot1>
Sinatra
<Mallot1>
HelloWhen I run When I run "rake db:create" I get "rake db:createrake aborted!ActiveRecord::AdapterNotSpecified: The `development` database is not configured for the `default_env` environment.Available databases configurations are:Tasks: TOP => db:create" how do I fix this? Please help. Thanks
jenrzzz_ has joined #ruby
<ewanchic>
Sounds like it doesn't know what kind of db you are using => hence the adapter
<havenwood>
Mallot1: Is it an open source project you're trying to run?
<ewanchic>
psql, mysql, sqlite3, or other?
<Mallot1>
ewanchic. Oh i see. I'm using sqlite3
Bounga has joined #ruby
<Mallot1>
havenwood: It's my first sinatra project with activerecord
<havenwood>
Mallot1: Is it open source?
<havenwood>
Mallot1: Have a link to the repo?
<ewanchic>
so in your database.yml (I think) you need to specify the adapter: mysql3 ...?
<ewanchic>
Mallot1: so what havenwood is talking about, is you might need the development: section in your database.yml file.
<apotheon>
havenwood: Why did you switch to Roda? (just curious about reasoning)
chalkmonster has quit [Client Quit]
<Mallot1>
havenwood: "Mallot1: export APP_ENV=development" where do I put that
<havenwood>
Mallot1: Just type it once in your shell then try again.
<havenwood>
or prefix `APP_ENV=development` in front of the command.
<havenwood>
apotheon: It ended up being a variety of reasons.
<Mallot1>
havenwood: "Mallot1: Does explicitly setting RACK_ENV or APP_ENV to development help? Show your DB YAML file?" I don't know. Here's my database.yml:
<havenwood>
apotheon: One reason was I wanted something that used less memory and was generally closer to Rack speeds.
<havenwood>
apotheon: It excels there, with almost no footprint on top of Rack.
<ewanchic>
Mallot1: Change your database.yml file to this, and see it that works: https://dpaste.org/MAKu
<Mallot1>
havenwood: That's the whole file
<havenwood>
apotheon: Another reason was being burned a few times by Sinatra internals leaking into my namespace, taking a long time to debug.
<havenwood>
apotheon: I also found I often used ad hoc plugins with a Sinatra app, and it was much tidier using Roda's plugin system.
<ewanchic>
Mallot1: You can see how I encapsulated your code into a 'default' branch, and then added a 'development' branch, and pointed it back to the default.
<havenwood>
apotheon: The Roda plugins are also higher quality on average, especially those in Roda's repo.
<havenwood>
apotheon: Jeremy Evans also maintains the project. He's also the Sequel maintainer. That's a huge win for me, since he's on Ruby core and a remarkable maintainer.
<ewanchic>
Mallot1: What tutorial are you using for Sinatra?
<Mallot1>
ewanchic: havenwood: Thanks so far. Same error so far
<Mallot1>
ewanchic: What I can find on the internet.
<Mallot1>
ewanchic: Unfortunately it seems ruby is not as easy to find information for as PHP
<havenwood>
apotheon: I also found that I didn't use Sinatra functionality often, and Roda is great at composing the framework you need.
<Mallot1>
I'm mostly finding learn.co articles
<havenwood>
apotheon: I generally like starting with nothing and cherry picking plugins to compose a framework.
<havenwood>
apotheon: Roda is one of the highest-quality code bases I've seen.
<ewanchic>
That's what they all say... What are you trying to accomplish? Learn Ruby, Learn a Website...in Ruby. Build a particular kind of site? etc.
<ewanchic>
What's the main goal here.
<havenwood>
apotheon: As apps grow, I find the routing tree naturally DRYs up things that would take far more composing to get rid of otherwise.
<Mallot1>
I just want to be able to make a CRUD app with Ruby
<apotheon>
havenwood: I didn't realize it was the same maintainer as Sequel. That's interesting.
<Mallot1>
havenwood: Thanks, unfortunately I have to use ActiveRecord for this prokect
<ewanchic>
Well, IMHO, I would actually start with Rails, and maybe rails 5.1 or 5.2? Rails was built with CRUD in mind. Sinatra and Roda would be if you know the in's and out's of what your doing, and need something lean, mean, and thight.
<Mallot1>
*project
<apotheon>
I've been looking at Roda for an application rewrite, but wasn't entirely convinced yet.
<apotheon>
I'm getting there, though.
<Mallot1>
I'm so close, just can't seem to get db:create to work.
<ewanchic>
what version of ruby are you using?
<Mallot1>
I've figured out views, controllers, making a basic migration
<ewanchic>
Mallot1: Great. and Great. You can do all of this stuff in rails. Here, I'll walk you through it. Start with 'gem install rails -v 5.2 --no-document'
<apotheon>
havenwood: That's what I've seen for Roda performance, in my readings online.
<havenwood>
apotheon: I'd like to try a Roda app backed by Falcon and an Async adapter for the DB/memory store/web/disk.
<Mallot1>
ewanchic: I would but I have to use Sinatra for this project unfortunately
<havenwood>
apotheon: Falcon is looking really nice.
<howdoi>
How's ROR doing when compared to nodejs in the industry?
<ewanchic>
Well you can still go back to Sinatra. Rails will get you there quicker, and then maybe you know what to look for. In the meantime, I look for some sinatra tutorials for you.
<ewanchic>
howdoi: I really won't touch nodejs. I've hated it everytime I look at it. It's a huge step backwards IMPO.
<havenwood>
howdoi: Rails is doing great. I don't know I'd compare a single framework to a... what is Node?
<ewanchic>
Mallot1: what version of sinatra are you using?
<Mallot1>
I don't know how to check
<havenwood>
howdoi: A language? Not really. A browser VM that you can run on the server. I'd compare Node.js to Ruby probably.
Mrgoose845701915 has joined #ruby
<ewanchic>
gem list sinatra
<Mallot1>
Oh yeah
<Mallot1>
sinatra (2.0.8.1, 2.0.7)
<Mallot1>
thanks
<howdoi>
In 2009 in did ROR for an year and switched to Python and later to nodejs and haven't turned back
<havenwood>
howdoi: I'd guess that Ruby probably has more traction than Node.js overall? It's hard to say. JavaScript is certainly huge on the browser.
<howdoi>
But recently got an interesting gig on ROR
TCZ has quit [Quit: Leaving]
<howdoi>
Bit confused, considering the market trends
<havenwood>
howdoi: Ruby and Node.js are both pretty vibrant communities.
<havenwood>
howdoi: The last I did Rails was for a little experiment around Rails 5.2: https://youtu.be/6h5TbKBnLws
<havenwood>
apotheon: I agree! I wish there was more general flexibility with percent of time. It makes being a contractor appealing, except for every. other. thing. about it.
<ewanchic>
howdoi: gem 'freight' long story short, I started this gem back in Aug '19, but I didn't own the name yet. I'm currently at version 0.10.x on my dev machine, but I'm trying to slowly translate what I have working back into the public gem, and add testing. ...it is SLOW, but progressing. I just finished a major stage just the other night. Now are to the third stage...I am so pumped!
<ewanchic>
howdoi: second and third on my dev gem, not the public.
<howdoi>
Nice, I'll wait for it.
<howdoi>
havenwood: I'll listen to it. Thanks
<ewanchic>
Mallot1: I'm looking for tutorials still. I was going to walk you through the Rails. If you need active record, it's not much different. You'll probably be done in 10 mins. Then you can take what you learned and able it back to Sinatra.
<apotheon>
havenwood: agreed, re "every other thing about it"
<Mallot1>
Alright, thanks I appreciate it :)
<apotheon>
havenwood: It doesn't help that laws made to supposedly protect contractors actually screw contractors over in a major way.
<ewanchic>
Mallot1: Is this what you are following?
<Mallot1>
ewanchic: No, I've never seen that before
<ewanchic>
Mallot1:, Yeah, forget the database.yml. Looks like it's just a tight piece of code. Create an app.rb file, just declares the db, right there.
<Mallot1>
okay
jenrzzz has joined #ruby
<ewanchic>
Mallot1: This might be what you need.
<Mallot1>
ewanchic: It looks like a great find
<ewanchic>
I googled: sinatra 2.0.7 with activerecord tutorial
<ewanchic>
Mallot1: let me know how that works out for ya!
bsdband21 has joined #ruby
<ewanchic>
havenwood: How did your experiment go?
bsdbandit-01 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
* howdoi
is overthinking
<havenwood>
ewanchic: I had a blast and was thrilled to find out how relatively easy it was to wrap an API in an ActiveRecord-like interface.
<ewanchic>
havenwood: Yes, it is awesome stuff, that rails!
<howdoi>
> According to the results from the same survey, globally Ruby developers have a salary of $64000. That’s quite lower than Clojure ($72000), Rust ($69 000), Erlang ($67000) or even Go ($66000) but much higher than JavaScript ($55000).
Mallot1 has quit [Ping timeout: 260 seconds]
bsdband21 has quit [Ping timeout: 248 seconds]
bsdbandit-01 has joined #ruby
orbyt_ has joined #ruby
Mallot1 has joined #ruby
<Mallot1>
hello
<ewanchic>
Hey
<Mallot1>
I'm so confused with migrations. When I create a migration and run it what actually happens?
<Mallot1>
Like what file is generated? How can I see what happened?
<ewanchic>
Is there a schema.db that's created?
<ewanchic>
Sorry, schema.rb?
coderhs has quit [Remote host closed the connection]
<Mallot1>
it runs but no schema.rb is made
<ewanchic>
It's probably more complete in Rails than it is in sinatra. The way migrations work is really cool! There is another table that's created in your db called schema migrations. It' keeps track of your tables that get added to the db. You can create, migrate, rollback, drop, and append existing table.
<Mallot1>
oh sweet
<Mallot1>
thanks
<ewanchic>
Migrations can give you the oppurtunity to morph/transpose data if you need to, from table change ti table change. The idea is , if you need to go backwards in your project development, you can.
<ewanchic>
Yeah, from this tutorial, sinatra might be lacking, I don't know for sure. But, it makes sense. Rails is designed for setting up the whole framework for development. You can go lean and mean with sinatra. But, my projects are never lean and mean in nature. They have to be robust and productive/feature rich apps.
<ewanchic>
That's why I think if you created a rails app in 10 mins, you'd find easier why sinatra might or might not be doing this or that.
<Mallot1>
Could wor
ttoocs has joined #ruby
<Mallot1>
k
raven__ has joined #ruby
darkstardev13 has quit [Ping timeout: 268 seconds]
tredkilla has joined #ruby
Bounga has joined #ruby
Bounga has quit [Ping timeout: 248 seconds]
bsdbandit-01 has quit [Ping timeout: 265 seconds]
bsdband58 has joined #ruby
braincrash has quit [Quit: bye bye]
ur5us has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
jenrzzz has joined #ruby
LinuxKnight has joined #ruby
alfiemax has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
StoneCypherMac has joined #ruby
<StoneCypherMac>
Hi, I barely ruby, I'm trying to hack my way through it on other code, and I'm missing something. I wrote a module, and in irb it seems to do what I expect. I'm trying to write a spec but I can't load spec_helper.
<StoneCypherMac>
I'm really hoping this is a common mistake and that I'm about to feel silly
<StoneCypherMac>
it's not clear to me whether there's an expected path, whether i need to have done whatever ruby's package or project creation dance is, &c. i'm trying to rtfm but i haven't found the relevant page yet
ur5us has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
splud_wurk has quit [Quit: splud_wurk]
<havenwood>
StoneCypherMac: We'd be happy to help. Have you committed your project to a repo and uploaded it anywhere you can share so we can take a look?
<havenwood>
StoneCypherMac: Do you have a spec_helper.rb file?
<havenwood>
StoneCypherMac: To require a helper from the same directory, you could: require_relative 'spec_helper'
akemhp has joined #ruby
StoneCypherMac has quit [Ping timeout: 272 seconds]
StoneCypherMac has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
duderonomy has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ewanchic>
If I'm running ordinary gem server, and I source to it, and I ask for a gem that's not installed, will it search up inside the gem server to download it into it's repo, and then give it to me, or will it skip?
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
mozzarella has quit [Remote host closed the connection]
chalkmonster has joined #ruby
mozzarella has joined #ruby
mozzarella has quit [Remote host closed the connection]
mozzarella has joined #ruby
<ewanchic>
mmm :( gem server works, but I still cannot install gems from it.
connor_goodwolf has quit [Quit: leaving]
connor_goodwolf has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
cxl has quit [Quit: bye]
jenrzzz has joined #ruby
sergioro has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 248 seconds]
coffeex3 has joined #ruby
sauvin has joined #ruby
sauvin has quit [Max SendQ exceeded]
StoneCypherMac has quit [Ping timeout: 245 seconds]
sauvin has joined #ruby
schne1der has joined #ruby
cxl has joined #ruby
hoijui has joined #ruby
Bounga has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
Bounga has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
coffeex3 has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
StoneCypherMac has joined #ruby
schne1der has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
StoneCypherMac has quit [Ping timeout: 268 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
snuz has quit [Read error: Connection reset by peer]
StoneCypherMac has joined #ruby
postmodern has quit [Read error: Connection reset by peer]
StoneCypherMac has quit [Ping timeout: 265 seconds]
postmodern has joined #ruby
fercell has joined #ruby
Arahael has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
my_dude has quit [Quit: ZZZzzz…]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
NODE has quit [Quit: changing servers]
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
NODE has joined #ruby
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
conta has joined #ruby
my_dude has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyWork has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
my_dude has quit [Quit: my_dude]
schne1der has joined #ruby
Eiam has quit [Ping timeout: 248 seconds]
nowhere_man has joined #ruby
csaunders_ has quit [Ping timeout: 248 seconds]
pinpox has quit [Ping timeout: 260 seconds]
csaunders has joined #ruby
pinpox has joined #ruby
teej has quit [Ping timeout: 248 seconds]
gorsuch has quit [Ping timeout: 248 seconds]
grvgr has quit [Ping timeout: 248 seconds]
infinity2022 has quit [Ping timeout: 248 seconds]
grvgr has joined #ruby
gorsuch has joined #ruby
kapil_ has quit [Ping timeout: 248 seconds]
JayDoubleu has quit [Ping timeout: 248 seconds]
maxmanders has quit [Ping timeout: 248 seconds]
jnoon has quit [Ping timeout: 248 seconds]
pitastrudl has quit [Ping timeout: 248 seconds]
ctp has quit [Ping timeout: 248 seconds]
wbnns has quit [Ping timeout: 248 seconds]
mkroman has quit [Remote host closed the connection]
infinity2022 has joined #ruby
JJonah_ has quit [Ping timeout: 248 seconds]
jhill has quit [Ping timeout: 248 seconds]
jerme_ has quit [Ping timeout: 248 seconds]
ReinH has quit [Ping timeout: 248 seconds]
kermit has quit [Ping timeout: 248 seconds]
mkroman has joined #ruby
maxmanders has joined #ruby
pitastrudl has joined #ruby
ReinH has joined #ruby
jnoon has joined #ruby
NODE has quit [Excess Flood]
ctp has joined #ruby
JayDoubleu has joined #ruby
wbnns has joined #ruby
kapil_ has joined #ruby
Bounga has joined #ruby
teej has joined #ruby
NODE has joined #ruby
jerme_ has joined #ruby
JJonah_ has joined #ruby
kermit has joined #ruby
jhill has joined #ruby
my_dude has joined #ruby
fphilipe has joined #ruby
Jonopoly has joined #ruby
NODE has quit [Quit: Benett]
clemens3 has joined #ruby
mikecmpbll has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
sagax has joined #ruby
NODE has joined #ruby
nowhere_man has joined #ruby
code_zombie__ has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 260 seconds]
Bounga` has joined #ruby
Bounga has quit [Ping timeout: 272 seconds]
xco has joined #ruby
my_dude has quit [Quit: ZZZzzz…]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
my_dude has joined #ruby
my_dude has quit [Client Quit]
mkroman has quit [Remote host closed the connection]
sergioro has quit [Quit: leaving]
my_dude has joined #ruby
my_dude has quit [Client Quit]
mkroman has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.5]
JediMaster has joined #ruby
<JediMaster>
Hi all, I've got a dependency conflict between two gems, 'acme-client' and 'inspec-core'. They both require the 'faraday' gem, both work with 0.9.1 and above, but inspec-core doesn't have a ~> dependency so it tries to install 1.0.0 which then conflicts with the requirements for acme-client. Does anyone have any ideas on a workaround?
<JediMaster>
I need both running at the same time (inspec-core is required by Chef's client, and I need acme-client for a Chef recipe)
<JediMaster>
It looks like gem recommends having a limiting ~> requirement on all packages, it warns when you don't have one, and inspec-core doesn't have it
<JediMaster>
Is there a way I could stop faraday 1.0.0 from being installed despite inspec-core's >=0.9.0 dependency that automatically installs the very latest version?
<JediMaster>
This issue has only happened since faraday 1.0.0 was released
alfiemax has quit [Remote host closed the connection]
gigetoo has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
gigetoo has joined #ruby
alfiemax has quit [Ping timeout: 245 seconds]
Fernando-Basso has joined #ruby
chalkmonster has joined #ruby
StoneCypherMac has joined #ruby
Arahael has quit [Ping timeout: 240 seconds]
StoneCypherMac has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
my_dude has joined #ruby
TCZ has quit [Quit: Leaving]
Arahael has joined #ruby
<IGnorAND>
I like ruby, and would thus like to write ruby. I however need to run several scripts on servers which dont have ruby installed. One option is to write the scripts in sh/bash. Is there a way to make a elf binary from ruby so I can avoid writing sh scripts?
alfiemax has joined #ruby
<IGnorAND>
rubinius looks like what I want, but the page is 'blank'
leitz has joined #ruby
<IGnorAND>
seems it needs a Rubinius VM as well. Sigh so not byte code
xco has joined #ruby
alexherbo2 has joined #ruby
<leitz>
Is there a need for a gem that helps you format your resume data into txt and html, from the same source? I got tired of being asked for word versions, and I needed a web version on my site. Not sure if anyone else would want it.
<leitz>
Well, with their own resume data. :)
postmodern has quit [Quit: Leaving]
Bounga` has quit [Ping timeout: 245 seconds]
NODE has quit [Quit: changing servers]
conta has quit [Quit: conta]
Bounga` has joined #ruby
NODE has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klaas has quit [*.net *.split]
klaas has joined #ruby
bsdband58 has quit [Ping timeout: 240 seconds]
cxl has quit [Ping timeout: 240 seconds]
cxl has joined #ruby
bsdbandit-01 has joined #ruby
Ytrezar has quit [Quit: See ya]
<IGnorAND>
@leitz you could make a prawn version of it
<IGnorAND>
creates pdf
Ytrezar has joined #ruby
<leitz>
IGnorAND, not a bad idea!
davor_ has joined #ruby
davor has quit [Ping timeout: 268 seconds]
davor_ is now known as davor
tredkilla has quit [Ping timeout: 272 seconds]
TCZ has joined #ruby
StoneCypherMac has joined #ruby
buckworst has joined #ruby
StoneCypherMac has quit [Ping timeout: 258 seconds]
drincruz has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
Mallot1 has quit [Remote host closed the connection]
JJonah_ has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 265 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
hoijui has quit [Ping timeout: 248 seconds]
vondruch_ has joined #ruby
tredkilla has joined #ruby
xco has joined #ruby
NODE has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
JediMaster has quit [Quit: fnarble]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stryek has joined #ruby
burningserenity has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
burningserenity has quit [Quit: Leaving.]
burningserenity has joined #ruby
kinduff has joined #ruby
kinduff has joined #ruby
kinduff has quit [Changing host]
lucasb has joined #ruby
markopasha has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
Arahael has quit [Ping timeout: 240 seconds]
buckworst has quit [Quit: WeeChat 2.7]
tredkilla has quit [Ping timeout: 248 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
snuz has joined #ruby
alfiemax has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
jacksop has joined #ruby
simonfromspace has joined #ruby
dreamreal has quit [Quit: WeeChat 2.7]
cd has joined #ruby
dreamreal has joined #ruby
bkuhlmann has joined #ruby
bkuhlmann has quit []
royal_screwup21 has joined #ruby
jottr has joined #ruby
m_antis has joined #ruby
dionysus69 has joined #ruby
m_antis has quit [Client Quit]
StoneCypherMac has joined #ruby
bsdband34 has joined #ruby
TCZ has quit [Quit: Leaving]
StoneCypherMac has quit [Ping timeout: 265 seconds]
bsdbandit-01 has quit [Ping timeout: 265 seconds]
zacts has joined #ruby
schne1der has joined #ruby
minall has joined #ruby
<minall>
Hello Ruby community!
<minall>
I'm studying Ruby and I reached the concept of 'symbols', which are 'lightweight strings'. I somewhat understand it, but I want a situation in which I'll use symbols instead of strings
<leitz>
minall, as a key for a hash.
<havenwood>
minall: I'll quote Jeremy Evansn, "Symbols are a simple way to get a unique named identifier, and Strings represent arbitrary data/text."
<havenwood>
minall: Or Matz, "Symbols in Ruby are for identifiers. They are kind of like Enums in other languages such as Swift or C# (although Symbols are more primitive)."
bsdband34 has quit [Ping timeout: 272 seconds]
royal_screwup21 has quit [Remote host closed the connection]
<havenwood>
minall: There's discussion of the distinction in these issue tickets:
<havenwood>
minall: Symbols are like a number wearing a name tag. They don't store text, they just happen to use a bit in their name tag.
my_dude has quit [Quit: ZZZzzz…]
citizentwo has joined #ruby
GodFather has joined #ruby
<havenwood>
minall: A language can unify what Ruby calls Symbols and Strings or go the other way and have more distinctions than just two primitives for identifiers and text data. At some point languages draw lines between primitives, and sometimes they seem to overlap somewhat.
<havenwood>
{label: 'some text data'}
vondruch has quit [Ping timeout: 268 seconds]
vondruch_ is now known as vondruch
<havenwood>
minall: leitz's example ^
jottr has joined #ruby
* leitz
heads out for a bit. Liking the learning, though.
<minall>
Thanks guys!, that's more aclaratory!
fercell has quit [Quit: WeeChat 2.7]
simon_ has joined #ruby
simon_ has quit [Client Quit]
<simonfromspace>
havenwood, I can't find it here any longer but what the testing tool you suggested for my scraper?
zacts has quit [Quit: zacts]
<simonfromspace>
A three letter tool
<havenwood>
simonfromspace: vcr
<simonfromspace>
ty
ammar has quit [Quit: Lost terminal]
<seenseen>
I've created a few scrapers in my past, but are they easier to create in Ruby than for instance in Node?
<seenseen>
Like Ruby's not made for "low level" file and folder management like shells, from what I understand it's not very well suited for "low level" web scraping
<seenseen>
"high level stuff" took on a whole new meaning after I came to this conclusion, however wrong it may have been.
<seenseen>
Did an A/B test and it turns out JS scrapers are way easier to create than Ruby scrapers
<seenseen>
jacksop: It's
<seenseen>
Went through Mechanize and its forks but still :/
dionysus69 has quit [Ping timeout: 240 seconds]
<seenseen>
Ruby is destined for greater things than to scrape web pages
<seenseen>
Like scraping garbage off the streets
<havenwood>
seenseen: You mean controlling robots.
<havenwood>
seenseen: Yes.
<seenseen>
Ruby is what makes the streets. And the skyscrapers they house.
<simonfromspace>
You're a wizard, Ruby
<seenseen>
havenwood: Yes sir!
<jhass>
but don't we want robots so we don't have to scrape garbage off the streets anymore ourselves...?
<havenwood>
jhass: then the robots will build organic lifeforms since they learn they don't want to do it either.
<havenwood>
maybe we should just stop throwing garbage in the streets?
<jhass>
you make it sound easy
<jhass>
reminds me of the short movie where the automated factories build their own consumers
jottr has quit [Ping timeout: 255 seconds]
<havenwood>
now if the street itself was alive...
<seenseen>
I love where this is going :)
<havenwood>
the street could make its own garbage and we and the robots could clean it up.
<havenwood>
by working together.
<simonfromspace>
havenwood, I need to make unit tests for my code. I was suggested by Reddit and this channel, to have a local static page to test against. So far I only know RSpec. Does this mean I don't need to use vcr? Or would I be able to do the same with vcr?
impermanence has joined #ruby
<havenwood>
simonfromspace: Minitest is a test framework that ships with Ruby. RSpec is a popular alternative to Minitest. VCR is a different thing that works with either Minitest or RSpec. VCR will fake a "replay" of a web request so you can test the web offline.
<simonfromspace>
Oh, so it works on top of RSpec.
<havenwood>
seenseen: Have you tried anemoe, spidr or wombat?
chalkmonster has quit [Quit: WeeChat 2.7]
<havenwood>
seenseen: Lots of crawler options. Whether it works for you depends largely on what you're doing. Headless browsers are sometimes easier. I've found Ruby quite adept at scraping. YMMV.
<seenseen>
havenwood: I think I tried spidr, but it was a while back. Ended up creating our own spider in Node :/
<seenseen>
After careful consideration
duderonomy has joined #ruby
<seenseen>
I might have to revisit that decision, but in a way it makes sense to parse HTML with JS rather than Ruby
<havenwood>
seenseen: I can't imagine it much matters whether you crawl or parse in JavaScript or Ruby. They both seem quite similar in that regard.
jottr has joined #ruby
al2o3-cr has quit [Client Quit]
<havenwood>
seenseen: They both have a ton of tools to do the crawling and parsing. The fast parts of both are written in C. They expose a very similar level of abstraction. I'd guess it's more about whether coding in Ruby or JavaScript makes you happier.
<havenwood>
seenseen: If I wrote the same crawler and parser in both I'd imagine I'd not much prefer one to the other. ¯\_(ツ)_/¯
<havenwood>
seenseen: Unless there's some magical library you love that's just available in one of them.
stdedos has joined #ruby
<havenwood>
seenseen: As interoperability get better, even that matters less.
AndreYuhai has joined #ruby
<AndreYuhai>
Hey there, can I use active record for my non-rails project? To create a database table and model.
<havenwood>
AndreYuhai: Yes, you can.
<havenwood>
AndreYuhai: Consider Sequel as an alternative.
<AndreYuhai>
havenwood, is it a good way though?
<havenwood>
AndreYuhai: Sequel and ActiveRecord are the two most popular outside of Rails.
<havenwood>
AndreYuhai: Both Sequel and Roda have a plugin system, so you can get a bunch of features by cherry picking them.
<havenwood>
AndreYuhai: I highly recommend both. Lots of folk do also use ActiveRecord outside of Rails effectively.
<havenwood>
AndreYuhai: Whatcha using a DB for?
alfiemax has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
<AndreYuhai>
havenwood, Oh I haven't heard of that either. I actually just started learning some rails for fun. What I am doing right now is that I have a scraper and I keep whatever scraped in a mysql DB.
<AndreYuhai>
havenwood, I was using mysql2 gem with some module I wrote to make it easy to do CRUD but that becomes pain
jottr has quit [Ping timeout: 258 seconds]
<havenwood>
AndreYuhai: For just a key/value store you can even use something built in to Ruby to persist data. Ruby ships with a whole menagerie of interesting things along those lines.
<havenwood>
adam12: DBM is a little key/value DB that Ruby has a variety of adapters for in the stdlib, like DBM, GDBM, and SDBM.
<havenwood>
oops, MT
StoneCypherMac has joined #ruby
<havenwood>
AndreYuhai: One limitation of DBM is that it only stores strings for both key and value. YDBM just auto-serializes values to YAML so you can store more than strings.
<havenwood>
AndreYuhai: Anyway: YAML + DBM = YDBM
<havenwood>
YDBM lets you use String keys to store values to the DB.
<AndreYuhai>
havenwood, so what if I have multiple columns per row
<havenwood>
Mallot1: Confirm 1) the APP_ENV you're running under, 2) whether your database.yml file is properly "set," 3) whether the content of your database.yml file is correct.
<havenwood>
Mallot1: I'd be happy to help you start a quick Roda app with Sequel if you get stuck or tired of debugging.
<havenwood>
Mallot1: Lots of folk here use Sinatra and ActiveRecord though, so sharing a repo should work to get help with those.
<Mallot1>
havenwood: Thanks, I removed the line but same error :(
<havenwood>
Mallot1: Uncomment!
<havenwood>
Mallot1: Don't remove the line. Uncomment the line.
gix has joined #ruby
<havenwood>
Mallot1: Or once you fix the new errors the old error comes back?
<havenwood>
Mallot1: Sec, lemme try.
DTZUZU2 has quit [Ping timeout: 260 seconds]
DTZUZU2 has joined #ruby
<AndreYuhai>
How can I call another rake task depending on the result of the task I ran earlier ? If that's possible.
<Mallot1>
havenwood: Thanks, it progressed to then scrutinizing my require "models/car.rb" file. I then changed that to "require_relative "../app/models/car.rb" . Same error now
jtdowney has quit [Quit: Bye]
jintseng has quit [Ping timeout: 240 seconds]
<havenwood>
Mallot1: Updating the PR as I fix.
<havenwood>
Mallot1: Multitasking with work so this may be slow.
<havenwood>
Mallot1: Actually, I don't have time right now. :( But very happy to help later today.
<havenwood>
Mallot1: I just pushed a commit setting RACK_ENV, which changes the error.
<havenwood>
Mallot1: Now the error is: The `development` database is not configured for the `development` environment.
<havenwood>
Mallot1: So those match. >.>
MrETH has joined #ruby
davor_ has joined #ruby
davor has quit [Ping timeout: 265 seconds]
davor_ is now known as davor
MrETH has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<Mallot1>
havenwood: I see "ActiveRecord::AdapterNotSpecified: The `development` database is not configured for the `development` environment." thanks so far
mikecmpbll has quit [Quit: inabit. zz.]
royal_screwup21 has quit [Remote host closed the connection]
Jonopoly has joined #ruby
JJonah_ has joined #ruby
jintseng has joined #ruby
chalkmonster has joined #ruby
<havenwood>
Mallot1: It was a missing require. This sinatra/activerecord is fincky.
<Mallot1>
havenwood: Oh nice, which one?
Guest19403 has joined #ruby
<havenwood>
Mallot1: Updated PR, but really have to work now!!
<Mallot1>
havenwood: I have "Couldn't create 'db/database.sqlite3' database. Please check your configuration." now from adding a ENV["DATABASE_ENV"] Okay, thanks!
<Guest19403>
newbie of ruby here , hello , everybody
Guest19403 is now known as RedNinja
<Mallot1>
*ENV["DATABASE_URL"]
<havenwood>
RedNinja: Welcome!
<Mallot1>
havenwood: Yes, perfect! You rock bro!
<Mallot1>
It works, thanks again! :)
splud_wurk has joined #ruby
<RedNinja>
thanks
Bounga` has joined #ruby
jottr has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
Bounga` has quit [Ping timeout: 272 seconds]
RedNinja has quit [Remote host closed the connection]
Mallot1 has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
DTZUZU2 has quit [Read error: Connection reset by peer]
DTZUZU2 has joined #ruby
Mallot1 has joined #ruby
m_antis has joined #ruby
Mallot1 has quit [Remote host closed the connection]
citizentwo has quit [Ping timeout: 248 seconds]
minall has left #ruby ["ERC (IRC client for Emacs 26.3)"]
rippa has joined #ruby
StoneCypherMac has quit [Ping timeout: 260 seconds]
citizentwo has joined #ruby
dionysus69 has joined #ruby
pwnd_nsfw has joined #ruby
StoneCypherMac has joined #ruby
timmow has quit [*.net *.split]
nfsnobody has quit [*.net *.split]
timmow has joined #ruby
nfsnobody has joined #ruby
clemens3 has joined #ruby
markopasha has quit [Ping timeout: 268 seconds]
StoneCypherMac has quit [Ping timeout: 255 seconds]
houhoulis has joined #ruby
nowhereman has joined #ruby
<sagax>
hi all!
<sagax>
i don't understand - why i don't use rackup? where rackup it's must be have?
markopasha has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
my_dude has joined #ruby
houhoulis has quit [Ping timeout: 255 seconds]
AndreYuhai has quit [Remote host closed the connection]
my_dude has quit [Client Quit]
<havenwood>
sagax: Huh?
<havenwood>
sagax: What are you asking about rackup?
<havenwood>
I can't parse this, could you say it another way?: "where rackup it's must be have?"
<havenwood>
sagax: It's a common way to start Rack apps, regardless of the webserver they're using. Alternatively, most webservers ship with their own executable. So, you can use `falcon`, `puma`, `unicorn` or `thin` in place of `rackup` depending on which webserver you're using.
<havenwood>
sagax: All of the above work with rackup files, by convention named: config.ru
<havenwood>
".ru" for rack up
<seenseen>
seen seen!
<sagax>
hm. i understand now, before i use `thin` and `unicorn`
<sagax>
havenwood: thanks,
<havenwood>
sagax: you're welcome
<seenseen>
sagax: havenwood is the #1 go to
kira_rose[m] has left #ruby [#ruby]
<seenseen>
sagax: But lemme just add "rack-attack" to the mix
<seenseen>
Save your ass from script kiddies and the like, if your app really gets popular :)
sauvin has quit [Read error: Connection reset by peer]
StoneCypherMac has joined #ruby
teardown has quit [Ping timeout: 268 seconds]
codefriar has quit [Ping timeout: 258 seconds]
my_dude has joined #ruby
chalkmonster has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
StoneCypherMac has quit [Ping timeout: 260 seconds]
bvdw has joined #ruby
kent\n has quit [Quit: No Ping reply in 180 seconds.]
fphilipe has quit [Ping timeout: 272 seconds]
kent\n has joined #ruby
citizentwo has quit [Remote host closed the connection]
StoneCypherMac has joined #ruby
citizentwo has joined #ruby
seenseen is now known as TinderFX
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
alfiemax has joined #ruby
chalkmon1 has joined #ruby
siery has quit [Ping timeout: 260 seconds]
chalkmonster has quit [Ping timeout: 240 seconds]
<simonfromspace>
I have a variable inside a method. Is it possible to set that variable to whatever I want using let in rspec?
hoijui has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
<simonfromspace>
the variable already has a value, so I'm looking to change that value when testing the method
<ewanchic>
You might need to change it to an instance var, as in @variable
chalkmon1 has quit [Read error: Connection reset by peer]
<simonfromspace>
I thought so, and I wanted to confirm
<_phaul>
but the fisrt question should be if you really want to do this in the first place. Test from what visible to the outside.. Everything hidden inside is hidden for a reason
<_phaul>
testing internal state makes tests fragile
<jhass>
^ you might want to resarch dependency injecton
nowhereman has quit [Ping timeout: 255 seconds]
<simonfromspace>
Well, _phaul I am making a scraper and supposed to build unit tests for it. I have a variable set to the website (probably not the best idea but it does the work, and as ewan suggested, I'll make it into an instance variable).
<simonfromspace>
I'm making a static site for rspec to run the tests on.
<simonfromspace>
And I want rspec to point it to that test site instead of a live one.
<simonfromspace>
I was suggested vcr but I've been having trouble understanding how to implement it.
StoneCypherMac has quit [Ping timeout: 240 seconds]
<simonfromspace>
I hope that explains my situation. I need to set the variable to my static site when running rspec.
<_phaul>
is it passed in from the outside? Then you have access to it from rspec that passes it in ( as jhass said that would be basically dependency injection )
<simonfromspace>
No, it's set inside the method.
<simonfromspace>
I guess I'll set it outside as an instance which should work, right?
<simonfromspace>
I'll give it a shot.
<_phaul>
site = 'site' ; scraper = Scaper.new(site: site); is the usage. Then you can let(:site) {double('site')}; subject {Scraper.new(site: site) }; and expect on it like expect(site).to receive :whatever
StoneCypherMac has joined #ruby
<_phaul>
if the site is actually worked out inside the Scraper, then that is telling you that the scraper class does too much
splud_wurk has quit [Quit: splud_wurk]
<simonfromspace>
Setting it up like that might need a lot more refactoring.
<simonfromspace>
I have till tomorrow morning but I'll try my best. THank you
Bounga` has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
StoneCypherMac has quit [Ping timeout: 258 seconds]
royal_screwup21 has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
<_phaul>
good luck. I hope I haven't sent you down on a rabbit hole that's too deep. But usualy if something is hard to test then the problem is with the something
Bounga` has quit [Ping timeout: 248 seconds]
burningserenity has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
jottr has joined #ruby
citizentwo has quit [Remote host closed the connection]
burningserenity has joined #ruby
citizentwo has joined #ruby
fphilipe has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
citizentwo has quit [Ping timeout: 240 seconds]
chalkmonster has joined #ruby
<simonfromspace>
_phaul, I'll let you know how it goes. Currently writing my tests.
citizentwo has joined #ruby
StoneCypherMac has joined #ruby
StoneCypherMac has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
hoijui has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
AndreYuhai has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
StoneCypherMac has joined #ruby
cliluw has joined #ruby
siery has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
fphilipe_ has joined #ruby
<ewanchic>
So last night I tried to use regular 'gem server'. The webbrowser works, and it updates as I install more gems. But I get an error when I try to download gems from it using gem install. https://dpaste.org/iCyc
StoneCypherMac has quit [Read error: Connection reset by peer]
chalkmonster has quit [Quit: WeeChat 2.7]
fphilipe has quit [Ping timeout: 272 seconds]
nowhereman has joined #ruby
<ewanchic>
I'm not sure where to go from here. Basically I'm have the same issue with gem server and gemirro.
<AndreYuhai>
Hey there, I have a database model and it has one attachment called file, a csv file. The client is able to directly upload the CSV to an amazon bucket. Then I read the content of it, do some manipulation in the background, create a new local CSV and upload it back to the bucket using amazon sdk. What I have problem with here is that how do I attach this file to a model as well?
<AndreYuhai>
so I need to be able to create active_storage_attachments and blobs entries for the file
<AndreYuhai>
But couldn't figure out how to do taht
<AndreYuhai>
especially for blobs table because it has some columns that I have no idea where we are getting from.
<AndreYuhai>
for example: metadata, content_type, byte_size, checksum.
<ewanchic>
AndreYuhai: Not sure what you mean by attach to model. Why/how are you attaching a file to a model? Do you mean you want to upload the file to the db?
StoneCypherMac has joined #ruby
<AndreYuhai>
ewanchic, I create a local CSV on the server side. I want to upload this to an amazon bucket. I also have a model where I want to keep record of these uploaded files.
<ewanchic>
Is this db model...a db table you to add afield that accepts blob data?
siery has quit [Ping timeout: 255 seconds]
<AndreYuhai>
ewanchic, yes it's a table and in the model code I just did `has_one_attached :file`
<ewanchic>
AndreYuhai: oooh, ok. New Terminology from activestorage. I'd think of it ans a one to one table relationship.
<simonfromspace>
Any idea why this is happening. I've commented out all the tests yet this happens. https://dpaste.org/8Th1
<ewanchic>
AndreYuhai: so, is there a reason why you want to store blobs (csv files) in the table? It's really a bad idea to do that. Files should be stored in the File Hierarchy database, aka your file folders.
<AndreYuhai>
ewanchic, not sure if I understood correctly but I am not storing CSVs in table. Let me show you what's in the tables.
<havenwood>
simonfromspace: p @output
<ewanchic>
simonfromspace: # ./spec/eztv_scraper_spec.rb:1:in `require_relative' did you require the eztv_scraper.rb file inside of your eztv_scraper_spec.rb file?
<simonfromspace>
yes I did
<ewanchic>
simonfromspace: Did you require JSON lib?
<simonfromspace>
I've required all the files. It works fine normally, but using RSpec messes it up.
<havenwood>
simonfromspace: Share a link to the repo?
<simonfromspace>
Oh do I need to require json lib inside the spec file or something?
<havenwood>
simonfromspace: Nope, shouldn't need to.
cliluw has quit [Read error: Connection reset by peer]
<simonfromspace>
Let me push
burningserenity has quit [Remote host closed the connection]
cliluw has joined #ruby
<AndreYuhai>
ewanchic, so in blobs table there is information about the file uploaded to the bucket which I have no idea how's that happening in the background when I use direct upload.
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
<ewanchic>
AndreYuhai: ...oh, so You make changes and the file uploads back to the bucket, but you don't see the changes in active storage?
<AndreYuhai>
ewanchic, well I am uploading the file using the amazon sdk so I have to instantiate another model then attach the file and then save it. But when I upload the file to the amazon using the SDK I just get true as a return if the upload was successful
<ewanchic>
AndreYuhai: You basically making those changes on the desktop, you re-upload the file back into the bucket directly. Going around active storage. But you don't see the changes in activestorage?
<AndreYuhai>
ewanchic, no, I want to instantiate a model and attach the file that I just uploaded to the model and save it.
<AndreYuhai>
ewanchic, but the thing is how do I attach this uploaded file to a model
<AndreYuhai>
ewanchic, I do Model.new.file.attach (or something like this) but then how are all the column values handled
<ewanchic>
AndreYuhai: No it should do it for you...but it's probably not necessary becuae I assume ruby would look up the file, and ask bash for all of that info. I'll look it up ...
<havenwood>
simonfromspace: You can do just `puts` instead of `puts ''`.
<havenwood>
simonfromspace: No need for the empty String literal.
<AndreYuhai>
ewanchic, hmm alright I will try that right now. Because then I need an object of Attachable to be able to attach the file
<havenwood>
simonfromspace: You should probably run Rubocop on the code, just for some quick fixes.
<havenwood>
simonfromspace: gem install rubocop && rubocop -a
<havenwood>
simonfromspace: The "-a" will autofix issues.
<simonfromspace>
Yeah I fixed the errors last night but I'll do again
cliluw has quit [Read error: Connection reset by peer]
cliluw has quit [Read error: Connection reset by peer]
<ewanchic>
AndreYuhai: So, you could do things like file.video? or file.audio? to see what kind of general type it was.
cliluw has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
<ewanchic>
AndreYuhai: File.content_type whould get you more info on the type
<ewanchic>
havenwood: sorry to bug you, any ideas as to while I'm not downloading gems properly from gem server or gemirro?
<havenwood>
ewanchic: Not off the top of my head without knowing more about the problem you're running into.
<havenwood>
ewanchic: I suspect you don't need to be doing it, unless it's for fun.
<ewanchic>
havenwood: no, it's for development. It's for freight gem
<havenwood>
ewanchic: I have a bunch of gems but never run my own gem server for them.
<havenwood>
ewanchic: I use a gem server for work, but just to get private versions of shared gems.
<ewanchic>
havenwood: frieght creates a new rails app. Then I got to stick 'freight' back into the Gemfile. I've been putting a path in which messes things up when I export to the server.
<havenwood>
ewanchic: Just to clarify, freight is currently closed source?
<ewanchic>
havenwood: I suspect if I create a private gem server, and force the Gemfile to source to it, then I have my testing ground fixed until I get more code out publicly.
alexherbo29 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
<havenwood>
ewanchic: So you're using a #source block in your Gemfile and serving the gem yourself?
<havenwood>
ewanchic: Alternatively, you could use a private GitHub repo or point to a local path where the gem is located.
<AndreYuhai>
ewanchic, I guess here might be the problem that I was trying to explain.
<ewanchic>
haevnwood: yes and no. I want to make most of it open source, but I'm hoping to make a section of it as a subscription based. It's where coders can use most of freight for free, but if they want more predone code, you can get that from a subscription. I know I'm being generalized here, but I would like to bouce off these concepts with you and others to see if this is a fair business model or not.
<AndreYuhai>
ewanchic, So I was trying to get that blob object with mentioned values and he did it with ActiveStorage::Blob.create_before_direct_upload!(params)
<havenwood>
ewanchic: I'd personally prefer to use a private GitHub repo than bother with a gem server if there weren't other people involved, especially.
<havenwood>
ewanchic: You can just point your Gemfile to a repo.
<ewanchic>
AndreYuhai: Awesome! Glad you found what you were looking for!
<simonfromspace>
havenwood, changed file structure as instructed and pushed. gonna test rspec now that the shabang has been made
<simonfromspace>
Still getting the same error.
<havenwood>
simonfromspace: Where'd your lib/ dir go!?
<havenwood>
simonfromspace: Make sure you committed everything?
<AndreYuhai>
ewanchic, thank you for the help :)
<ewanchic>
havenwood: So, If I saved the freight-x.x.x.gem files in gems.wanchic.com, and then wrote a source block to just get gem 'freight' from here, then later in gem 'freight' it would just grab it from gems.wanchic.com ?
<havenwood>
simonfromspace: Oh, I dunno what I was looking at. It's back.
<ewanchic>
AndreYuhai: Hey, my pleasure! Good luck to you and God bless!
<havenwood>
simonfromspace: This should be: require_relative '../lib/eztv_scraper.rb'
<havenwood>
simonfromspace: Then the file structure should mirror the namespace, so EztvScraper in lib/eztv_scraper and EztvScraper::JSON in lib/eztv_scraper/json.rb, etc.
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
<havenwood>
simonfromspace: Then have spec/spec_helper.rb be the only thing that requires the entry point for the lib, which requires everything else.
<simonfromspace>
I would like to make this into a gem. That would be pretty cool.
cliluw has quit [Read error: Connection reset by peer]
<havenwood>
simonfromspace: I'd focus on the directory and file structure and matching namespace first. We can help get it in order, then it's easy to cut a gem.
cliluw has joined #ruby
<simonfromspace>
"cut a gem", guessing that's a thing Rubyists say, but firts time hearing it sounds sleek.
cliluw has quit [Read error: Connection reset by peer]
<simonfromspace>
s/firts/first
cliluw has joined #ruby
<ewanchic>
havenwood: I'm trying to implement git right now. the reason the localhost won't work is I export my code right to a server and it needs to download new gems. It's doesn't have the path to freight.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<ewanchic>
havenwood: also, recopying gems in rvm for a new gemset is taking a while. Sometimes it locks up on nokogiri or sassc gems and sits there for a long time before continuing. Just trying to make this go faster.
<havenwood>
ewanchic: I don't know what you're doing, so hard to make suggestions. At the surface level, sounds like you might want to bundle and offline RVM with full gemset and move it over all at once: https://rvm.io/rvm/offline
Esa_ has quit []
Bounga` has joined #ruby
seenseen has joined #ruby
TinderFX has quit [Ping timeout: 240 seconds]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
NewAlexandria has joined #ruby
Bounga` has quit [Ping timeout: 240 seconds]
jcalla has quit [Ping timeout: 268 seconds]
StoneCypherMac has quit [Ping timeout: 260 seconds]
m_antis has joined #ruby
buckworst has quit [Quit: WeeChat 2.7]
markopasha has quit [Remote host closed the connection]
citizentwo has quit [Remote host closed the connection]
markopasha has joined #ruby
StoneCypherMac has joined #ruby
phage has quit [Ping timeout: 268 seconds]
AndreYuhai has quit [Quit: Leaving]
phage has joined #ruby
NewAlexandria has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
xco has joined #ruby
hiroaki has quit [Ping timeout: 272 seconds]
phenom has quit [Quit: See ya! Wouldn't want to blah blah..]
phenom has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bounga` has joined #ruby
jintseng has quit [Ping timeout: 240 seconds]
seenseen has quit [Read error: Connection reset by peer]
leitz has quit [Quit: Leaving]
hiroaki has joined #ruby
Mallot1 has joined #ruby
Bounga` has quit [Ping timeout: 272 seconds]
<Mallot1>
Hello, why does line 11 give me the Lint "Status must be >=100 seen as integer" error? Code (Error is at the bottom): https://dpaste.org/Av9J
StoneCypherMac has quit [Ping timeout: 260 seconds]
citizentwo has joined #ruby
coffeex3 has joined #ruby
StoneCypherMac has joined #ruby
davidw has joined #ruby
royal_screwup21 has joined #ruby
citizentwo has quit [Ping timeout: 240 seconds]
<_phaul>
Mallot1: there are a few thing's I spot, these are local syntactic ones, but I'm unsure about what the code does as whole.. fisrt thing class level @record_id has no relation to @record_id at the instance methods. Second you are using === which is the case equality, when you probably mean == (normal equality)
jottr_ has quit [Ping timeout: 240 seconds]
<_phaul>
&>> class X; @record_id = 'class level'; def foo; @record_id; end; end ; X.new.foo
<_phaul>
ok. let's make a step back. You probably should make those methods class methods - as you have already done, because they don't operate on an instance of the class but on the class itself. We can just make this code "work" either way, but this is *the* real reason. After this change use @record_id consistently everywhere I can still see self.record_id on line 44.
<_phaul>
After that I also pointed out that at the top you don't need @record_id = nil, because instance variables don't need declaring like that
citizentwo has quit [Remote host closed the connection]
<_phaul>
and you still have the same issue?
<Mallot1>
yes
<Mallot1>
_phaul: Line 11 causes the error
<Mallot140>
_phaul: I mean line 8
TCZ has quit [Quit: Leaving]
<_phaul>
hm. seems bit more debug is needed, I can't see any obvious reason from the code
<leftylink>
well
<leftylink>
s/well./
<leftylink>
s/well//
<Mallot1>
_phaul: Okay, thanks so far
<Mallot1>
leftylink: lol
<_phaul>
there are things I find confusing about the code, about how it uses active record, but that's different question
StoneCypherMac has quit [Ping timeout: 240 seconds]
<_phaul>
you don't save invalid objects in the database. And what you get back from the database should already be valid
<_phaul>
normally..
<leftylink>
I don't see where the code for the /createtestcar is defiend so I don't think we have enough information to answer the question at all
<_phaul>
create will I think throw exception if you tried to save an invalid object. So all the validity check are a bit fishy
my_dude has quit [Quit: ZZZzzz…]
<Mallot1>
I see
Mallot1 has quit [Remote host closed the connection]
Mallot140 has quit [Remote host closed the connection]
StoneCypherMac has joined #ruby
bsdbandit-01 has quit [Ping timeout: 260 seconds]
splud_wurk has joined #ruby
bsdband29 has joined #ruby
my_dude has joined #ruby
jottr has joined #ruby
<_phaul>
probably the biggest confusion here is that it's inheriting ActiveRecord::Base. as it should be just having an instance of a record but it itself is not a kind of ActiveRecord..
jottr_ has quit [Ping timeout: 265 seconds]
my_dude has quit [Client Quit]
impermanence has quit [Ping timeout: 258 seconds]
<_phaul>
also violating Liskov probably. trying to limit existing broader functionality
DTZUZU has joined #ruby
DTZUZU2 has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 240 seconds]
my_dude has joined #ruby
markopasha has quit [Remote host closed the connection]