search for: __file__

Displaying 20 results from an estimated 727 matches for "__file__".

2012 Jul 16
1
After moving from Ruby 1.8.7 to 1.9.3 - test/unit/error (LoadError)
...5:in `require'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from ./script/server:3:in `<main>'' I have found similar problems reported and so have messed around with the paths in script/server: #!/usr/bin/env ruby # $: << File.dirname(__FILE__) # $: << File.dirname(__FILE__) + ''..'' # $: << File.dirname(__FILE__) + ''../..'' # $: << File.join(File.dirname(__FILE__),''..'') # require File.dirname(__FILE__) + ''/../config/boot'' # require File.expand_path(...
2016 Jun 07
0
[PATCH 2/2] ruby: tests: Give each test class and method a unique name.
...- ruby/t/tc_820_rhbz1046509.rb | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ruby/t/tc_010_load.rb b/ruby/t/tc_010_load.rb index 2ec0314..06922e1 100644 --- a/ruby/t/tc_010_load.rb +++ b/ruby/t/tc_010_load.rb @@ -17,7 +17,7 @@ require File::join(File::dirname(__FILE__), 'test_helper') -class TestLoad < MiniTest::Unit::TestCase - def test_load +class Test010Load < MiniTest::Unit::TestCase + def test_010_load end end diff --git a/ruby/t/tc_020_create.rb b/ruby/t/tc_020_create.rb index a2a01a1..251512b 100644 --- a/ruby/t/tc_020_create.rb +++...
2017 Sep 07
1
Failed building wheel for libvirt-python
...t/stack/requirements/upper-constraints.txt (line 169)) Using cached libvirt-python-2.1.0.tar.gz Building wheels for collected packages: libvirt-python Running setup.py bdist_wheel for libvirt-python ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-g9ai0P/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpsHlvcmpip-wheel- --python-tag cp27: running bdist_wh...
2005 Jul 22
3
testing application_helper.rb
I am trying to run some functional (or are they unit?) tests on my application_helper.rb. So far, I''ve not had any success in being able to call the methods defined in application_helper.rb. Here is my app/test/functional/helpers.rb require File.dirname(__FILE__) + ''/../test_helper'' require File.dirname(__FILE__) + ''/../../app/helpers/application_helper'' class HelpersTest < Test::Unit::TestCase def setup end def test_foo result = foo( "test parameter 1" ) assert_equal true, result end end...
2007 May 16
1
SAMBA: Share specific log files
...auditing purposes. We are using Samba v3.0.20b. We are trying to modify the file smbd/service.c::make_connection_snum() function by changing the log file full path. The code changes that is done are as follows: char logfilefullpath[70]; char sharename[256]; safe_strcpy_fn (__FILE__, __LINE__ ,logfilefullpath, "/log/sharenet/", sizeof ("/log/sharenet/")); safe_strcat_fn (__FILE__,__LINE__,logfilefullpath,lp_servicename(snum), sizeof("/log/sharenet/")+sizeof(lp_servicename(snum))); safe_strcat_fn (__FILE__,__LINE__,logfilefullpath,&qu...
2016 Jun 07
3
[PATCH 1/2] ruby: Print exceptions thrown by event callbacks.
--- generator/ruby.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/generator/ruby.ml b/generator/ruby.ml index 97ccfdc..0f71ccc 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -404,15 +404,17 @@ event_callback_wrapper_wrapper (VALUE argvv) return Qnil; } +/* Callbacks aren't supposed to throw exceptions. We just print the + * exception on
2008 Feb 12
1
$:.unshift File.join(File.dirname(__FILE__),'..','lib')?
What this code lines mean? Especially $:. before the unshift? $:.unshift File.join(File.dirname(__FILE__),''..'',''lib'') Regards, Mohsin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5...
2012 Sep 26
0
[LLVMdev] Error while loading profile information
...ProfInf oMsProfI[1000]; } namespace { class ARMInstrStats : public MachineFunctionPass { private: int cnt; ProfileInfoLoader &PIL; public: static char ID; explicit ARMInstrStats(ProfileInfoLoader &_PIL) : MachineFunctionPass(ID), PIL(_PIL){ printf("\n%s:%d",__FILE__,__LINE__); fflush(stdout); } virtual const char *getPassName() const { return "ARM Instr Stats Pass"; } void processMBB(const MachineBasicBlock &MBB) { //double execcnt=1; int blckno=0; blckno=MBB.getNumber(); ProfileInfo &PI=getAnalysis<ProfileInfo&g...
2006 Feb 01
3
Testing components
...#39;'m using template components to modularize an application I''m working on and am really happy with the way it''s going. Unfortunately, all my attempts at writing functional tests for them fail. Trying to duplicate my normal controller tests I have: require File.dirname(__FILE__) + ''/../test_helper'' require File.dirname(__FILE__) + ''news_controller'' # Re-raise errors caught by the controller. class NewsController; def rescue_action(e) raise e end; end class NewsControllerTest < Test::Unit::TestCase def setup @controller = News...
2009 Oct 03
1
[LLVMdev] code generation goes into an infinite loop
...e verifier pass: clearly we generated wrong LLVM datastructures somehow and the verifier is not catching it before the emitter falls off a cliff. Please comment. Daniel // modified from: // llvm/docs/tutorial/JITTutorial1.html // make an LLVM module printf("%s:%d make module\n", __FILE__, __LINE__); // Module* Mod = makeLLVMModule(); llvm::Module *mod = new llvm::Module("test"); // make a function object printf("%s:%d make function\n", __FILE__, __LINE__); // Constant* c = mod->getOrInsertFunction // ("mul_add", // /*ret type*/ I...
2006 Aug 07
9
problems with ActionMailer
Hi all, I''m trying to create a worker to send a mail to all the users in my db. Right now I''m doing the tests, this is the code in my worker (Masivo is the ActionMailer subclass): def do_work(args) @progress = 0 @logger.info("MAILER: starting job") records = Record.find(:all) total = records.size records.each_with_index do |record, idx|
2006 Feb 01
6
how to create a command line script that acts on a model?
Hi, I''m looking to create a ruby script that loads a bunch of records and manipulates these. Where do I start? I got this to begin with: #!/usr/bin/env ruby require File.dirname(__FILE__) + ''/../config/boot'' players = Player.find :all But it complains about a DB connection. How do I set this up? Jeroen
2007 Apr 04
2
unit tests?
Ezra et al: I have this problem: http://rubyforge.org/pipermail/backgroundrb-devel/2006-December/000578.html Any progress on it? Or are unit tests simply impossible for now? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
2014 Sep 20
2
[LLVMdev] Optimization of string.h calls
Yes, well that is a good point w.r.t. strings as typically passed to string.h functions. I guess in this case I had figured that the use of __FILE__ could easily be optimized since it becomes a string constant. Am I wrong? Is the issue that __FILE__ might occur multiple times in a source file and thus become a merged constant? Perhaps there is simply not much use for a string-optimizing feature since reducing program size isn’t a goal for mo...
2010 Sep 09
3
1.9.2 why does relative_require need an additional backtrack in path
Why does Ruby-1.9.2-p0 require an additional ../ for relative paths when compared to the same code for ruby1.8? if RUBY_VERSION < ''1.9'' require File.dirname(__FILE__) + library else require_relative File.dirname(__FILE__) + ''/..'' + library end -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscr...
2009 May 11
3
daemons load activesupport 2.2.2 instead of 2.1.0, causing failure
Hi, I have a couple of daemons that im trying to setup to be run for my app. The environment load is as follows.. ENV["RAILS_ENV"] ||= "development" require File.join(File.dirname(__FILE__), "/../../config/environment") And the error I get is #<LoadError: no such file to load -- active_support> #<Gem::Exception: can''t activate activesupport (= 2.1.0, runtime), already activated activesupport-2.2.2> I have activesupport 2.2.2, 2.1.0 and 1.4.4 installe...
2014 Jan 13
3
[PATCH 1/3] ruby: Fix tests for out-of-tree build, simplify test scripts
...it a/ruby/tests/tc_010_load.rb b/ruby/tests/tc_010_load.rb index 113ab69..8a8ae51 100644 --- a/ruby/tests/tc_010_load.rb +++ b/ruby/tests/tc_010_load.rb @@ -16,8 +16,6 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. require 'test/unit' -$:.unshift(File::join(File::dirname(__FILE__), "..", "lib")) -$:.unshift(File::join(File::dirname(__FILE__), "..", "ext", "hivex")) require 'hivex' class TestLoad < Test::Unit::TestCase diff --git a/ruby/tests/tc_021_close.rb b/ruby/tests/tc_021_close.rb index a089cf3..9c5ea65 1...
2009 May 14
6
Generated test files and bad require 'test_helper'
Why do the generated test files have: require ''test_helper'' It cannot obviously find the file because it''s located in a subdirectory. That''s annoying. -- Posted via http://www.ruby-forum.com/.
2014 Sep 19
2
[LLVMdev] Optimization of string.h calls
Hello all. Is there a way to get llvm/clang at build-time to optimize a string.h call so that the final form of the string is saved in the binary? For instance, for a statement like... strrchr(__FILE__, '/') + 1 …and where clang is called on this code’s source file with “clang /some/long/path/file.c”, can I end up with only “file.c” stored in the binary on disk? I think you can see that I am attempting to avoid full paths from my machine ending up in the program. My IDE, Xcode, always...
2012 Sep 21
1
__FILE__ object in R
Hi - I'm curious if there is a way to get access to the location of the calling script within R. I found one way of accessing it from this thread, https://stat.ethz.ch/pipermail/r-devel/2008-April/048914.html, which recommends using either: parent.frame(2)$ofile Or FILE <- (function() { attr(body(sys.function()), "srcfile") })()$filename However, those suggestions only