Coder Social home page Coder Social logo

Create a generator about cuba HOT 6 CLOSED

soveran avatar soveran commented on May 22, 2024
Create a generator

from cuba.

Comments (6)

djanowski avatar djanowski commented on May 22, 2024

You may be interested in https://github.com/lucasefe/gn by @lucasefe.

from cuba.

gdurelle avatar gdurelle commented on May 22, 2024

Seems cool but would add dependencies to mote and clap into cuba.
I'd prefer one in pure ruby like:

#!/usr/bin/env ruby

def cuba_setup
  <<-EOF
    class #{ARGV[1].capitalize}
        # a lot more stuff...
    end
  EOF
end

if ARGV.length == 2 && ARGV[0] == 'new'
  File.open("#{ARGV[1]}.rb", 'w+') do |file|
    file.write cuba_setup
  end
else
  puts "cuba new <projectName>"
end

Can I make a Pull request with something like that ? (with the class filed with classic cuba setup)

from cuba.

soveran avatar soveran commented on May 22, 2024

Hey @gdurelle, indeed I would like to encourage you to build that tool, but as Cuba is just a library, I think it's better if it remains just that, without any code generators. But what you want could be a good and useful tool for a lot of people, and the naming could be some play with the Cuba/Rum theme. Then we could promote it independently.

from cuba.

gdurelle avatar gdurelle commented on May 22, 2024

I'll do that then !

from cuba.

soveran avatar soveran commented on May 22, 2024

Excellent. A long time ago, in 2009, @djanowski and I wrote a similar tool for creating Sinatra apps, it was called monk, and I wouldn't write it like that today, but I'm linking to it just in case you find something interesting in those ideas :-)

from cuba.

gdurelle avatar gdurelle commented on May 22, 2024

Here we go :
https://github.com/gdurelle/cuba-libre
https://rubygems.org/gems/cuba-libre

My first gem ! :)
(Still have to write tests & think about Thor, but it works ;))

from cuba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.