Component generator requires Adhearsion gem to be installed
-
Jay Phillips
- State changed from new to open
I found that the generate and destroy scripts are created automatically by Rubigen with the following line in ahn_generator.rb:
m.dependency "install_rubigen_scripts", [destination_root, 'ahn', 'adhearsion', 'test_spec'], :shebang => options[:shebang], :collision => :forceIt seems that Rubigen must generate scripts that work outside of an installed gem.
Dr Nic! :)
-
Jay Phillips
- Assigned user changed from Jay Phillips to Dr Nic
-
Dr Nic
Isn't rubigen a dependent gem of adhearsion already? Is there a problem with just adding ['rubigen', '>=1.1.1'] to the hoe dependency list?
-
Dr Nic
Or am I missing the problem...
-
Jay Phillips
Yeah, it's not a gem dependency problem.
Remember the issue I was experiencing with the app generator? When the Adhearsion gem was installed, everything was peachy, but when I tried to run the generator directly without the gem installed, it'd say "Could not find generator".
When the Adhearsion gem isn't installed, I'm experiencing this same issue.
~/Desktop $ gem list adhearsion *** LOCAL GEMS *** ~/Desktop $ (Adhearsion not installed as a gem) ~/Desktop $ ahn create foobar create create components/simon_game/lib create components/simon_game/test create config create helpers create .ahnrc create components/simon_game/configuration.rb create components/simon_game/lib/simon_game.rb create components/simon_game/test/test_helper.rb create components/simon_game/test/test_simon_game.rb create config/startup.rb create dialplan.rb create README create Rakefile dependency install_rubigen_scripts create script create script/generate create script/destroy ~/Desktop $ cd foobar/ ~/Desktop/foobar $ ./script/generate Usage: ./script/generate generator [options] [args] General Options: -h, --help Show this help message and quit. -p, --pretend Run but do not make any changes. -f, --force Overwrite files that already exist. -s, --skip Skip files that already exist. -q, --quiet Suppress normal output. -t, --backtrace Debugging: show backtrace on errors. -c, --svn Modify files with subversion. (Note: svn must be in path) Installed Generators Rubygems: test_unit Builtin: test_unit More are available at http://rubigen.rubyforge.org/ Run generate with no arguments for usage information ./script/generate test_unit ~/Desktop/foobar $ ./script/generate component phone_hero Couldn't find 'component' generator ~/Desktop/foobar $In this terminal output, notice how
- Adhearsion isn't installed as a gem
- Adhearsion project creation works as it should
- The script/generate and script/destroy files are there
- Running script/generate alone shows that only a test_unit generator could be found
- Generating a component failed with the message "Couldn't find 'component' generator"
-
Dr Nic
Ahh, this is more difficult - the script/generate script doesn't know where you have your ahn edge src stored.
In Rails, you'd put edge rails in vendor/rails and rails_generator would look there for generators.
We can do the same for ahn if you want to support vendor/ahn within each ahn app.
-
Jay Phillips
If anything, a component should be able to expose new generators. For now, let's not worry about application-specific generators and assume that component generation is something every Adhearsion app should allow. This is actually why that "script" folder irks me so much.
Dr Nic, I think this is good evidence that sticking the generator into the "ahn" command makes sense. If that's the case, we can always use __FILE__ and get the exact directory from which the Adhearsion process was loaded.
I propose this syntax:
ahn create:component phone_hero [/path/to/app]When no path is given, it'll default to the current directory.
Do you think this'll help?
-
Jay Phillips
- Tag set to generators
- State changed from open to invalid
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.