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

generator not injecting files on Windows #1782

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

generator not injecting files on Windows #1782

nt255 opened this issue Oct 3, 2014 · 11 comments
Labels
Milestone

Comments

@nt255
Copy link

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
Copy link
Member

ujifgc commented Oct 3, 2014

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

@nt255
Copy link
Author

nt255 commented Oct 3, 2014

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

I have my command prompt history in command_history.txt.

@ujifgc
Copy link
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
Copy link
Author

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 as completed in 3ee3f9c Oct 3, 2014
@ujifgc
Copy link
Member

ujifgc commented Oct 3, 2014

Thank you for your report!

@ujifgc ujifgc changed the title generator not injecting files generator not injecting files on Windows Oct 3, 2014
@nt255
Copy link
Author

nt255 commented Oct 3, 2014

no problem thanks for your help

@nt255
Copy link
Author

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
Copy link
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
Copy link
Author

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
Copy link
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
Copy link
Author

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants