Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate exercises using x-common #20

Closed
tejasbubane opened this issue Jul 21, 2016 · 7 comments
Closed

Generate exercises using x-common #20

tejasbubane opened this issue Jul 21, 2016 · 7 comments

Comments

@tejasbubane
Copy link
Member

Looks like this track is about to be launched soon (with almost 9 exercises now).

I think we should generate all exercises from x-common. I see a lot of PRs in x-ruby changing the static exercise files to dynamically generated ones. Using it from the start in a new repo like this is better instead of converting them later.

Not sure if this should be enforced on all PRs. What are your views regarding this?

@elorest
Copy link
Contributor

elorest commented Jul 21, 2016

I wrote this last night to create a specs from x-common.

@cases = [cases, from, x-common]
File.open("spec.cr", "w+") do |f|
  @cases.each do |c|
  f.puts %/it "#{c[:description]}" do/
  f.puts %/  Series.new("#{c[:digits]}").largest_product(#{c[:span]}).should eq #{c[:expected]}/
  f.puts "end"
  end
end

@mhelmetag
Copy link
Contributor

mhelmetag commented Jul 22, 2016

@elorest , Nice! Something like this could probably be expanded to make specs for every exercise's json file in the x-common repo.

@elorest
Copy link
Contributor

elorest commented Jul 22, 2016

My thoughts as well. I'll work on that when I have a chance. I just put in
2 weeks at my work so I'm swamped trying to finish up a million things so
I don't leave them in a pinch.

On Jul 21, 2016 9:48 PM, "Max Helmetag" notifications@github.com wrote:

@elorest https://github.com/elorest , something like this could
probably be expanded to make specs for every exercise's json file in the
x-common repo.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#20 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHmpHBp1W7JA9KM5RxPpJRoDyeusN1Rks5qYD2OgaJpZM4JRfqe
.

@tejasbubane
Copy link
Member Author

Looks like xruby also uses some kind of common generator. We can follow the same architecture as described in xruby's generated section.

@mhelmetag
Copy link
Contributor

I feel like the test metadata (json files) in x-common need to be standardized with description, input and expected. Currently there are some files that are kind of all over the place... but I am making some progress with a generator that pulls directly from the github repo online.

@kytrinyx
Copy link
Member

Yeah, we haven't really figured out what to standardize on, and any thoughts about how to do that are very welcome. If you have thoughts about it, would you mind opening something in the x-common repository?

I am making some progress with a generator that pulls directly from the github repo online.

Sweet! There's some talk about improving the Ruby generators, too. exercism/ruby#396 (comment) If several people are thinking about this at once, it could be worth starting a discussion in the github.com/exercism/discussions/issues repo.

@mhelmetag
Copy link
Contributor

mhelmetag commented Nov 18, 2016

@bmulvihill has ported over a spec generator similar to the one in xruby 🎊 so now we can make test case templates like they do! One thing I will work on adding is getting the json from x-common over http or local file system (so that there's a choice).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants