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

Unable to set a path when generating admin #854

Closed
Fiaxhs opened this Issue May 27, 2012 · 15 comments

Comments

Projects
None yet
9 participants
@Fiaxhs
Contributor

Fiaxhs commented May 27, 2012

With padrino-admin-0.10.6
If I try to use the --root or -r option when generating admin, an error message appears

$ padrino g admin --root=plop
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
$ padrino g admin -r plop
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)

if I try without this option, generation goes fine.

@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jun 11, 2012

Member

*nix or windows?

Member

DAddYE commented Jun 11, 2012

*nix or windows?

@Fiaxhs

This comment has been minimized.

Show comment
Hide comment
@Fiaxhs

Fiaxhs Jun 11, 2012

Contributor

*nix, sorry I forgot to mention that.

Contributor

Fiaxhs commented Jun 11, 2012

*nix, sorry I forgot to mention that.

@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jun 11, 2012

Member

pretty strange it works on my env very well. Can you try with --root=./plop ?

Member

DAddYE commented Jun 11, 2012

pretty strange it works on my env very well. Can you try with --root=./plop ?

@Fiaxhs

This comment has been minimized.

Show comment
Hide comment
@Fiaxhs

Fiaxhs Jun 15, 2012

Contributor

Same thing.

I'm running Ubuntu Server 12.04 LTS on a VirtualBox machine.
Do you need more specifications ?

Contributor

Fiaxhs commented Jun 15, 2012

Same thing.

I'm running Ubuntu Server 12.04 LTS on a VirtualBox machine.
Do you need more specifications ?

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Jan 10, 2013

Contributor

I think it has something to do with the -r/--root of the admin breaking something and self.destination_root on create_admin in padrino-admin/lib/padrino-admin/generators/admin_app.rb. I'm checking. The -r alias seems to be colliding with the same alias on the cli for some bizarre reason. Will look into it better tomorrow.

Contributor

dariocravero commented Jan 10, 2013

I think it has something to do with the -r/--root of the admin breaking something and self.destination_root on create_admin in padrino-admin/lib/padrino-admin/generators/admin_app.rb. I'm checking. The -r alias seems to be colliding with the same alias on the cli for some bizarre reason. Will look into it better tomorrow.

@Ortuna

This comment has been minimized.

Show comment
Hide comment
@Ortuna

Ortuna Feb 22, 2013

Member

In cli.rb the --root option is being used to load the config/boot.rb file. If another --root is specified, the load_boot method will require 'padrino-core/support_lite'.

Trouble is that if support_lite is loaded then this line isn't executed which adds the padrino-admin generator into Padrino::Generators.load_paths.

So, adding the --root option changes load paths.

I could see how this was the desired behavior.

e.g:

sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g --root=..
Please specify generator to use (project, app, mailer, controller, model, migration, plugin, admin, admin_page)

Where '--root' points to the padrino project root, but the verbiage is confusing:

Options:
  -r, [--root=ROOT]  # The root destination

Since padrino loads 'light' version of padrino-core if it can't find the path to config/boot.rb

Don't know what the solution is but, this might get someone further in debugging. I'll also take another look when I have some time. but a few things should be cleared up:

what does the --root option point to? The root destination or the app it seems to be used in both ways and interchanged.

Member

Ortuna commented Feb 22, 2013

In cli.rb the --root option is being used to load the config/boot.rb file. If another --root is specified, the load_boot method will require 'padrino-core/support_lite'.

Trouble is that if support_lite is loaded then this line isn't executed which adds the padrino-admin generator into Padrino::Generators.load_paths.

So, adding the --root option changes load paths.

I could see how this was the desired behavior.

e.g:

sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g --root=..
Please specify generator to use (project, app, mailer, controller, model, migration, plugin, admin, admin_page)

Where '--root' points to the padrino project root, but the verbiage is confusing:

Options:
  -r, [--root=ROOT]  # The root destination

Since padrino loads 'light' version of padrino-core if it can't find the path to config/boot.rb

Don't know what the solution is but, this might get someone further in debugging. I'll also take another look when I have some time. but a few things should be cleared up:

what does the --root option point to? The root destination or the app it seems to be used in both ways and interchanged.

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Mar 10, 2013

Member

OK, this is a valid issue and question. Moving to 0.11.1 since I want to release imminently.

Member

nesquena commented Mar 10, 2013

OK, this is a valid issue and question. Moving to 0.11.1 since I want to release imminently.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 11, 2013

Contributor

A funny note on this issue is that tests didn't catch it because we don't go through the CLI but directly to the generator!

Would this option be there to change the place where the admin is created? I.e., if I'm setting --root another-admin should it create a folder called another-admin in my project's root? Is that the expected behaviour?

I'm in the middle of reviewing the admin's generators because I'm refactoring it to generate a namespaced admin and it wouldn't hurt me to correct this behaviour, I just need to know what's expected from it.

I also have some doubts with the usage of the -a option in the admin. See this. I'll be reusing it for another purpose now: set the app's location so that we know where to take the namespace from.

Contributor

dariocravero commented Mar 11, 2013

A funny note on this issue is that tests didn't catch it because we don't go through the CLI but directly to the generator!

Would this option be there to change the place where the admin is created? I.e., if I'm setting --root another-admin should it create a folder called another-admin in my project's root? Is that the expected behaviour?

I'm in the middle of reviewing the admin's generators because I'm refactoring it to generate a namespaced admin and it wouldn't hurt me to correct this behaviour, I just need to know what's expected from it.

I also have some doubts with the usage of the -a option in the admin. See this. I'll be reusing it for another purpose now: set the app's location so that we know where to take the namespace from.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 12, 2013

Contributor

@padrino/core-members any thoughts on this?

Contributor

dariocravero commented Mar 12, 2013

@padrino/core-members any thoughts on this?

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Mar 12, 2013

Member

I think allowing the root to be changed makes sense. It should generate an admin with another folder name.

Member

skade commented Mar 12, 2013

I think allowing the root to be changed makes sense. It should generate an admin with another folder name.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 12, 2013

Contributor

Great @skade, I think that too... I will implement it then. What about -a?

Contributor

dariocravero commented Mar 12, 2013

Great @skade, I think that too... I will implement it then. What about -a?

@j15e

This comment has been minimized.

Show comment
Hide comment
@j15e

j15e Apr 25, 2013

Contributor

+1

I ran into this issue too (I modified the app name in the source of padrino to run the generator...)

You should implement the app + model options, there only a few line missing from what I can see, it's almost done!

Contributor

j15e commented Apr 25, 2013

+1

I ran into this issue too (I modified the app name in the source of padrino to run the generator...)

You should implement the app + model options, there only a few line missing from what I can see, it's almost done!

@gbouthenot

This comment has been minimized.

Show comment
Hide comment
@gbouthenot

gbouthenot Nov 4, 2013

Padrino release 0.11.4 still has those problems:
padrino generate admin:
--root option does not work.
--app option is not implemented

Is there any other way to have the admin page elsewhere than /admin ? I would like to have it in /backoffice or /backoffice/admin (changed mount point is not sufficent, there are many path still refering to "/admin".

gbouthenot commented Nov 4, 2013

Padrino release 0.11.4 still has those problems:
padrino generate admin:
--root option does not work.
--app option is not implemented

Is there any other way to have the admin page elsewhere than /admin ? I would like to have it in /backoffice or /backoffice/admin (changed mount point is not sufficent, there are many path still refering to "/admin".

bolshakov pushed a commit to bolshakov/padrino-framework that referenced this issue Nov 7, 2013

Darío Javier Cravero
Refactored the admin generators to support namespaced apps and to read a
bit better. Also disabled `-a` since it wasn't really doing anything and
left a few notes to implement them. Please, see the conversation at:
padrino#854 (comment)
I don't think this should be a blocker to release 0.11.0 and the rest of
the admin needs to get there in time!..

I also added some tests and refactored existing ones so they make sense.
A few need to be implemented though. Tests are now (almost) in mini test format - moving them slowly away from shoulda/mocka.

bolshakov pushed a commit to bolshakov/padrino-framework that referenced this issue Nov 7, 2013

Merge branch 'super-admin' of github.com:WaYdotNET/padrino-framework …
…into super-admin

* 'super-admin' of github.com:WaYdotNET/padrino-framework:
  Refactored the admin generators to support namespaced apps and to read a bit better. Also disabled `-a` since it wasn't really doing anything and left a few notes to implement them. Please, see the conversation at: padrino#854 (comment) I don't think this should be a blocker to release 0.11.0 and the rest of the admin needs to get there in time!..
@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jan 3, 2014

Member

6d51246 improved relative awareness of admin

Member

ujifgc commented Jan 3, 2014

6d51246 improved relative awareness of admin

@ujifgc ujifgc closed this in d766737 Jan 3, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jan 3, 2014

Member

Please use bundle exec padrino g admin -a master to generate admin app named Master and mounted to /master.

Member

ujifgc commented Jan 3, 2014

Please use bundle exec padrino g admin -a master to generate admin app named Master and mounted to /master.

Ortuna added a commit to Ortuna/padrino-framework that referenced this issue Jan 17, 2014

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