Displaying 16 results from an estimated 16 matches for "my_plugin".
Did you mean:
_plugin
2009 Oct 11
1
passing model data to a plugin called within that model
I am making a plugin which extends ActiveRecord::Base
I have the plugin working in my models in other aspects. I would like
to pass in some data to the plugin, but I can''t get the data I would
like.
so if I have:
class Stuff < ActiveRecord::Base
belongs_to :thing
my_plugin :id => self.thing.other_id
end
it chokes on figuring out what to do with self.thing.other_id.
I checked, and self isn''t recognized at the point that I am calling
my_plugin
so if i do :
class Stuff < ActiveRecord::Base
belongs_to :thing
my_plugin :id => self.class.to_...
2006 Feb 24
5
Sanity Check
...lib_path = File.join(directory, ''lib'')
init_path = File.join(directory, ''init.rb'')
has_lib = File.directory?(lib_path)
#raise LoadError, "Dude, this path is ok: " + has_lib# =>
public/../config/../vendor/plugins/my_plugin/init.rb
has_init = File.file?(init_path)
#raise LoadError, "WTF !...." + has_init.to_s# =>
False !!!!!!!!!
I''ve loaded the same situation up in IRB, and it works fine. Why is
File.file?(init_path) returning false !?
Permissions are fine, the...
2009 Apr 08
4
Having trouble extending a class from a Rails plugin
...ine (obviously not
desirable).
All of this leads me to believe that my problem has something to do with
the class loader, but, I can''t figure it out. I''ve laid out an example
below that illustrates my problem. Any help would be much appreciated.
Thanks,
Jason
# vendor/plugins/my_plugin/init.rb
require ''my_plugin''
# vendor/plugins/my_plugin/lib/my_plugin.rb
module Jason
class MyClass
def a_method
# ...
end
end
end
# app/models/my_class.rb
module Jason
class MyClass
def another_method
# ...
end
end
end
$ script/console
>&g...
2017 Feb 19
2
Fwd: nbdkit async
...equest would be as follows:
1) nbdkit reads and validates the request from the socket
2) nbdkit calls handle_request but now also passing in the nbd request
handle value
3) nbdkit bundles the nbd request handle value, bool flush_on_update, and
read size into an opaque ptr to struct
4) nbdkit calls my_plugin.pread passing in the usual args + the opaque ptr
5) my_plugin.pread makes an asynchronous read call with a handler set on
completion to call nbdkit_reply_read(conn, opaque ptr, buf) or on error
nbdkit_reply_error(conn, opaque_ptr, error)
6) my_plugin.pread returns back to nbdkit without error after...
2006 Jul 27
2
accessing a variable inside a plugin
Hello,
I would like to load an Hash in my init.rb plugin file ... than I would
like to use this hash in my module ...
in my init.rb:
@anHash = load From file...
in mymodule:
module Amodule
def myFunction
#@anHash ....
end
end
How can I access to my hash in my plugin module function ?
thanks for this dummy question ;-)
Arnaud
2007 Apr 13
21
ZenTest autotest now handles RSpec, yay!
Josh Knowles http://joshknowles.com/ just let me know that ZenTest Autotest
3.50 now handles your RSpec specs.
http://blog.zenspider.com/archives/2007/04/zentest_version_350_has_been_released.html
That''s a great news.
Josh also shared with me a quick hack to make autotest work with only the
RSpec plugin installed.
Add the following into your ~/.autotest file
2017 Feb 20
0
Re: Fwd: nbdkit async
...gt; 1) nbdkit reads and validates the request from the socket
> 2) nbdkit calls handle_request but now also passing in the nbd request
> handle value
> 3) nbdkit bundles the nbd request handle value, bool flush_on_update, and
> read size into an opaque ptr to struct
> 4) nbdkit calls my_plugin.pread passing in the usual args + the opaque ptr
We can't change the existing API, so this would have to be exposed
through new plugin entry point(s).
> 5) my_plugin.pread makes an asynchronous read call with a handler set on
> completion to call nbdkit_reply_read(conn, opaque ptr, buf)...
2006 Aug 08
2
Extending rails with plugins
I''ve been looking at bottling some functionality up into a plugin, but I''m
having some problems including it.
The structure I have is:
/app/controllers/admin/base_controller.rb:
class Admin::BaseController > ApplicationController
#snip#
end
/vendor/plugins/myplugin/lib/my_module.rb:
module MyModule
def new_func
"New Function"
end
end
2007 Dec 19
4
Questions on writing plugin for merb
...omatically included on the app load path?
- If there were some view helpers in the gem, is there way of forcing
them to be included like in rails where you include them into the
ActionView module so they are instantly available in views?
It also seems that in version 0.4.2, doing "merb -P my_plugin" doesnt
work outside a merb app? Is this a bug?
Thanks for any pointers!!
Cheers
Tim
2007 Aug 15
2
need help on writing a plugin
Hey all,
I''ve just "script/generate plugin my_plugin" and I would like to
"overload" one of my view. Say I have app/views/sessions/new.html.erb
and I would like to rewrite that file without touching it using the
plugin. Any idea how to do this? I would also like to do the same
thing with models and controllers of my application. I coul...
2017 Feb 20
1
Re: Fwd: nbdkit async
...flush_after_command) {
op->flags = 0; // clear flags
r = plugin_flush_lowlevel (op, op->conn->handle);
if (r == -1)
// do error stuff;
}
else if (op->cmd == NBD_CMD_READ)
send_reply(op, op->buf, op->count, 0);
else
send_reply(op, NULL, 0, 0);
}
int
my_plugin_pwrite_lowlevel (void *op, void *handle, void *buf,
uint32_t count, uint64_t offset)
{
if (is_readonly(handle)) {
nbdkit_reply_error (op, EROFS);
return 0;
}
if (some critically bad issue)
return -1;
// this returns right away before wri...
2006 Jan 04
0
Plugins unit testing
...t no agreement was
reached over conventions / helpers to use for plugin unit testing.
currently i have the following structure :
your_rails_app/
|- app/
| |- controllers/
| |- models/
| |- helpers/
| |- views/
|- lib/
| - <etc>
|- vendor/
|- plugins/
|-my_plugin/
|-init.rb
|-lib/
|-my_plugin_core.rb
|-test/
|-mocks/
|-test/
|-my_plugin_mock.rb
|-unit/
|-my_plugin_test.rb
Is this correct ? should my tests work as they did when they lived i...
2007 Apr 04
0
rspec_plugin generator
...spec_plugin
Yep, it''s super basic, it just does all the same stuff as the regular
plugin generator does, except it creates RSpec stubs for you.
There is one added bonus though, and that''s that you can set up an
individual database for your plugin.
./script/generate rspec_plugin my_plugin --with-database
This will create a schema.rb file where you can create the schema for
your plugin specs, a database.yml file to configure the database
connection, and set up some helpful stuff in spec_helper.rb Nice for
quickly getting a plugin going with tests isolated against its own
database....
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all,
I feel like I''m missing something really easy and I''m just not seeing
it.
I''m using the restful_authentication plugin and have a User model. Uesr
has_many :things and Thing belongs_to :user.
That''s it.
I did a "script/generate rspec_scaffold thing" to generate all the
necessary bits. The "rake db:migrate" to create the db.
At
2007 Mar 23
4
DRY - with modules, render_component or.. ?
I have an B2B application where a pretty complex order form needs to be
submitted and edited on the admin controller, buyer controller and
seller controller with some small differences.
How do I make available the edit order methods all controllers?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2007 Sep 19
49
plugin dependencies
Hello all,
The topic of plugin dependencies has come up before and it doesn''t
seem to have been addressed by core or core doesn''t seem to think it''s
an issue. I''ve looked at the current edge code and don''t see anything
new, so if I''ve missed something *please* let me know.
The following article makes mention of a require_plugin