Will-Sommers / cursorless-katas

19 stars 3 forks source link

Use javascript examples instead of Ruby to simplify environment #9

Open ghouston opened 2 years ago

ghouston commented 2 years ago

Using Ruby is great, but it adds extra requirements such as running solargraph and installing gems for the katas to work. Please consider using Javascript instead since javascript is supported "out of the box" in vs code.

For example the file katas\actions\vs_code_editor_actions\example.rb translated to javascript as katas\actions\vs_code_editor_actions\example.js would look like:


class HelloWorld {
  constructor(name) {
    this.name = name;
  }

  // Says hi
  //
  // == Returns:
  // A string with the name passed in at class initialization
  //
  say_hi() {
    return "Hi, I'm " + this.name + "!";
  }
}

will = new HelloWorld("will");
console.log(will.say_hi());

jiangxu = new HelloWorld("jiangxu");
console.log(jiangxu.say_hi());

Using javascript, the vs_code_editor_actions katas are usable without having to install anything extra to the environment.

Will-Sommers commented 2 years ago

Heyo — I agree with you and the majority of the repo is in JS and I'm in the process of moving the remaining files. I'm definitely accepting diffs if you want to make the changes as well.

Here's a screenshot of the breakdown.

image