Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Conversation

GustavoCaso
Copy link
Contributor

Issue: #53
@kytrinyx I follow your feedback from the issue, and implemented.
I have some concerns about encode base64 the image, usually it grows the size by 33%(Internet talking), we could Gzipped.
I don't know what you think about it.
@groyoh

@GustavoCaso GustavoCaso force-pushed the serve_images_in_documentation branch from 839fdd8 to a2556d6 Compare November 26, 2015 01:28
Copy link
Contributor

Choose a reason for hiding this comment

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

It would recommend also verifying that Content-Type header is set to image/png and not application/json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely @groyoh. Thanks for pointing out

Copy link
Member

Choose a reason for hiding this comment

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

We should verify that we're serving the correct type on jpgs, I think. It would be easy to hard-code 'image/png' as the type.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, that test could probably be at the unit test level.

Copy link
Member

Choose a reason for hiding this comment

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

What does camera have to do with this? How about just test.png?

@GustavoCaso GustavoCaso force-pushed the serve_images_in_documentation branch from a2556d6 to 54d1a90 Compare November 26, 2015 09:07
@kytrinyx
Copy link
Member

Yeah, I don't want to do the base64 encoding, since we're just serving an image as a file, not as part of a JSON response.

Copy link
Member

Choose a reason for hiding this comment

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

It might be cleaner if this were an object:

img = config.find(id).docs.image(filename)
img.exists?
img.path
img.type

@GustavoCaso
Copy link
Contributor Author

Great @kytrinyx .I will finish with this one today and keep working on the other ones.
Thanks.

@GustavoCaso GustavoCaso force-pushed the serve_images_in_documentation branch 2 times, most recently from 2af3095 to 7da293e Compare November 26, 2015 21:38
@GustavoCaso
Copy link
Contributor Author

@kytrinyx Are we removing the old readme endpoint ??

@GustavoCaso GustavoCaso force-pushed the serve_images_in_documentation branch from 7da293e to 448fdbc Compare November 26, 2015 22:16
@GustavoCaso
Copy link
Contributor Author

@kytrinyx Is there anything else you want me to do for this feature ?

@kytrinyx
Copy link
Member

I'm not sure which endpoint you mean. We'll eventually get rid of the entire api v1-v2, but the readme endpoint in v3 looks good now, and is ready to be used in the readme page on the site.

Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal here, but usually if you're inside of a class named Image there's no need to prefix anything with image on the inside, so I would probably have named this just name.

@GustavoCaso
Copy link
Contributor Author

Sorry I don't know what I was thinking I think I was really tire 😞

@kytrinyx
Copy link
Member

Oh, having read your code I now understand your question. No, we're not getting rid of the README endpoint, but I rearranged a couple things yesterday while planning how to refactor some things in the website codebase. Look in v3/routes/exercises.rb and test/v3/routes/exercises_test.rb once you've rebased onto master.

@kytrinyx
Copy link
Member

No worries :) Things move really quickly sometimes, and there are so many moving pieces it's hard to keep track.

@GustavoCaso
Copy link
Contributor Author

Thanks for the patience I will clear the Pull Request, of the unwanted files

@kytrinyx
Copy link
Member

Thank you!

@kytrinyx
Copy link
Member

One thing before this is ready--would you make sure that we get a 404 rather than a 500 if the track doesn't exist or the docs directory doesn't exist?

@GustavoCaso
Copy link
Contributor Author

Sure no problem
On 27 Nov 2015 20:11, "Katrina Owen" notifications@github.com wrote:

One thing before this is ready--would you make sure that we get a 404
rather than a 500 if the track doesn't exist or the docs directory doesn't
exist?


Reply to this email directly or view it on GitHub
#78 (comment).

@GustavoCaso GustavoCaso force-pushed the serve_images_in_documentation branch from 448fdbc to 6bf54f8 Compare November 28, 2015 18:15
@GustavoCaso
Copy link
Contributor Author

@kytrinyx Hope this time I got it right, and once agin thanks for the patience

Copy link
Member

Choose a reason for hiding this comment

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

The common idiom here would be assert image.exists? rather than using assert_equal.

@kytrinyx
Copy link
Member

There are a couple of tiny style things, but they can be fixed in a later PR.

Thanks for taking the time to work on this.

kytrinyx added a commit that referenced this pull request Nov 28, 2015
@kytrinyx kytrinyx merged commit 69fca75 into exercism:master Nov 28, 2015
@GustavoCaso
Copy link
Contributor Author

Thanks @kytrinyx I haven't use MiniTest much

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