This project was created by a developer from Ukraine.

Russia has invaded Ukraine and already killed tens of thousands of civilians, with many more raped or tortured.

The death toll keeps climbing. It's a genocide. We need your help. Let's fight back against the Russian regime.

Support Ukraine

#StandWithUkraine

This project was created by a developer from Ukraine.

Russia has invaded Ukraine and already killed tens of thousands of civilians,

with many more raped or tortured. It's a genocide. We need your help.

Support Ukraine

#StandWithUkraine

generate.cr v0.1.0

Easily create generator (e.g. project wizard) for crystal

Generate.cr

Abstract

This small shards is useful to create project generators, wizard etc...

It provides few helpers method to create new folders, template files and execute applications.

Usage

Add it to your shard.yml:

  dependencies:
    generate-cr:
      github: anykeyh/generate.cr

Create a new generator:

  g = Generate::Generator.new
  # Setup initial directory
  g.target_directory = "./generated"
  # Setup variables into the generator.
  g["simple_test"] = "hello!"

  # Change the current working directory
  g.in_directory("sample") do
    g.file "sample_file.cr", <<-RUBY
      def test
        $simple_test
      end
    RUBY

    g.file "another_file.cr", <<-RUBY
      def test
        $simple_test
      end
    RUBY
  end
Repository

generate.cr

Owner
github statistic
  • 3
  • 5
  • 2
  • 0
  • over 1 year ago
  • March 16, 2018
License

Links
Synced at

Tue, 29 Nov 2022 20:07:14 GMT

Languages