Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy in Ruby world we can do something like gem install rails which creates a rails executable system-wide but that's not possible with crystal atm
@bararchy also i'm lost at how to create an app specific executable since we dont have a system-wide executable
Bar Hofesh
@bararchy
@Sdogruyol Well, we can create a different repo, holding a Amethyst binery, that can create the skeleton folders\files, or, we can just add a Bash script to the "bin" folder, where the bash script can create those scuffoldings, Or, we can staticly compile a Crystal binery that does those too and use that
@/all does anyone knows how to add a "X-Frame-Options" header into the response ?
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy first options sounds good but still it has to be external and people have to do that after creating the project via crystal init app
Bar Hofesh
@bararchy

@Sdogruyol well, when creating an installable Amethyst package, deb\pacman\yum\etc.. you can compile and install an external bin which will allow the user to do something like

amethyst init skeleton

which will create all the folder structure

Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy yep that's what i want but that means we need to create packages for each different distribution :)
Bar Hofesh
@bararchy
@Sdogruyol That, or, it can be a .sh file, or a ruby script etc..
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy yeah that gave me a good idea i'll try to do that
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy @Codcore i made a bin like script for bootstrapping a new Amethyst app https://github.com/Sdogruyol/amethyst-bin
Bar Hofesh
@bararchy
@Sdogruyol Very cool, I think this sould be added to the README
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy hey Bar thanks a lot you gave me the idea :)
Giorgio Pellero
@trapped
hi everyone
I wanted to ask a little question about Amethyst
I'd like to have a middleware that adds html head/etc to the response so that my views do not get bloated
however this does not seem to cut it https://gist.github.com/trapped/127cb61d13ffc29005c5
giving me this (after a series of undefined method/Nil errors): "Error: instance variable '@response' of Headers was not initialized in all of the 'initialize' methods, rendering it nilable"
Bar Hofesh
@bararchy
@trapped Welcome :) would you mind share the view of header ?
I mean the actual .ecr code
Bar Hofesh
@bararchy
@trapped well, this seems like a bug, but, for a quick workaround you could try what @jhass saied in the Crystal IRC chan, or , you can also try to put @partial_body = '' under view to initialize it, this way even if you get a nil value in the code it will be initialized
like
class Headers < Middleware::Base
  view "header",    "#{__DIR__}/views"
  @partial_body = ''

  def call(request)
    response = @app.call(request)
    @partial_body = response.body
    response.body = html render "header"
    response
  end
end
@Codcore what do you think ?
Giorgio Pellero
@trapped
I might be doing something wrong but that still doesn't compile
Bar Hofesh
@bararchy
@trapped Oh, @partial_body = response.body if response.body
Giorgio Pellero
@trapped
same error, keeps complaining that response is Nil
I don't think it's not complaining about @partial_body at all, is it
Bar Hofesh
@bararchy
class Headers < Middleware::Base
  view "header",    "#{__DIR__}/views"
  @partial_body = ''

  def call(request)
    response = @app.call(request)
    @partial_body = response.body if response
    response.body = html render "header" if response
    response
  end
end
Giorgio Pellero
@trapped
also single quotes for partial_body would make it a char
tried, didn't work, same error
Bar Hofesh
@bararchy
:/ apperntly a bug then
@Sdogruyol , @Codcore this is up to you guys now
Giorgio Pellero
@trapped
Bar Hofesh
@bararchy
@trapped Great :)
Serdar Dogruyol - Sedo セド
@sdogruyol
hey
Bar Hofesh
@bararchy
@Sdogruyol Hi dude :)
Serdar Dogruyol - Sedo セド
@sdogruyol
@bararchy hey sup
Ender Ahmet Yurt
@enderahmetyurt
hey
Bar Hofesh
@bararchy
Hi
Serdar Dogruyol - Sedo セド
@sdogruyol
@Codcore do you think of a way of removing actions macro from controller :)
@Codcore it's pretty nasty
Giorgio Pellero
@trapped
ERROR: Missing hash value: "HomeController" -> https://gist.github.com/trapped/265d1fb0a926f55125a5
Giorgio Pellero
@trapped
temporarily solved by changing https://github.com/Codcore/amethyst/blob/master/src/amethyst/dispatch/router.cr#L13 to @controllers["#{{{klass_name.id}}}".split("::").last] = {{klass_name.id}}
i guess it's related to Codcore/amethyst#31
it probably boils down to whether amethyst should have users specify the controller's module in routes or not
BONNAURE Olivier
@solisoft
This message was deleted
Ali Bayram
@abfsociety_twitter
hey
Roger Pack
@rdp
is the project alive? :)
Punita Ojha
@punitaojha
This message was deleted