similar to: include vs. require vs. require_dependency

Displaying 20 results from an estimated 4000 matches similar to: "include vs. require vs. require_dependency"

2005 Sep 27
5
Am I misunderstanding "require_dependency"?
Hi From what I understand about documentation about require_dependency, this function will work like require but the file will be reloaded on every request to the server when in development mode. I have bootstrapped am minimal RoR project with 0.13.1 Rails. I have created a minimal Controller and hooked up it''s "index" action at the site root. I have also created a
2012 Apr 07
3
Is require_dependency supposed to be a public API?
If so, shouldn''t it be documented in the Rails API? Or is there a better way to allow class reloading of my files under lib. I mean, I know about config.autoload_paths, but I want to be explicit about my requires. I just want to be able to reload then on each request when I''m working on them. require_dependency seems to do just that but I''m worried since it is not
2012 Jun 07
3
Couldn't reload a module when it's changed. Tried :require_dependency, :watchable_dirs, :unloadable
I''m completely messed with module reloading in development mode. I have to restart app server each time I edit lib/z/nginx.rb which is included in app/models/user_case.rb app/models/user_case.rb require_dependency ''z/nginx'' class UserCase < ActiveRecord::Base include Z::Nginx unloadable I added to environment.rb
2007 Mar 13
0
aliasing, require_dependency and require
I''d really appreciate it if someone [with a decent understanding of the rails Dependencies mechanism] could help me explain the behaviour seen in this pastie. http://pastie.caboo.se/46630 The desired behaviour is simply aliasing a method in ApplicationController from a plugin while retaining automatic reloading in dev mode. The pastie is basically divided into 4 parts: - Setup of
2006 Jun 01
3
Requiring /lib files in a cross-platform way.
Hi. When you have library foo.rb in your Rails project /lib directory, I notice that on some platforms - e.g. Windows with WEBrick as a server - you can require it by simply: require ''lib/foo'' However on other platforms - e.g. Debian with Lighttpd server via FastCGI - this does not work, and you need to specify RAILS_ROOT explicitly, like this: require
2007 Dec 20
4
object.send problem within ActiveRecord
I am using the send method in one of my active records ... executing a method without any parameters works fine.. but when it comes to parameters it says ArgumentError: wrong number of arguments (1 for 0) u = User.new #works u.send :firstname #does not work => ArgumentError: wrong number of arguments (1 for 0) u.send :firstname, ''michal'' does someone know why? the rubydoc
2008 Nov 03
1
concerned_with, and maybe require_dependency issues only when running specs?
Hi all, So in the interests of keeping a few areas of my code a bit under control, I''ve been investigating the concept of "concerned_with" as described here: http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model Basically allowing me to have: /app/models/user.rb class User < ActiveRecord::Base concerned_with :something end
2006 Apr 27
6
Possible to use dashes instead of underscores in rails?
Hi all - My boss is asking me if we can have dashes instead of underscores in the URL for SEO reasons. Apparently google prefers "foo-bar" to "foo_bar". The former will be found when searching for just "foo", but not the latter. So, I''m wondering if there is a way without changing any of my code if I can tell rails to use dashes instead of underscores?
2006 Apr 20
21
Can someone please explain Lighttpd + Mongrel + Rails.
I know that Mongrel is a web server that hosts rails applications. But i don''t understand what part Lighttpd (or Apache) has in the setup. I know that you can use Mongrel on its own. What does Lighttpd improve on? Thanks, Chris -- Posted via http://www.ruby-forum.com/.
2018 Apr 25
2
Bug in RScript.exe for 3.5.0
Hi R Developers, I have found what I think is a bug in the RScript.exe in version 3.5.0 of R for Windows. When I call Rscript.exe for Version 3.5 of R, it is unable to open the file if the file name or path has a space in it. As an example of what happens, I saved 2 files with the code: cat("What do you get when you multiply 6 * 9?") as C:\foo bar.R and as C:\foo_bar.R When I in a DOS
2018 Apr 26
2
Bug in RScript.exe for 3.5.0
Fixed in R-devel. I will port to R-patched after more testing. Tomas On 04/26/2018 01:52 AM, Tomas Kalibera wrote: > Thanks for the report. A quick workaround before this gets fixed is to > add an extra first argument that has no space in it, e.g. > > Rscript --vanilla "foo bar.R" > > The problem exists on all systems, not just Windows. > > Best > Tomas >
2006 Apr 04
26
Models accessing the session...
Can someone tell if there is a reason models shouldn''t access the session? Models could easily be made to access the session or some other shared persistant data store such as a file or a table. _This is the problem_, a model needs to know certain information eg. the id of the current user. But the model has no idea about anything outside of its self, because it can''t access
2015 Jan 22
5
:: and ::: as .Primitives?
Hi all, When S4 methods are defined on base function (say, "match"), the function becomes a method with the body "base::match(x,y)". A call to such a function often spends more time doing "::" than in the function itself. I always assumed that "::" was a very low-level thing, but it turns out to be a plain old function defined in base/R/namespace.R. What
2006 Jul 28
2
Scaffold and Undercores in Tablenames
I am attempting to generate scaffolds on legacy tables that have underscores in the name. Scaffold does not see the underscore. I have tried a backslash escape but it no work. I have looked around but i cannot find a way to make it work. It''s like this: c:\railroad>ruby script/generate scaffold FOO_BAR exists app/controllers/ exists app/helpers/ create
2003 Nov 19
2
Was: setValidity and "initialize" method conflict ? [in R-help]
Hello, Thomas Stabla (statho3@web.de) has already sent this question to R-help, Wed, 12 Nov 2003 21:21:31 +0100, but we are not sure whether we should better post this mail to this audience than to R-help: --------------------------------------------------------------------- We are using S4-classes and want to force a validity check when an object is created. How can this be done, when an
2006 Jan 29
15
Reload the lib directory
Im writing a module in the lib directory. If I change the module, the changes are not visible to the application when i releod the web page (i am in the development evironment). I must restart the web server (WEBrick) and so i see the changes... but I lost more time. How can I reload the module in the dirictory lib, without reload WEBrick? Thanks so much --Reis -- Posted via
2018 Jan 24
2
Panic: data stack: Out of memory when allocating bytes
On Wed, Jan 24, 2018 at 18:55:47 +0100, Thomas Robers wrote: > Am 23.01.2018 um 20:07 schrieb Josef 'Jeff' Sipek: > > On Tue, Jan 23, 2018 at 14:03:27 -0500, Josef 'Jeff' Sipek wrote: > > > On Tue, Jan 23, 2018 at 18:21:38 +0100, Thomas Robers wrote: ... > > > 1. Do you have any idea what the imap process was doing at the time of the > > >
2003 Sep 27
2
does isGeneric work differently in 1.8.0 ?
Hello, the last command (isGeneric) in following R-code (attached) produces different output, depending on wheter 1.8.0 alpha or 1.7.1 is used. Is that to be expected ? Both R Versions were started with option vanilla --------------------------------------------------- R.1.7.1: --------------------------------------------------- > version _ platform i686-pc-linux-gnu arch i686
2006 Mar 31
5
Model reloading problem
Hi all, I''ve a model class Toto in the model directory. I don''t understand why i have to restarts WebBrick to view changes i make in this class FYI : in the development. rb i desabled class cache with config.cache_classes = false Regards Luciano -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Apr 26
2
Bug in RScript.exe for 3.5.0
Hi Tomas, Thanks for the info about the binary builds; I did install it, however the bug still seems to be there in the current build. The workaround you suggested does work: C:\>"C:\Program Files\R\R-devel\bin\x64\Rscript.exe" "C:\foo bar.R" Fatal error: cannot open file 'C:\foo': No such file or directory C:\>"C:\Program