Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

For funsies: Crystal implementation - #13

Open
NickLaMuro wants to merge 2 commits into
RedHatCloudForms:masterfrom
NickLaMuro:crystal-implementation
Open

NickLaMuro wants to merge 2 commits into
RedHatCloudForms:masterfrom
NickLaMuro:crystal-implementation

Conversation

@NickLaMuro

Copy link
Copy Markdown
Contributor

Just something I threw together for fun and to see what it would come out as.

Probably should handle travis a little differently so it can actually build standalone some executables for us, but decided to just get it running for now.

Also, not terribly convinced this is something we should ACTUALLY merge, but maybe there is actually interest.

¯\(°_o)/¯

Mostly identical and trimmed down version of `lib/cfme-versions.rb`
(trimmed down since it doesn't need the library features).

For simplicity, the tests just confirm that the outputs match with the
ruby version for the same flags.
Comment thread Rakefile
namespace :crystal do
directory "crystal_build"
file "crystal_build/cfme-versions" => "crystal_build" do
sh "crystal build --release lib/cfme-versions.cr -o crystal_build/cfme-versions"

@NickLaMuro NickLaMuro Aug 21, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should do some kind of fallback if crystal doesn't exist on the system... but this is more like a POC so...

@kbrock kbrock left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crystal is webscale.

LGTM

Comment thread lib/cfme-versions.cr
%w[ Ivanchuk 9.y.z 5.11.z 5.0 1.2,1.3 2.5.z 5.1.z 10.y ],
%w[ Jansa 10.y.z N/A N/A 2.0 2.5.z 5.2.z 10.y ],
%w[ Kasparov 11.y.z N/A N/A N/A 2.6.z 5.2.z 10.y ]
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what crystal tool format will do to this (many editor implementations run this automatically on save, btw)

@NickLaMuro NickLaMuro Aug 25, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was apparently a harder question to answer than I was expecting...

Ran the following:

$ crystal tool format lib/cfme-versions.cr
$ git diff
# nothing changed

Thought that was surprising (my crystal writing can't be "THAT" good...)

Ran it with --check... nothing.

And then proceeded to go on a wild goose chase to figure out where this is implemented... with still no answer.

Unless it won't change it, then in that case, "it won't change a thing".

Edit: Guess I will have to grok this monster to be able to figure it out...

@kbrock

kbrock commented Sep 4, 2020

Copy link
Copy Markdown

:shipit: ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants