<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
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>
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
<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)
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_>
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]