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

Add component generator #1400

Merged
merged 2 commits into from Sep 8, 2013
Merged

Conversation

tyabe
Copy link
Contributor

@tyabe tyabe commented Sep 7, 2013

Will be able to add the component after the project was created.

how to use:

$ padrino g project simple_project
$ cd simple_project
$ padrino g component
Usage:
  padrino-gen component [options]

Options:
  -r, [--root=ROOT]              # The root destination
                                 # Default: .
  -a, [--adapter=ADAPTER]        # SQL adapter for ORM (sqlite, mysql, mysql2, mysql-gem, postgres)
                                 # Default: sqlite
  -d, [--orm=ORM]                # The database engine component (activerecord, couchrest, datamapper, minirecord, mongoid, mongomapper, mongomatic, ohm, ripple, sequel, none)
  -t, [--test=TEST]              # The testing framework component (bacon, cucumber, minitest, riot, rspec, shoulda, testspec, none)
  -m, [--mock=MOCK]              # The mocking library component (mocha, rr, none)
  -s, [--script=SCRIPT]          # The javascript library component (dojo, extcore, jquery, mootools, prototype, rightjs, none)
  -e, [--renderer=RENDERER]      # The template engine component (erb, haml, liquid, slim, none)
  -c, [--stylesheet=STYLESHEET]  # The stylesheet engine component (compass, less, sass, scss, none)

Description:

        padrino-gen component add components into a Padrino project

Current Selected Components:
  orm         none
  test        none
  mock        none
  script      none
  renderer    slim
  stylesheet  none

@namusyaka
Copy link
Contributor

I like your idea!
@padrino/core-members, What do you think?

@nesquena
Copy link
Member

nesquena commented Sep 8, 2013

I like this idea. We've always needed a way for people to be able to add components after the project is generated. Seems like a reasonable approach.

@tyabe
Copy link
Contributor Author

tyabe commented Sep 8, 2013

Refactoring of Generators has been proposed in #677.
But I tried does not change the existing generator by adding new generator.

thanks.

@namusyaka
Copy link
Contributor

Yeah, looks good locally. Thanks a lot, @tyabe!

@funal125
Copy link
Contributor

I am using padrino-0.12.0.rc2

I encounter an error with 'padrino g component -m mocha' after creating a project.

padrino g component -m mocha
WARN: Unresolved specs during Gem::Specification.reset:
      rack (>= 1.0.0, ~> 1.4)
      rack-protection (>= 1.5.0, ~> 1.4)
      activesupport (>= 3.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
    applying  mocha (mock)...
       apply  mocks/mocha
      insert  Gemfile
      insert  test/test_config.rb
/home/felix/.rbenv/versions/2.1.0/gemsets/global/gems/thor-0.17.0/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory @ rb_sysopen - /home/felix/project/fastqc/test/test_config.rb (Errno::ENOENT)

@skade
Copy link
Contributor

skade commented Jan 16, 2014

Hi Felix,

This is most likely a problem with your ruby version switcher and bundle auto detection.

Try using

bundle exec padrino g -m mocha

Regards,
Florian

On 16 Jan 2014, at 04:45, Felix Chang notifications@github.com wrote:

I am using padrino-0.12.0.rc2

I encounter an error with 'padrino g component -m mocha' after creating a project.

padrino g component -m mocha
WARN: Unresolved specs during Gem::Specification.reset:
rack (>= 1.0.0, ~> 1.4)
rack-protection (>= 1.5.0, ~> 1.4)
activesupport (>= 3.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
applying mocha (mock)...
apply mocks/mocha
insert Gemfile
insert test/test_config.rb
/home/felix/.rbenv/versions/2.1.0/gemsets/global/gems/thor-0.17.0/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory @ rb_sysopen - /home/felix/project/fastqc/test/test_config.rb (Errno::ENOENT)


Reply to this email directly or view it on GitHub.

@kakubei
Copy link

kakubei commented Feb 14, 2014

I'm getting the same error with the actual 0.12 release and would like to know how to fix this error without having to run bundle exec. I get it for a padrino console:

padrino c
WARN: Unresolved specs during Gem::Specification.reset:
  rack (>= 1.0.0, ~> 1.4)
  rack-protection (>= 1.5.0, ~> 1.4)
  activesupport (>= 3.1)

@tyabe tyabe deleted the add_component_generator branch February 14, 2014 11:03
@skade
Copy link
Contributor

skade commented Feb 14, 2014

@kakubei This is not a Padrino problem, but a general environment. You should ask with the maintainers of rvm, chruby, rbenv or whatever you are using for proper solutions.

It is a general Ruby message.

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

Successfully merging this pull request may close these issues.

None yet

6 participants