search for: metaclasses

Displaying 20 results from an estimated 25 matches for "metaclasses".

Did you mean: dataclasses
2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
On my current project I needed to create a stub that responded correctly to the id message. Here''s the change I put into my copy of head. Index: lib/mocha/mock_methods.rb =================================================================== --- lib/mocha/mock_methods.rb (revision 1114) +++ lib/mocha/mock_methods.rb (working copy) @@ -68,6 +68,7 @@ method_names =
2007 Apr 05
3
Extending assigns in controller specs?
Hello, I am interested in enhancing assigns in controller specs to do things like the following assigns[:key1, :key2, :key3] #=> vals for keys Is there away to "break open" this construction to overload the :[] operator? Thanks. -Chris
2008 Mar 03
0
A kind of monkey patch and an invitation for criticism for all you (who know this stuff better than I do)
I''ve often felt the need including Rails'' view helpers within my controllers, if only for some simple things like formatting my flash notices with text helpers or html escaping. I loved this suggestion, which helps by not cluttering the namespace of controllers: http://snippets.dzone.com/posts/show/1799 But I wanted to generalize this a little to automatically include whatever
2009 Apr 09
1
method_exists? is missing?
In a controller run through webrick I do this: @entity = Entity.new print @entity.methods.sort.to_yaml and I see this: - logger - mark_for_destruction - marked_for_destruction? - metaclass - method - method_missing - methods - new_record? There is no method_exists? method. If I instead do this in a console session, I see this: $ script/console >> >> @entity = Entity.new =>
2007 Feb 15
4
defining context(s) dynamically
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Q. Why does code which defines a context work in the
2013 Aug 30
3
rspec-puppet not working
I''m trying to get rspec-puppet working and have run into a problem. I have a VM running ubuntu lucid, have installed rubygems 1.3.5 from the apt package and have install rspec-puppet (and other required gems), and rake, using gem install. I''ve run rspec-puppet-init in the module I want to test, and have created a very basic spec file for one of the classes in my module.
2012 Jul 31
1
puppet doc questions
Does puppet doc require a specific version of any gems (such as rdoc or rake) to operate? I''m getting some errors when I try to generate my rdoc now. # puppet doc --output /var/www/test --modulepath /etc/puppet/environments/test/modules -m rdoc RDoc::RDocError is deprecated and will be removed in RDoc 4 Could not generate documentation: uninitialized constant RDoc::RDoc::Generator
2005 May 07
2
[LLVMdev] calling conventions and inlining
...May 2005, Markus F.X.J. Oberhumer wrote: > I see that you are objecting explicit inline control. > > The main problem is that inlining is absolutely crucial for some > "modern" programming styles. E.g. we use a huge collection of small C++ > template classes and template metaclasses, most of which have very > trivial and limited functionality (think of it as some "bytecode" > expressed in classes). Of course, these method calls of these classes > _must_ be inlined, but there are also "traditional" calls to other > functions which may or may...
2007 Jan 11
4
counter-intuitive behaveour when passing a proc to Mocha::Expectation#returns
Let''s say that I have a procedure that: * gets the number of bytes to write into some file * and returns the number of successfully written bytes def save( text, len ) This procedure is being used all over the place especially inside the method "process" which I want to test. Thus in order not to polute my filesystem I stub the "save" procedure. But of course in
2005 May 07
0
[LLVMdev] calling conventions and inlining
...Oberhumer wrote: > >> I see that you are objecting explicit inline control. >> >> The main problem is that inlining is absolutely crucial for some >> "modern" programming styles. E.g. we use a huge collection of small >> C++ template classes and template metaclasses, most of which have >> very trivial and limited functionality (think of it as some >> "bytecode" expressed in classes). Of course, these method calls of >> these classes _must_ be inlined, but there are also "traditional" >> calls to other functions w...
2012 Aug 17
3
puppet-rspec / puppetlabs_spec_helper
I am using puppet 2.7.14 on Ubuntu 10.04 LTS. I have the following gems: *** LOCAL GEMS *** diff-lcs (1.1.3) hiera (0.3.0) hiera-puppet (0.3.0) metaclass (0.0.1) mocha (0.12.1) puppet-lint (0.1.13) puppetlabs_spec_helper (0.2.0) rake (0.9.2.2) rspec (2.11.0) rspec-core (2.11.1) rspec-expectations (2.11.2) rspec-mocks (2.11.1) rspec-puppet (0.1.3) When I run "rake help" I get the
2007 Jan 05
6
RSpec 0.7.5 with Rails and rcov
I seem to be missing something because I am at a loss on how to get rcov, RSpec, and Rails working together. Would someone mind dropping some hints?
2006 May 26
9
What syntax is this? belongs_to :Person
so when I''m reading the pick axe book second edition I don''t see anything like the syntax you see people using in rails code. Specifically when you see. belongs_to :Person has_many :Phones etc these are methods on ActiveRecord right? Why is this invocation syntax never described in the Pick Axe book? I do see things like attr_reader :some_attribute etc but you
2017 Aug 23
5
Extending TableGen's 'foreach' to work with 'multiclass' and 'defm'
On 08/23/2017 12:06 PM, Krzysztof Parzyszek via llvm-dev wrote: > On 8/23/2017 11:58 AM, Hal Finkel via llvm-dev wrote: >> If we want to go down that route, I can certainly imagine a feasible >> incremental-transitioning strategy. We could allow TableGen to use an >> embedded Python interpreter to generate records based on Python data >> structures, and then, combine
2013 Mar 02
0
Problems getting rspec testing working in OSX?
Hey Gang, Running into a weird error when trying to follow puppetlabs'' blog: https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing/ I''m running 10.8.2, using default ruby, in an attempt to make my home env a little more sane, (ran into weird rbenv issues at work, which I won''t go into here) The google tells me not a whole lot. Appreciate any help
2007 Oct 03
3
manually invoking routing?
Hey folks. I have a rails controller which is filtering search results for access control. The search results are typically URLs into the rest of the rails app. I''m finding it would simplify the grotty code which is accumulating if I could manually invoke the router. That is to say, if I could send something a URI path string and get back the hash of controller, action, and params that
2005 May 20
0
[LLVMdev] PyPy 0.6 released
Hi LLVM-dev! I have been working for a few months on an experimental LLVM backend for the PyPy project and I thought you might be interested in the fact that we just did our first public release, which includes it (see release announcement below). Regards Carl Friedrich The PyPy 0.6 release -------------------- *The PyPy Development Team is happy to announce the first public release
2012 Sep 22
4
Class, Module, Object
>> reload! Reloading... => true >> puts Class < Module true => nil >> puts Module < Class false => nil >> puts Module < Object true => nil >> puts Object < Module false => nil >> Object.parent => Object The above indicates that the Class object instance inherits from the Module object instance and the Module object instance
2013 Jun 29
0
rake db:create giving undefined method `' for nil:NilClass
My ruby version is 1.8.7 I have installed mysql-essential-5.0.90-win32 and using Fedena 2.3.5 List of all gems installed:* columnize (0.3.6) declarative_authorization (0.5.1) fattr (2.2.1) ffi (1.9.0) gem_plugin (0.2.3) highline (1.6.19) i18n (0.4.2) metaclass (0.0.1) mime-types (1.23) mocha (0.14.0) mongrel (1.1.5) mysql (2.8.1) net-ping (1.6.0) prawn (0.6.3) prawn-core (0.6.3) prawn-format
2006 Oct 20
7
MVC and modules. Views telling models to behave
I was thinking today, it would be nice if a view could tell a model how to format it''s data for that particular view. Kind of like, the view is bestowing instant, and temporary knowledge on the model for the duration of the views run. It seemed to me that this would be more objecty than say a helper that formats a string format_my_string( my_string ) Instead, in my view. Lets assume I