asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ - API: http://crystal-lang.org/api/ - Logs: http://irclog.whitequark.org/crystal-lang
<vikaton> project/./libs/moonshine
<vikaton> my src code when i want to require moonshine is
<vikaton> project/src/hello.cr
<vikaton> require "moonshine" gives an error
<waterlink> how did you installed moonshine in libs?
<vikaton> crystal deps
<waterlink> I have added `github "dhruvrajvanshi/Moonshine"` to my Projectfile and did `crystal deps` and got this dir structure: dhruvrajvanshi/Moonshine
<waterlink> Which is correct. Moonshine -> ../.deps/dhruvrajvanshi/Moonshine
<waterlink> * ../.deps/dhruvrajvanshi-Moonshine/src
<waterlink> ah I see. The problem in capital character here :)
<vikaton> o
<waterlink> So there is 2 things that you can do
<waterlink> specify `github "dhruvrajvanshi/moonshine"` (notice non-capital `moonshine`)
<waterlink> or `require "Moonshine/moonshine"`
<waterlink> *there are 2 things
<vikaton> oh thanks
<vikaton> alot !
wanderer_ has quit [Quit: Page closed]
sfcgeorg_ has joined #crystal-lang
sfcgeorge has quit [Ping timeout: 276 seconds]
waterlink1 has joined #crystal-lang
waterlink has quit [Ping timeout: 272 seconds]
Ven has joined #crystal-lang
willlll has quit [Quit: willlll]
zipR4ND1 has joined #crystal-lang
zipR4ND has quit [Ping timeout: 256 seconds]
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
<vikaton> "hi".bytesize
<vikaton> >> "hi".bytesize
<DeBot> vikaton: 2
sfcgeorg_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven has quit [Read error: Connection reset by peer]
zipR4ND1 has quit [Ping timeout: 265 seconds]
waterlink1 has quit [Ping timeout: 256 seconds]
willlll has joined #crystal-lang
<vikaton> whats the difference between any empty method vs abstract?
DerisiveLogic has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Quit: Leaving...]
willlll has quit [Quit: willlll]
ponga has joined #crystal-lang
willlll has joined #crystal-lang
willlll has quit [Quit: willlll]
j0hnnyk has quit [Remote host closed the connection]
zz_Cidan is now known as Cidan
panga has joined #crystal-lang
Cidan is now known as zz_Cidan
ponga has quit [Ping timeout: 256 seconds]
leex has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
BlaXpirit has joined #crystal-lang
<ddfreyne> vikaton: An abstract method will cause a compilation error if you try to invoke it. You cannot invoke an abstract method.
wanderer_ has joined #crystal-lang
<crystal-gh> [crystal] rhysd opened pull request #613: Fixed lexing octal characters (master...fix-lexing-octal) http://git.io/vJuB2
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
JBat has joined #crystal-lang
<wanderer_> jhass: hi
<jhass> wanderer_: hey
<wanderer_> I commited it to my local copy
<wanderer_> what should I do now? :)
<jhass> okay, cool, do you have a commandline?
<jhass> (where git commands work)
<wanderer_> I also tried to pull the new 48 commits, but there were merging errors
<wanderer_> yes
<jhass> okay, so git status shows now a bunch of both modified?
<wanderer_> I reverted it
<wanderer_> SourceTree shows 1 commit to push and 48 to pull
<jhass> what does git status report now? git log -1 shows your commit?
<wanderer_> $ git status On branch master Your branch and 'origin/master' have diverged, and have 1 and 48 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean
<jhass> okay, we'll have to chew through the merge conflicts
<jhass> so run git pull again
<jhass> git status will then report all conflicting files as both modified
<jhass> you have to open them in an editor, they'll have conflict markers
<jhass> <<<<<<<<<<<
<wanderer_> shouldn't I first fork and push it? so maybe others like you could reproduce the merge conflicts?
<jhass> upstream changes
<jhass> ==========
<jhass> your changes
<jhass> >>>>>>>>>>>>>>>>>
<DeBot> jhass: Syntax error in eval:3: unexpected token: >>
<jhass> :D
<jhass> wanderer_: nah, you committed now, we can always find a way back ;)
<wanderer_> ok
<wanderer_> I'll pull the 48 commits with SourceTree
<jhass> so, you have to remove the conflicts
<jhass> run git add on the file if you removed all conflict markers
<jhass> if git status shows no longer any file as both modified, run git commit without arguments
<wanderer_> I pulled now, why does sourcetree show the majority of files as being marked, but e.g. src/dir.cr, src/event/event.cr and 3 more files as not marked?
<wanderer_> those are the conflict files I think
<jhass> I suppose, I don't know sourcetree at all
<wanderer_> yes, 5 files with conflicts, the rest is either modified or deleted
<jhass> which is why I asked for a commandline
<wanderer_> Unmerged paths: (use "git add <file>..." to mark resolution) both modified: src/dir.cr both modified: src/event/event.cr both modified: src/event/lib_event2.cr both modified: src/io/c_file_io.cr both modified: src/string.cr
<jhass> yes, so open these in an editor and look for the markers :)
<wanderer_> k
<wanderer_> hmm
<wanderer_> ..
<wanderer_> <<<<<<< HEAD ======= fun rewinddir(dir : Dir*) fun glob(pattern : UInt8*, flags : GlobFlags, errfunc : (UInt8*, Int32) -> Int32, result : Glob*) : Int32 fun globfree(result : Glob*) >>>>>>> c82b8f546ef093206038b818f951938c430ddcaa
<wanderer_> that's the first one
<jhass> okay, then the top one is yours and the bottom one is upstream I guess, I'm always confused :P
<wanderer_> sry, but what am I supposed to do with it?
<jhass> see how this commit added it?
<jhass> you want to change the file into a working state
<jhass> so remove all markers and replace them with the right things
<wanderer_> why is there a conflict though? there is nothing between <<<<<<< and =======
<jhass> if you commit, there should be no longer any <<<<<<<, =======, or >>>>>>> markers
<jhass> you didn't touch the glob lines?
<jhass> like wrapping them into an ifdef?
<wanderer_> yes, that's what I did
<jhass> moving them somewhere else perhaps?
<jhass> see, so rewinddir was added, you removed two lines
<wanderer_> makes sense, I was kinda confused how the diff algorithm works
<jhass> you probably want to keep the new rewinddir line and remove the glob lines that you moved away
<jhass> or move the rewinddir somewhere else, though it's okay if you just resolve the conflicts for now and make it work again in a new commit after the merge is complete
<wanderer_> ok, so after that I remove the whole <<<<<<< >>>>>>>-thing?
<wanderer_> after removing the conflicts I also got to port the new functionality to windows again
<BlaXpirit> remove all the <<< === >>> markers, but pick the code between them
<BlaXpirit> sometimes you just pick code above ===, sometimes you pick code below === but most often you need to find the best of both pieces of code
<jhass> wanderer_: focus on resolving the conflict for now, make as many changes so it compiles again (not necessarily link, just syntactically)
<jhass> if you did that for all markers in a file, run git add on it
<wanderer_> simply `git add` or with every file?
<jhass> git add src/dir.cr in this example
<jhass> so with every file
<wanderer_> should I first check whether it still compiles and then git add, or does it not matter?
<jhass> checking for syntax errors can't harm, but if you're confident that there are none... ;)
<BlaXpirit> wanderer_, it kinda doesn't matter, you don't even need to add, really, until you're ready to commit.
<jhass> it helps to track progress and not forget something though
<BlaXpirit> you can add then see something is wrong so you just add it again, no big deal
<jhass> note that if you ran git add on a file and then made more changes you want to be included, you need to git add it again
waterlink has joined #crystal-lang
<wanderer_> when I'm in Dir#rewind why can't I write `new @path`? :s it says "undefined method 'new' for Dir"
<jhass> you resolved the conflicts already?
<jhass> sounds like your adapting already...
<wanderer_> yes, I did
<jhass> and ran git commit ?
<wanderer_> only need to adapt this small function
<wanderer_> as for the conflicts
<jhass> I'm confused now
<jhass> did you resolve all conflicts and all files?
<jhass> *in all files?
<wanderer_> yes
<jhass> and ran git commit ?
<wanderer_> no, I quickly wanted to adapt Dir#rewind because it's just a small change
<jhass> well, rewind is an instance method
<jhass> new is a class method
<jhass> but I still wouldn't do it in the merge commit
<wanderer_> ok, I'll commit without it
<wanderer_> `Dir.open @path` seems to work btw
<jhass> okay, did you fork the repo on Github already?
<wanderer_> no
<wanderer_> now just git commit without any message?
<jhass> yes
<jhass> since it's a merge commit Git will prefill a good one
<wanderer_> oh wow, it opened vim
<wanderer_> with lots of.. unicode characters, I don't know
<wanderer_> unicode errors*
<jhass> .... windows :P
<jhass> just save & quit, we'll see
<jhass> :wq
<wanderer_> did :q!
<jhass> uh, I'm not sure but I think that aborts
<jhass> git status shows everything clean now?
<wanderer_> the file was .git I think
<jhass> somewhere in .git, yeah
<wanderer_> hm, why would git commit open some file from /.git/?
<wanderer_> On branch master Your branch is ahead of 'origin/master' by 2 commits (use "git push" to publish your local commits) nothing to commit, working directory clean
<jhass> okay, nice
<jhass> it does that so you can enter a proper commit message ;)
<jhass> -m only allows for single line messages
<wanderer_> ah
<jhass> so, time to click fork on github
<jhass> what's your github username btw?
<wanderer_> xwanderer
<wanderer_> do I have to select a specific branch before clicking on fork?
<jhass> no
<jhass> okay, great
<jhass> now I'll drop a series of commands for your to get you setup properly
<jhass> git branch -m master windows_support
<jhass> git checkout -b master origin/master
<jhass> git remote add fork https://github.com/xwanderer/crystal.git
<jhass> git checkout windows_support
<jhass> git push fork windows_support
<wanderer_> windows_support would be the branch name? how about win32 or windows-support? :o
<BlaXpirit> - is better than _
<jhass> yes, you can pick anything, just use it consistently ;)
<BlaXpirit> according to crystal repo
<jhass> I use hub a lot, hub checkout some_pull_request_url creates a local branch username-branchname, so _ kinda looks nicer to me :P
<jhass> it's preference and not really important
<wanderer_> does `git branch -m master win32` change master to win32, so I don't have master anymore or why the checkout?
<jhass> yes
<jhass> it renames the branch
<jhass> it's all just pointers to commits, but it's nice to keep master and origin/master in sync
<wanderer_> does `git remote add fork https://...` change something on my github account?
<jhass> no
<wanderer_> so the `git checkout win32` gets it locally and pushes it then?
<jhass> that just creates a name for the URL so you can use it instead of typing it all the time
<jhass> yes, that's just so you're back to the branch you want to continue to work on
<wanderer_> thanks :)
<jhass> now you can enter a normal development cycle, make changes, git commit, git push fork win32
<wanderer_> what do I do when I want to pull from crystal/master?
<jhass> git pull origin master
<BlaXpirit> nice
<wanderer_> oh, it ignored the libs
<wanderer_> I actually wanted to commit them as well, so you don't have to compile 15 libs yourself
<jhass> how big are they?
<jhass> once they're committed to the master branch they'll bloat the repo for eternity :/
<wanderer_> 60 MB
<jhass> maybe we can host them somewhere and add a script to download them?
<BlaXpirit> nope nope
<jhass> yeah, way too big
<wanderer_> well, llvm.lib is 45 MB alone
<wanderer_> without llvm it's still 14 MB
<wanderer_> adding a script to download isn't as easy as on linux
<wanderer_> I'm not even sure if there's a standard tool to download something
<BlaXpirit> um look...
<wanderer_> I could add a regular download
<BlaXpirit> distribution for Windows should be in binary form
<BlaXpirit> for now you can just post these libs on any random file hosting for people who want to try windows or join you
<BlaXpirit> but later these libs would just be included in binary archive download or installer
<wanderer_> yes, that's what I had in mind
<jhass> I'm sure asterite will upload them to the crystal S3 bucket if we ask
<jhass> but yeah, don't commit
<BlaXpirit> then again... https://git-lfs.github.com/
<wanderer_> it's 60 MB libs + 24 MB crystal.exe + 118 MB libllvm-3.5.1.a & libllvm-3.6.0.a ^^;
<BlaXpirit> but nah
<wanderer_> everything is saved in the .git-folder isn't it? so I could e.g. rename my local folder and move it
panga has left #crystal-lang ["Leaving..."]
panga has joined #crystal-lang
<jhass> wanderer_: yes
<wanderer_> jhass: why can't I call `self.new @path` in rewinddir?
<jhass> you can, it's just another new
<jhass> self.class.new should work
<wanderer_> oh, self is the instance, and new is a class method
<jhass> initialize(@path) should work too, but ugh
<jhass> yes
<jhass> (work too != equivalent)
<wanderer_> new would alloc a new object and initialize kinda resets the current one
<jhass> kinda, it doesn't actually reset anything, initialize is just a normal method you can call again
<jhass> def self.new(*args, &block); obj = allocate; obj.initialize(*args, &block); obj; end
<jhass> that's new, basically
<BlaXpirit> just realized the naming is opposite in Python
<BlaXpirit> nvm
waterlink has quit [Quit: Leaving.]
ponga has joined #crystal-lang
panga has quit [Ping timeout: 245 seconds]
harisamin has joined #crystal-lang
j0hnnyk has joined #crystal-lang
<jeromegn> how can I define a variable outside of a Proc that will hold a value of a certain type later (but not yet)
<jhass> jeromegn: foo :: Type
<jeromegn> :+1:
<jhass> but consider making it a return value of your proc
<jhass> for example use a tuple as return value if you have to return multiple values
<jeromegn> I’m doing a Array#each
<jhass> and?
* jeromegn looks at the API docs
<jhass> >> [1, 2, 3].find {|x| x.even? }
<DeBot> jhass: 2
<jhass> maybe you want something like that?
<jeromegn> I might :)
<jeromegn> yea that works. moved around some logic. thanks!
<jhass> jeromegn: in general if you have some iteration and modify state declared outside of the iterations body, there's often a better way ;)
<jeromegn> it’s a simple router, I’m going through each route to see if it matches, if it does I “execute” it and then if that’s the end of the request I return the response from that route (there can be many routes / middlewares for the same url)
<jeromegn> response = Response.new
<jeromegn> route = @routes.find do |route|
<jeromegn> route.exec(request, response) if route.matches?(request)
<jeromegn> response.sent?
<jeromegn> end
<jeromegn> in any case, this works now :)
<jhass> yup, find looks good there
<jeromegn> sorry for the paste here
<jhass> there's also stuff like .any?, all? etc
<vikaton> >> [1,3,4].each {|x| x.even? }
<DeBot> vikaton: [1, 3, 4]
sfcgeorge has joined #crystal-lang
<vikaton> 0k
<jeromegn> is there a better way to do variable args for instantiation than: https://gist.github.com/jeromegn/9019fd9309a75d3f4087
<vikaton> we really should change the empty method syntax
<jhass> no
<jhass> vikaton: ^
<vikaton> jhass, do I have to create a class for each ecr file?
<jhass> yeah
<vikaton> o boi
<jhass> jeromegn: mh, I don't think crystal supports non-trailing default args yet
<jeromegn> yea, I can probably just reorder the args since this is an internal thing
<jhass> jeromegn: else you could use default args there
<crystal-gh> [crystal] asterite closed pull request #613: Fixed lexing octal characters (master...fix-lexing-octal) http://git.io/vJuB2
<travis-ci> manastech/crystal#2286 (master - 227dfb4 : Ary Borenszweig): The build was fixed.
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
harisamin has joined #crystal-lang
wanderer_ has quit [Quit: Page closed]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vJzxp
<crystal-gh> crystal/master cafea07 Will Leinweber: Allow Time.parse to return UTC times
<crystal-gh> crystal/master 6f3434a Ary Borenszweig: Merge pull request #608 from will/utc-time-parse...
<travis-ci> manastech/crystal#2287 (master - 6f3434a : Ary Borenszweig): The build has errored.
harisamin has quit [Quit: Textual IRC Client: www.textualapp.com]
havenwood has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vJgi4
<crystal-gh> crystal/master 26c132e Nate West: Init handles dashes in project names
<crystal-gh> crystal/master 387ce19 Ary Borenszweig: Merge pull request #602 from niftyn8/init-with-dash...
willlll has joined #crystal-lang
<travis-ci> manastech/crystal#2288 (master - 387ce19 : Ary Borenszweig): The build failed.
blaix has joined #crystal-lang
waterlink has joined #crystal-lang
blaix has quit [Quit: Leaving.]
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
ismaelga has joined #crystal-lang
willlll has joined #crystal-lang
willlll has quit [Quit: willlll]
wanderer_ has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
c355E3B has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 256 seconds]
<wanderer_> jhass: apparently I now have the master branch and the win32 branch locally, do I need both? when I merge commits from origin master into win32, the master branch seems to be unaffected
flan3002 has left #crystal-lang ["Have an awesome day!"]
<jhass> wanderer_: they don't really take up any extra space, so don't worry ;)
<jhass> a branch is just a pointer to a commit that can be moved
<jhass> a tag is a pointer to a commit that can't be moved
<wanderer_> but it seems like I would need to pull new commits twice, once for master and another time for win32
<jhass> if you want to update your local master pointer, yes
<wanderer_> uhm, ok thx
<jhass> I guess you'll be primarily working in the win32 branch, so you'll have little need to actually update your local master branch ;)
<wanderer_> that doesn't mean I should delete it, though, does it?
<wanderer_> git and github are rather complex
<jhass> yeah, keep it, it doesn't harm and can be handy sometimes ;)
<jhass> as said, it doesn't actually take up extra space
<wanderer_> ah, yeah saw a link to that once and actually saved the url somewhere
<wanderer_> thx again, btw. should I now do a pull request?
<fowl> You committed your work wanderer_ ? :)
<jhass> wanderer_: yeah why not, it can't harm. You can always update a pull request
<wanderer_> would it create a new "win32" branch @manastech/crystal, too?
<fowl> Cool wanderer_ I'll try it out
<fowl> & no you do the pull request targeting crystal/master
ponga has quit [Quit: Leaving...]
willlll has joined #crystal-lang
<jeromegn> so, listen_fork is broken right now? trying to spawn a few workers for an http server and I found that method. looks like there’s an issue open about it (I’m getting the same error)
<jeromegn> btw, I love the language at the moment, just trying to figure out what I can use now
ismaelga has quit [Remote host closed the connection]
<vikaton> !!!
<vikaton> Crystal Moonshine rekts Rust Iron
<jeromegn> rekts? :)
<vikaton> wrecks
<jeromegn> the API is quite nice
<vikaton> ok something is not right here
JBat has quit [Quit: Computer has gone to sleep.]
<fowl> What's moonshine
<vikaton> Crystal webframework
HakanD has joined #crystal-lang
c355E3B has quit [Quit: Connection closed for inactivity]
<vikaton> Results are in
willlll has quit [Quit: willlll]
vikaton has quit []
ismaelga has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
sfcgeorge has quit [Remote host closed the connection]
sfcgeorge has joined #crystal-lang
willlll has joined #crystal-lang
vikaton has joined #crystal-lang
<vikaton> aloha
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
sfcgeorg_ has joined #crystal-lang
sfcgeorge has quit [Ping timeout: 256 seconds]
sfcgeorg_ is now known as sfcgeorge
<jeromegn> vikaton: interesting benchmark
<jeromegn> I’m building an Express.js-style framework, I pulled 30.5K RPS (vs 24.6K for Moonshine)
<vikaton> oooo
<vikaton> jeromegn: nice !
<jeromegn> not that it’s important
<jeromegn> the API is king for me
<jeromegn> but yes the default HTTP::Server is pretty nice
<vikaton> yeah lol
zz_Cidan is now known as Cidan
<strcmp1> is 24k not rather low
wanderer_ has quit [Quit: Page closed]
<vikaton> strcmp1: on a 512 mb RAM vps? nahh
Cidan is now known as zz_Cidan
ismaelga has joined #crystal-lang
<jeromegn> I’m actually on a 2013 MBP Retina
<jeromegn> but the settings were probably a bit low on `wrk`
BlaXpirit has quit [Quit: Quit Konversation]
<vikaton> jeromegn: think we should add this to techempower?
<jeromegn> I’d like to know what they’re using for testing and with what settings
<jeromegn> oh
<vikaton> yeah
<vikaton> think we should do it?
waterlink has quit [Ping timeout: 264 seconds]
<jeromegn> why not :)
<crystal-gh> [crystal] asterite pushed 9 new commits to master: http://git.io/vJaWL
<crystal-gh> crystal/master 4773272 Ary Borenszweig: Use T.zero as the initial value in Enumerable#sum. Related to #497
<crystal-gh> crystal/master 464c502 Ary Borenszweig: Fixed #599 (again T_T)
<crystal-gh> crystal/master b88a172 Ary Borenszweig: Added Array#product without a block
aemadrid has joined #crystal-lang
sfcgeorge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sfcgeorge has joined #crystal-lang
<travis-ci> manastech/crystal#2289 (master - f5fb91e : Ary Borenszweig): The build is still failing.
<jeromegn> stack traces are beautiful in Crystal