<centrx>
HamCube, You'll note under /lib/, which is where the code is, that there is a thor.rb and then a directory thor
<HamCube>
Solid
<centrx>
HamCube, The outer file will typically include (require) the files in the directory
<centrx>
HamCube, In this case, the outer file (thor.rb) also has code in it, not just scaffolding for file/class dependencies
jevs_ is now known as jevs
<HamCube>
Clever. Alright, I'll work with that layout.
keolo has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
ecnalyr has quit [Remote host closed the connection]
ecnalyr has joined #ruby-lang
ecnalyr has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
<HamCube>
centrx: In the bin/thor file, where is the Thor::Runner.start method? I'm poking around and not finding any reference to such a method.
<HamCube>
I get that :: is for namespace resolution, but prehaps I'm looking in the wrong place for a start method
<centrx>
HamCube, Do a grep in the complete directory for "def start"
<centrx>
HamCube, You'll see #start is defined in the Base module (Thor::Base)
<HamCube>
and there it is.
<centrx>
HamCube, Base is include'd in the Thor class in the toplevel thor.rb (See Mixins)
<centrx>
HamCube, and Thor::Runner inherits from Thor
<HamCube>
Is that the typical means for defining an entry point in a ruby application?
yubrew has joined #ruby-lang
<HamCube>
Similar to java's public static void main
<centrx>
No
<centrx>
"start" is a good method name of course for starting
<centrx>
But there is nothing uniquely standard about it
<HamCube>
Alright then. This is good to know.
<HamCube>
I've been beaten in the head by random off-the-wall questions so far, so this is helpful to know.
kukyakya has joined #ruby-lang
stardiviner has joined #ruby-lang
yubrew has quit [Read error: Operation timed out]
<HamCube>
ls
<HamCube>
aw man. Party foul.
bzalasky has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
<centrx>
HamCube, Don't forget to learn about blocks
alexju has quit [Remote host closed the connection]
<HamCube>
centrx: Yup, am I close in assuming these are more or less lambdas?
<centrx>
HamCube, That is a fair analogy, but a) Ruby has lambdas/procs, which are not blocks, and b) the usage of Ruby methods with blocks is very powerful, it allows a level of power/expressiveness usually found only in functional programming languages
<HamCube>
centrx: I've been going down the Scala path so I have a passing famalarity with FP
kyb3r_ has joined #ruby-lang
<HamCube>
I can appreciate their usefulness, part of the reason I'm continuing with ruby
<HamCube>
More than that I can appreciate that it's so damned fast to develop with. I'm jealous.
<centrx>
Ruby is optimized for programmer happiness
<HamCube>
Seems that way.
<HamCube>
I could get used to it. All I need to do is become conversent with it in... 24 hours.
<HamCube>
heh
vadviktor has quit [Ping timeout: 240 seconds]
vadviktor has joined #ruby-lang
ItSANgo__ has quit [Quit: Leaving...]
khaase has joined #ruby-lang
<HamCube>
How is Thor running Thor::Runner.start when that method is not static?
bzalasky has quit [Remote host closed the connection]
<centrx>
HamCube, What do you mean static?
yfeldblum has joined #ruby-lang
<HamCube>
example:
<HamCube>
def self.go
<HamCube>
puts "Hello, world!"
<HamCube>
end
<HamCube>
I can invoke that without creating a new object
<HamCube>
with Foo.go
<HamCube>
Now, Thor's base class doesn't have a self.start method
<HamCube>
So I'm unclear as to how it bootstraps whithout instantiating a Runner object
<centrx>
#start is actually inside of another module, called ClassMethods
<HamCube>
*note, I realize my assumptions are incorrect
<centrx>
This name is a common convention
khaase has quit [Ping timeout: 246 seconds]
<centrx>
If you search for def included in the same file
<centrx>
That is a callback that is called anytime a module is included (e.g. include Base)
<centrx>
Then then runs base.extend(ClassMethods), which attaches the methods in ClassMethods as class methods (static methods)
<centrx>
include attaches instance methods
<centrx>
extend attaches class methods
<HamCube>
Mental digestion happening.
alexdaube has quit [Remote host closed the connection]
<centrx>
HamCube, ActiveSupport is a library that is part of Rails which has a lot of useful things that people use outside of Rails too
<HamCube>
Irissi/urxvt is giving me hell copying the link, but I'll come back to that
alexdaube has joined #ruby-lang
<HamCube>
Yea, this is over my head at the moment.
<HamCube>
Ok, so this is off base from my goal... but the bin executable doesn't actually *work*
<HamCube>
I presume that's a result of not having the gem installed properly
<HamCube>
require can't load the thor/runner.rb file which looks like a classpath* issue
<HamCube>
Replicating the technique, I can get around it with reletive paths (ex: ../lib/foo/class)
<HamCube>
But that's a hack - yet I'm unclear how thor's accomplishing it.
<HamCube>
My goal is to follow the PickAxe book chapter by chapter. Such that, lib/ch1, lib/ch2... etc would exist
<HamCube>
and I would update the bin/pickaxe file to follow what chapter I'm working on
<HamCube>
I'd prefer to avoid static methods and keep with best practices. If that requires some scaffolding - I'm fine with that.
<centrx>
HamCube, Yeah you can create your rb files and run them with the ruby binary
postmodern has quit [Quit: Leaving]
<centrx>
HamCube, I don't know how Thor works internally. It is a gem so it would normally be installed as a gem and then it would all be in your path, and it would be used as part of another program for the command-line fucntionality
<HamCube>
Which makes sense, since as a standalone application it would not be very useful.
<HamCube>
In the interest of time I'm going to go with using a static method to kick things off.
<HamCube>
That's the java seeping into ruby.
<centrx>
Java causes brain damage
<centrx>
Good luck
<centrx>
HamCube, Also FYI, there is another channel on Freenode, #ruby
<HamCube>
You know Java's the reason why twitter had a 140 character limit.
<centrx>
HamCube, And there's also #rubyonrails which might be relevant since Rails is one of the most popular uses of Ruby
<centrx>
HamCube, Really? Why
<HamCube>
Because no one wanted to hear about a HttpStaticResponseFactoryReferenceFactoryNullPointerExcpetionFactoryBuilder
<HamCube>
factory.
<centrx>
Good one :P
<HamCube>
And I think I'm going to stay focused on Ruby proper before diving into rails.
<HamCube>
Do you think I'm incorrect in thinking in that order? Ruby before Rails?
<centrx>
That makes sense
<centrx>
Those channels are just usually a lot more active than this one, so if you only have 24 hours or want to see what people in the Ruby world are talking about...
<centrx>
Although nights and weekends are not generally the most active time on Freenode in general
<HamCube>
I think you've given me plenty to chew on. More than I can handle in 24h on top of the Dave Thomas book
yfeldblum has quit [Ping timeout: 240 seconds]
bzalasky has joined #ruby-lang
anannie has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
sdouglas has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
marcdel has quit []
yubrew has joined #ruby-lang
PaulePanter has quit [Remote host closed the connection]
mr-foobar has joined #ruby-lang
yubrew has quit [Ping timeout: 252 seconds]
miqui has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
mr-foobar has quit [Ping timeout: 240 seconds]
jackhammer2022 has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
alexdaube has quit []
postmodern has joined #ruby-lang
sdouglas has quit [Remote host closed the connection]
alexju has joined #ruby-lang
Cakey has quit [Ping timeout: 252 seconds]
kukyakya has quit [Remote host closed the connection]
charlies_ has joined #ruby-lang
charliesome has quit [Ping timeout: 252 seconds]
khaase has joined #ruby-lang
bzalasky has quit [Ping timeout: 240 seconds]
bzalasky has joined #ruby-lang
khaase_ has joined #ruby-lang
bzalasky has quit [Read error: Connection reset by peer]
bzalasky has joined #ruby-lang
charlies_ has quit [Ping timeout: 270 seconds]
khaase has quit [Ping timeout: 246 seconds]
DevDoo has joined #ruby-lang
khaase_ has quit [Read error: Operation timed out]
levifig_ is now known as levifig
centrx has quit [Quit: All this computer hacking is making me thirsty]
centrx has joined #ruby-lang
charliesome has joined #ruby-lang
stardiviner has quit [Ping timeout: 264 seconds]
Pain has joined #ruby-lang
Pain has quit [Changing host]
Pain has joined #ruby-lang
keolo has quit [Quit: keolo]
sdouglas has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
amclain has quit [Excess Flood]
amclain has joined #ruby-lang
sdouglas has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby-lang
jsullivandigs has joined #ruby-lang
rahul_j has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
yubrew has quit [Ping timeout: 240 seconds]
rue|w has quit [Ping timeout: 240 seconds]
kotk1 has joined #ruby-lang
kotk has quit [Ping timeout: 240 seconds]
sepp2k has quit [Read error: Connection reset by peer]
khaase has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
khaase has quit [Ping timeout: 246 seconds]
fezziwig has joined #ruby-lang
Pain has quit [Ping timeout: 240 seconds]
kotk1 has quit [Ping timeout: 240 seconds]
phansch has joined #ruby-lang
DevDoo has quit [Remote host closed the connection]
symm- has joined #ruby-lang
DevDoo has joined #ruby-lang
yubrew has joined #ruby-lang
DevDoo has quit [Read error: No route to host]
DevDoo has joined #ruby-lang
rue|w has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
rahul_j has quit [Quit: rahul_j]
|jemc| has quit [Ping timeout: 240 seconds]
jxie has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
rahul_j has joined #ruby-lang
nisstyre has quit [Quit: WeeChat 0.4.3]
dc5ala has joined #ruby-lang
creede has quit [Ping timeout: 240 seconds]
phansch has quit [Quit: WeeChat 0.4.2]
DevDoo has quit [Remote host closed the connection]
rippa has joined #ruby-lang
khaase has joined #ruby-lang
anannie has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
khaase has quit [Ping timeout: 246 seconds]
bzalasky has joined #ruby-lang
marcdel has joined #ruby-lang
anannie has quit [Ping timeout: 252 seconds]
anannie has joined #ruby-lang
anannie has quit [Remote host closed the connection]
Lewix has quit [Remote host closed the connection]
x0f has quit [Ping timeout: 264 seconds]
havenwood has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
x0f has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
sigurding has joined #ruby-lang
<sigurding>
anyone here used the sigar ruby binding?
amclain has quit [Quit: Leaving]
yubrew has quit [Ping timeout: 240 seconds]
anannie has joined #ruby-lang
creede has joined #ruby-lang
rahul_j has joined #ruby-lang
fragamus has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
rahul_j has quit [Quit: rahul_j]
centrx has quit [Quit: All this computer hacking is making me thirsty]
skade has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 240 seconds]
CaptainJet has quit []
anannie has quit [Remote host closed the connection]
mikecmpbll has joined #ruby-lang
diegoviola has quit [Remote host closed the connection]
mr-foobar has quit [Remote host closed the connection]
mr-foobar has joined #ruby-lang
phansch has joined #ruby-lang
vlad_starkov has joined #ruby-lang
charliesome has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
mr-foobar has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Ping timeout: 240 seconds]
arBmind has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby-lang
retro|cz has quit [Ping timeout: 264 seconds]
hahuang65 has quit [Ping timeout: 264 seconds]
Atw has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
matp has quit [Ping timeout: 252 seconds]
atmosx_ has joined #ruby-lang
yubrew has quit [Read error: Operation timed out]
postmodern has quit [Quit: Leaving]
symm- has quit [Ping timeout: 240 seconds]
atmosx_ has quit [Quit: Lost in trance]
vlad_starkov has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
kyb3r_ has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
rahul_j has joined #ruby-lang
anannie has joined #ruby-lang
DevDoo has quit [Remote host closed the connection]
DevDoo has joined #ruby-lang
toretore has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
robmiller has joined #ruby-lang
Cakey has joined #ruby-lang
jxie_ has joined #ruby-lang
inkblot_ has left #ruby-lang [#ruby-lang]
jxie has quit [Ping timeout: 269 seconds]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
drx has quit [Remote host closed the connection]
DevDoo has quit [Ping timeout: 240 seconds]
creede has quit [Ping timeout: 264 seconds]
creede has joined #ruby-lang
rippa has joined #ruby-lang
workmad3 has joined #ruby-lang
yfeldblum has joined #ruby-lang
anannie has quit [Quit: Leaving...]
yfeldblum has quit [Ping timeout: 240 seconds]
mr-foobar has joined #ruby-lang
mehlah has joined #ruby-lang
Speed has joined #ruby-lang
Joel has joined #ruby-lang
Joel is now known as Guest20913
<Guest20913>
I'm going through Hartl's tutorial and I notice that whenever he changes the Gemfile he'll run bundle install --without production then bundle update and then bundle install again. Doesn't bundle install automatically update the gemlock?
Cakey has quit [Ping timeout: 240 seconds]
Guest20913 has quit [Client Quit]
gix has quit [Ping timeout: 265 seconds]
sdouglas has joined #ruby-lang
gix has joined #ruby-lang
sdouglas has quit [Read error: Operation timed out]
yubrew has joined #ruby-lang
mikecmpbll has joined #ruby-lang
Lewix has joined #ruby-lang
chouhoulis has joined #ruby-lang
yubrew has quit [Ping timeout: 240 seconds]
skade has joined #ruby-lang
mr-foobar has quit [Remote host closed the connection]
mr-foobar has joined #ruby-lang
mr-foobar has quit [Ping timeout: 252 seconds]
drx has joined #ruby-lang
DevDoo has joined #ruby-lang
drx has quit [Read error: Connection reset by peer]
drx has joined #ruby-lang
drx has quit [Read error: Connection reset by peer]
drx has joined #ruby-lang
Cakey has joined #ruby-lang
drx has quit [Read error: Connection reset by peer]
drx_ has quit [Read error: Connection reset by peer]
<yorickpeterse>
now I need to get the fucker to deal with HTML5
DevDoo has joined #ruby-lang
<yorickpeterse>
fucking W3 must've been on crystal crack cocaine when "designing" the syntax changes for HTML5
cnivolle has quit [Remote host closed the connection]
robmiller has quit [Ping timeout: 240 seconds]
cnivolle has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
DevDoo has quit [Ping timeout: 252 seconds]
omegahm has quit [Ping timeout: 264 seconds]
drx_ has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
drx_ has quit [Read error: Connection reset by peer]
drx_ has joined #ruby-lang
robmiller has joined #ruby-lang
enebo has quit [Quit: enebo]
vlad_sta_ has quit [Remote host closed the connection]
drx_ has quit [Read error: Connection reset by peer]
cnivolle has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
drx_ has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
drx_ has quit [Read error: Connection reset by peer]
Barrin6 has joined #ruby-lang
drx_ has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
alexju has quit [Remote host closed the connection]
drx_ has quit [Read error: Connection reset by peer]
amclain has joined #ruby-lang
amclain has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
ananna is now known as anannie
drx_ has joined #ruby-lang
yubrew has joined #ruby-lang
Coincidental has quit [Remote host closed the connection]
drx_ has quit [Read error: Connection reset by peer]
yubrew has quit [Ping timeout: 240 seconds]
drx_ has joined #ruby-lang
creede has quit [Ping timeout: 264 seconds]
vlad_sta_ has joined #ruby-lang
vlad_sta_ has quit [Remote host closed the connection]
tonni_ has quit [Remote host closed the connection]
sdouglas has quit [Remote host closed the connection]
Coincidental has joined #ruby-lang
sdouglas has joined #ruby-lang
omegahm has joined #ruby-lang
tonni has joined #ruby-lang
DevDoo has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
DevDoo has quit [Remote host closed the connection]
DevDoo has joined #ruby-lang
creede has joined #ruby-lang
sdouglas has quit [Ping timeout: 240 seconds]
wallerdev has quit [Ping timeout: 240 seconds]
DevDoo has quit [Ping timeout: 240 seconds]
DevDoo has joined #ruby-lang
seanlinsley has quit [Quit: …]
lsegal has joined #ruby-lang
<matti>
;]
seanlinsley has joined #ruby-lang
<yorickpeterse>
(͡° ͜ʖ ͡°)
DevDoo has quit [Remote host closed the connection]
DevDoo has joined #ruby-lang
fijimunkii has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
tylersmith has joined #ruby-lang
sdouglas has joined #ruby-lang
DevDoo has quit [Ping timeout: 240 seconds]
tylersmith has quit [Ping timeout: 240 seconds]
cnivolle has joined #ruby-lang
DevDoo has joined #ruby-lang
wallerdev has joined #ruby-lang
|jemc|_ has joined #ruby-lang
r0bby has joined #ruby-lang
anannie has quit [Ping timeout: 264 seconds]
|jemc| has quit [Write error: Broken pipe]
robbyoconnor has quit [Write error: Connection reset by peer]
brettchalupa has joined #ruby-lang
fijimunk1i has joined #ruby-lang
stardiviner has joined #ruby-lang
stardiviner has quit [Changing host]
stardiviner has joined #ruby-lang
ambulanss has joined #ruby-lang
ambulanss has quit [Client Quit]
nvll has left #ruby-lang ["Wychodzi"]
rubyr has joined #ruby-lang
benanne has joined #ruby-lang
rubyr has quit [Client Quit]
yubrew has joined #ruby-lang
freqn has joined #ruby-lang
fijimunkii has quit [Remote host closed the connection]
canton7 has quit [Remote host closed the connection]
freqn has quit [Client Quit]
ledestin has quit [Quit: ledestin]
yubrew has quit [Ping timeout: 240 seconds]
havenwood has quit [Excess Flood]
chouhoulis has quit [Excess Flood]
bzalasky has quit [Excess Flood]
chouhoulis has joined #ruby-lang
vpretzel has quit [Excess Flood]
mistym has quit [Excess Flood]
Coincidental has quit [Write error: Broken pipe]
mistym has joined #ruby-lang
vpretzel has joined #ruby-lang
anannie has joined #ruby-lang
anannie has quit [Changing host]
anannie has joined #ruby-lang
havenwood has joined #ruby-lang
hahuang65 has joined #ruby-lang
freqn_ has joined #ruby-lang
bzalasky has joined #ruby-lang
Barrin6 has quit [Quit: Leaving]
hahuang65 has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
seanlinsley has quit [Read error: Connection reset by peer]
freqn_ has quit []
freqn has joined #ruby-lang
symm- has joined #ruby-lang
daturkel has joined #ruby-lang
<daturkel>
i'm working on a ruby CLI tool that has a yaml config file it reads from. a few methods across modules need to access the contents of the config file. would best practice to be to instantiate a configuration class with a hash of the yaml file and pass that class instance as an argument to every method that needs it, or is there a better way?
<centrx>
well definitely don't pass it as an argument to every method
amclain has joined #ruby-lang
<daturkel>
what's the best way to basically make it a semi-public variable across modules?
<centrx>
You can reference the configuration class just like "Config" or "::Config"
<centrx>
Or have a method in the modules that references the class