Displaying 20 results from an estimated 25 matches for "my_module".
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
/vendor/plugins/myplugin/init.rb:
require ''my_module''
Admin::BaseController.send :include, MyModule
However, this gives me an ''uninitialized constant ApplicationController
(NameError)'...
2011 May 19
1
Module in Rails
Hi,
I want to use module in Rails 3
I have module in /lib directory.
file name: my_module.rb
Code of Module:
module MyModule
def self.my_method
loop do
puts "I am started!!!"
sleep 2
end
end
end
Now, I want to use this module in my rb file resides in app_root/daemon
directory named myserver.rb
How can i use that?
--
You received th...
2012 Nov 01
0
Lookup and scoping of hiera data from erb templates
Hey Folks.
Reading through the docs and the mailing list only helped confusing me
more, so maybe its better to just ask if my approach is correct.
Imagine a basic project structure with a module and two classes inside:
modules
|- my_module
|-frontend
|-backend
I''m using Hiera to manage dynamic values, so lets say I have:
---
backend:
foo:
bar: "boo"
baz: 42
So now, if I have an erb template in the my_module::backend class, the
only way to get directly to the values is via a helper variable like...
2011 Aug 09
3
[LLVMdev] Adding a module in a pass
I have an optimization pass (FunctionPass) where I need to add global
constructors.
For cleaness sake I decided to add these in my own module. My module
is created in my FunctionPass constructor:
MyPass()
: FunctionPass(ID),
myModule("my_module", getGlobalContext())
{}
I generate an llvm.global_ctor global variable in my module, and I add
my global constructors there. This appears to be correct. Here is a
dump of the module after the pass:
; ModuleID = 'my_module'
@my_literal = internal constant [6 x i8] c"He...
2012 Sep 28
2
nested modules and autoloading
....ndsu.edu
Is it even possible to do what I''m attempting? I know that
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
discusses nested "implementation" modules, but there''s only examples of
loading specific implementations, e.g.
include my_module::implementation::foo
rather than
include my_module::implementation
I know from plenty of first-hand experience that another reason why I
might see a "could not find class <whatever>" is if I have a typo in the
class name within the .pp file, but I''ve reviewed the clas...
2008 Feb 18
3
Calling a controller inside a module
I tryied everything:
:controller => ''MyModule::Core::Controller''
require ''MyModule/core/controller''
include MyModule::Core
But nothing works !!!
Question is very simple:
How to call a controller that belongs to a Module inside the router.rb file?
This cannot be that difficult!
Thanks!
-Sergio
-------------- next part --------------
An HTML attachment
2017 Jan 25
2
mcjit C interface problems
Hi, I'm attempting to use MCJIT with the C interface with llvm-3.9.0, and
it doesn't seem to work. This code is derived from Paul Smith's example
code:
int main(int argc, char const* argv[]) {
LLVMModuleRef mod = LLVMModuleCreateWithName("my_module");
LLVMTypeRef param_types[] = {LLVMInt32Type(), LLVMInt32Type()};
LLVMTypeRef ret_type = LLVMFunctionType(LLVMInt32Type(), param_types, 2,
0);
LLVMValueRef sum = LLVMAddFunction(mod, "sum", ret_type);
LLVMBasicBlockRef entry = LLVMAppendBasicBlock(sum, "entry");...
2015 Feb 18
3
[LLVMdev] Calling into non-linked function via a pointer
This is my module's dump, which is different than yours. I wonder how I can
get the external thing for my function.
define double @sum(double, double) {
entry:
call void @FooBar()
%tmp = fadd double %0, %1
ret double %tmp
}
; ModuleID = 'My_Module'
define double @sum(double, double) {
entry:
call void @FooBar()
%tmp = fadd double %0, %1
ret double %tmp
}
declare void @FooBar()
On Tue, Feb 17, 2015 at 9:07 PM, Bruce Hoult <bruce at hoult.org> wrote:
> Naturally you can, since C can. As usual, it's instructive to se...
2013 Jul 25
5
Heria, Facts, and Puppet
...l:
:datadir: /var/lib/hiera/data
and, a file envXX.yaml store in the datadir, and I can run *hiera xyz
env_name=envXX* to get the the value of abc associate with xyz.
Yet, if I export the value variable env_name by *export FACTER_env_name=*envXX,
and run:
*puppet apply -e ''include my_module
*
puppet will complaint that it can''t find data store in envXX.yaml. From
the debug output,
debug: importing
''/Users/cliang/.puppet/modules/puppet_flux2_config/manifests/init.pp'' in
environment production
debug: Automatically imported puppet_flux2_config from puppet...
2011 Aug 09
0
[LLVMdev] Adding a module in a pass
...ed for exactly the situation you
describe: your pass does some sort of local transform, but there's some
global modifications it needs to do (add global constructors, add
function prototypes, etc).
-- John T.
>
> MyPass()
> : FunctionPass(ID),
> myModule("my_module", getGlobalContext())
> {}
>
> I generate an llvm.global_ctor global variable in my module, and I add
> my global constructors there. This appears to be correct. Here is a
> dump of the module after the pass:
>
> ; ModuleID = 'my_module'
>
> @my_l...
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
2011 Feb 17
8
logoutput=>on_failure doesn't work as expected
...;ve got a simple resource:
exec { "/bin/ls $oracle_base/dba/bin/database_backup.ksh":
logoutput => on_failure,
}
and I don''t want it to log every time it''s successfully run:
$ sudo tail -F /var/log/messages | grep puppetd
Feb 17 16:36:11 test puppetd[26614]: (//my_module/Exec[/bin/ls /u01/
app/oracle/dba/bin/database_backup.ksh]/returns) executed successfully
but logoutput => on_failure doesn''t suppress the above message.
Is that parameter not available in my version of puppet, or am I
perhaps misunderstanding its purpose? I''m guessing the l...
2008 Oct 28
7
How to override one method of AssetTagHelper
I created a file ./lib/action_view/helpers/asset_tag_helper.rb
and put in it only the method I want to override. like this
module ActionView
module Helpers #:nodoc:
module AssetTagHelper
def image_path(source)
compute_public_path(source, ''images'')
end
end
end
end
But as soon I try this all the others methods from the overriden module
are not
2012 Jun 08
1
Announce: puppetlabs_spec_helper 0.1.0 Available
...require ''rubygems''
require ''puppetlabs_spec_helper/module_spec_helper''
* Create a .fixtures.yml file:
fixtures:
repositories:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib"
symlinks:
"MY_MODULE": "#{source_dir}"
Other dependency modules can be added to the "repositories" section.
* Run ''rm -r spec/fixtures''. The rake task will populate the fixtures
directory for you based on your .fixtures.yml
Once these steps are completed, you can execute &...
2013 Sep 16
10
Unable to specify hierarchy for data-in-modules
...tory, the same command outputs
"common-value".
So, even though osfamily is not part of the hierarchy, it''s used to
override the common value.
Conversely, environment is part of the hierarchy, but it''s not used.
Did I miss anything?
Thanks,
Igor.
Module structure:
my_module/
hiera.yaml
data/
common.yaml
environment/
local.yaml
osfamily/
windows.yaml
hiera.yaml contains:
---
version: 2
hierarchy:
[
[''environment'', ''${environment}'', ''data/environment/${environmen...
2011 Mar 29
18
Rails 3.0.6.rc1
ZOMG HAPPY TUESDAY (UTC-7)!!! <3<3<3<3<3
I am happy to announce that the first release candidate for Rails 3.0.6 has
been pushed to rubygems.org.
## Release Candidate: What does it mean?
The release candidate is very similar to what we will actually release for
version 3.0.6. The reason that we release an RC is so that the community can
have a chance to postpone or veto commits
2006 Jul 24
9
Mongrel: auto-reload plugins?
When developing applications, Webrick will automatically reload
controllers, models, etc. if the source changes. For obvious reasons, it
doesn''t do this for plugins, which makes it a pain to develop said plugins.
I was hoping Mongrel might have some facility to say "watch this directory
too and reload any changes". Obviously, re-init''ing all plugins would be
2012 Mar 28
0
[LLVMdev] GSoC 2012 Proposal: Python bindings for LLVM
...le-summer-of-code-2009-swig/downloads/list
[6]. http://forge.scilab.org/index.php/p/epfs/
*Appendix*
*llvm-py Implementation
*
Here I give a small example to show the relationship between the Python
function in llvm-py and the C function in LLVM.
Let us analysis an example in llvm-py:
*f_sum = my_module.add_function(ty_func, "sum").*
How the above statement is implemented to call LLVM C function successfully?
The llvm-py package has six modules, of which the most important is the
core module, consisting of the following files:
*core.py * high-level support code
*_core.c * low-level...
2007 Mar 14
3
A place to put common partial templates and RJS files?
Greetings,
I have a partial template file (acutally, it is an RJS file but the
same principle is in question here) which I wish to "share" between
multiple controllers. Does anyone know where in the directory tree I
would put these files in order that I can access them from multiple
controllers in the same app? I really would prefer not having to copy
them all into all of the
2015 Feb 18
3
[LLVMdev] Calling into non-linked function via a pointer
I'm having a problem of being unable to call into an arbitrary function
that is loaded into memory whose pointer address is known to me but was not
linked into LLVM.
I have added the function and called LLVMAddGlobalMapping with the pointer,
and the program segfaults.
I was wondering if it is a supported scenario that LLVM can generate a call
into an arbitrary function that is not linked.