Hi,
I want to write a plugin that uses JavaScript and I am wondering how to
put
the static content, i.e. the JavaScript, in place?
I read the documentation I found (
http://wiki.rubyonrails.org/rails/pages/Plugins and links) and looked at
the
listed plugins.
One thing I found was that subversion seems to be a prerequisite for
providing or even installing plugins. Is that right?
The other thing was that there were two plugins that provided content.
a)
Was providing a directory on the same level as the plugin itself, so I
guess
the author assumes the user would copy the content itself. B) The css
graph
plugin (http://nubyonrails.topfunky.com/pages/css_graphs) from Geoffrey
Grosenbach, provides an “images” directory in the plugin top level
directory
(http://topfunky.net/svn/plugins/css_graphs/). So I assumed that
script/plugin install would use this structure and put it below public.
But
this assumption is wrong:
–
DC:~/t2/testtest mkamp$ ./script/plugin install
http://topfunky.net/svn/plugins/css_graphs
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs/images
A
/Users/mkamp/t2/testtest/vendor/plugins/css_graphs/images/colorbar.jpg
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs/init.rb
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs/lib
A
/Users/mkamp/t2/testtest/vendor/plugins/css_graphs/lib/css_graphs.rb
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs/MIT-LICENSE
A /Users/mkamp/t2/testtest/vendor/plugins/css_graphs/README
Exported revision 18.
DC:~/t2/testtest mkamp$ ls public/images/
rails.png
Is there no predefined way of doing this? And if not, what to do?
I started out using install.rb and just copy things over by hand. To
test
the general procedure I put the following in the install.rb:
puts IO.read(File.join(directory, ‘README’ ))
(I’ve seen that in the Rails Recipe to create your own plugin)… But
install.rb seems not to be called.
–
DC:~/t2/testtest mkamp$ script/plugin install svn+ssh://claudia-
und-mariano.net/repos/trunk/in_place_edit_associations
Password:
Password:
A /Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/test
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/test/in_place_edit_associations_test.rb
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/Rakefile
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/init.rb
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/tasks
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/tasks/in_place_edit_associations_tasks.rake
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/lib
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/lib/in_place_edit_associations.rb
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/install.rb
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/javascripts
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/javascripts/in_place_select_editor.js
A
/Users/mkamp/t2/testtest/vendor/plugins/in_place_edit_associations/README
Exported revision 1.
DC:~/t2/testtest mkamp$
I am using rails_edge.
Cheers,
Mariano