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

generator not injecting files on Windows #1782

Closed
nt255 opened this Issue Oct 3, 2014 · 11 comments

Comments

Projects
None yet
2 participants
@nt255

nt255 commented Oct 3, 2014

Not sure if this is really an issue:

Running 'padrino g admin' in my project directory creates all the files but does not inject to config/app.rb. I have to go into that file and manually mount the generated Admin app for it to work. Similarly, running 'padrino g admin_page post' creates all the views and controllers but does not inject to admin/app.rb, and this is perhaps why the new tab for the admin panel is never added.

I'm pretty sure I've used the commands correctly (creating, migrating, seeding) and I can access the admin page directly from the URL.

I'm running Ruby 1.9.3 p545. Padrino is also up to date, as well as Thor and all the other gems.

Thanks.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 3, 2014

Member

Can not reproduce. Please provide a minimal failing project with a Gemfile.lock

Member

ujifgc commented Oct 3, 2014

Can not reproduce. Please provide a minimal failing project with a Gemfile.lock

@ujifgc ujifgc added the revalidate label Oct 3, 2014

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 3, 2014

https://github.com/ntuntasood/padrino-1782

I have my command prompt history in command_history.txt.

nt255 commented Oct 3, 2014

https://github.com/ntuntasood/padrino-1782

I have my command prompt history in command_history.txt.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 3, 2014

Member

Oh, that's Windows. Okay, that might be the problem. Will look into it.

Is it rubyinstaller or cygwin?

Member

ujifgc commented Oct 3, 2014

Oh, that's Windows. Okay, that might be the problem. Will look into it.

Is it rubyinstaller or cygwin?

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 3, 2014

rubyinstaller

nt255 commented Oct 3, 2014

rubyinstaller

@ujifgc ujifgc added bug and removed revalidate labels Oct 3, 2014

@ujifgc ujifgc modified the milestones: 0.13.0, 0.12.4 Oct 3, 2014

@ujifgc ujifgc closed this in 3ee3f9c Oct 3, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 3, 2014

Member

Thank you for your report!

Member

ujifgc commented Oct 3, 2014

Thank you for your report!

@ujifgc ujifgc changed the title from generator not injecting files to generator not injecting files on Windows Oct 3, 2014

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 3, 2014

no problem thanks for your help

nt255 commented Oct 3, 2014

no problem thanks for your help

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 4, 2014

So I've installed the latest version with your commit and the admin generator now injects to config/app.rb and Admin is mounted. However, when generating an admin page, admin/app.rb is not actually changed (despite it saying so) so I have to manually add role.project_module :posts, '/posts' to the admin access control so the tab appears in the nav bar.

PS C:\Users\ecofriendly\documents\coding\test> padrino g admin_page post
      create  admin/views/posts
      create  admin/controllers/posts.rb
      create  admin/views/posts/_form.slim
      create  admin/views/posts/edit.slim
      create  admin/views/posts/index.slim
      create  admin/views/posts/new.slim
      insert  admin/app.rb

nt255 commented Oct 4, 2014

So I've installed the latest version with your commit and the admin generator now injects to config/app.rb and Admin is mounted. However, when generating an admin page, admin/app.rb is not actually changed (despite it saying so) so I have to manually add role.project_module :posts, '/posts' to the admin access control so the tab appears in the nav bar.

PS C:\Users\ecofriendly\documents\coding\test> padrino g admin_page post
      create  admin/views/posts
      create  admin/controllers/posts.rb
      create  admin/views/posts/_form.slim
      create  admin/views/posts/edit.slim
      create  admin/views/posts/index.slim
      create  admin/views/posts/new.slim
      insert  admin/app.rb
@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 4, 2014

Member

It should work, I checked. How did you installed the edge version? Can you try bundle exec padrino g admin_page post?

Member

ujifgc commented Oct 4, 2014

It should work, I checked. How did you installed the edge version? Can you try bundle exec padrino g admin_page post?

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 4, 2014

I have gem 'padrino', :github => 'padrino/padrino-framework' in the project Gemfile before running bundle. Also, I've tried that command and it still doesn't work.

Here is my project: https://github.com/ntuntasood/padrino-1782-2

nt255 commented Oct 4, 2014

I have gem 'padrino', :github => 'padrino/padrino-framework' in the project Gemfile before running bundle. Also, I've tried that command and it still doesn't work.

Here is my project: https://github.com/ntuntasood/padrino-1782-2

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 5, 2014

Member

Your project works on my system. It inserts role.project_module :posts, '/posts' into admin/app.rb with command bundle exec padrino g admin_page post.

Though I failed to properly use gem 'padrino', :github => 'padrino/padrino-framework' on Windows, so I cloned the repo to vendor/padrino-framework and used this: gem 'padrino', :path => 'vendor/padrino-framework'.

Member

ujifgc commented Oct 5, 2014

Your project works on my system. It inserts role.project_module :posts, '/posts' into admin/app.rb with command bundle exec padrino g admin_page post.

Though I failed to properly use gem 'padrino', :github => 'padrino/padrino-framework' on Windows, so I cloned the repo to vendor/padrino-framework and used this: gem 'padrino', :path => 'vendor/padrino-framework'.

@nt255

This comment has been minimized.

Show comment
Hide comment
@nt255

nt255 Oct 5, 2014

Hmm, still doesn't work on mine. I'll try to see what's going on.

nt255 commented Oct 5, 2014

Hmm, still doesn't work on mine. I'll try to see what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment