Skip to content

Instantly share code, notes, and snippets.

View jpemberthy's full-sized avatar

Juan Pemberthy jpemberthy

View GitHub Profile
#include <iostream>
#include <fstream>
#include <string>
using namespace::std;
string StringStrip(string& s);
string trim(string&,const string&);
require 'rubygems'
require 'geo_ruby'
require 'lib/ruby_vor'
require 'pp'
points = [
RubyVor::Point.new(120, 290),
RubyVor::Point.new(110, 120),
RubyVor::Point.new(160, 90.2),
RubyVor::Point.new(3.14159265, 3.14159265)
Balian:ruby_vor jpemberthy$ sudo gem install bribera-rubyvor
Building native extensions. This could take a while...
ERROR: Error installing bribera-rubyvor:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install bribera-rubyvor
creating Makefile
make
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c edgelist.c
Balian:ext jpemberthy$ ruby extconf.rb
creating Makefile
Balian:ext jpemberthy$ make
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c edgelist.c
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c geometry.c
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c heap.c
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/System/Library/Framework
Balian:mesh_parser jpemberthy$ sudo env ARCHFLAGS="-arch i386" gem install bribera-rubyvor --source http://gems.github.com
Password:
Building native extensions. This could take a while...
ERROR: Error installing bribera-rubyvor:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install bribera-rubyvor --source http://gems.github.com
creating Makefile
make
jpemberthy@jpemberthy~/sources/rubyvor/ext $ make
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c rb_cPriorityQueue.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c rb_cPoint.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c ruby_vor_c.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c geometry.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c voronoi.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -c rb_cComputation.c
cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-a
#setting time zone to Bogota UTC -05
config.time_zone = "Bogota"
ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"`
var asset_id = <%= ENV['RAILS_ASSET_ID'].to_json %>
var uniObj = new UnityObject('/unity3d/WebTesis.unity3d' + '?' + asset_id, "Unity3D", "600", "450");
#Add this line at the end of your environment.rb file
ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"`
#Now ENV['RAILS_ASSET_ID'] has the last commit number and can be used to cache your contents
#In my case Unity3D objects
<script type="text/javascript">
var asset_id = <%= ENV['RAILS_ASSET_ID'].to_json %>
var uniObj = new UnityObject('/unity3d/WebTesis.unity3d' + '?' + asset_id, "Unity3D", "600", "450");
</script>
mtt jpemberthy$ spec spec/controllers/signups_controller_spec.rb
Finished in 0.078284 seconds
0 examples, 0 failures
/Library/Ruby/Gems/1.8/gems/rspec-1.2.6/lib/spec/example/example_methods.rb:24:in `description': No description supplied for example declared on ./spec/controllers/signups_controller_spec.rb:10 (Spec::Example::NoDescriptionError)
from /Library/Ruby/Gems/1.8/gems/rspec-1.2.6/lib/spec/example/example_methods.rb:51:in `execute'
1)
NoMethodError in 'SignupsController responding to POST new with a valid user should send email'
undefined method `assert_sent_email' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1::Subclass_4:0x20fca24>
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/test_process.rb:503:in `method_missing'
./spec/controllers/signups_controller_spec.rb:71:
2)
NameError in 'SignupsController responding to POST new with an INVALID user should not send email'
undefined local variable or method `assert_did_not_send_email' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1::Subclass_5:0x20aa670>
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/test_process.rb:503:in `method_missing'