Code Monkey home page Code Monkey logo

delorean's Issues

request to include spec folder along with the gem

I'm packaging delorean for debian and since the gem does not have specs in it, I have to download a github tarball. It would be nice to have the spec folder included in the gem itself, like many gems already do.

No possible config.gem 'delorian'

I have tried all this convinations:

config.gem 'delorian'
config.gem 'delorian', :source => "http://gemcutter.org"
config.gem 'delorian', :source => 'http://gems.github.com' 

I am very clumsy with all this about gems, so maybe is my fault.

This are my console log:

 $ sudo rake gems:install RAILS_ENV=test
(in /Develop/test)
gem install delorian --source http://gems.github.com
ERROR:  could not find gem delorian locally or in a repository

 $ sudo rake gems:install RAILS_ENV=test
(in /Develop/test)
gem install delorian --source http://gemcutter.org
ERROR:  could not find gem delorian locally or in a repository

 $ sudo rake gems:install RAILS_ENV=test
(in /Develop/test)
gem install delorian
ERROR:  could not find gem delorian locally or in a repository

 $ sudo gem install delorean
Successfully installed delorean-0.2.0
1 gem installed
Installing ri documentation for delorean-0.2.0...
Installing RDoc documentation for delorean-0.2.0...

 $ sudo rake gems RAILS_ENV=test
(in /Develop/test)
 - [ ] delorian 

Any suggestion?

Thanks

f.

Problem uploading to S3 with Paperclip when time-travelled

In some acceptance tests we generate documents and upload to S3. When time-travelled, S3 rejects the request with a RequestTimeTooSkewed error.

My workaround is a bit nasty, involving bookmarking time, returning to present, uploading the file, then traveling back to the bookmarked time - all within the file-upload method, essentially.

Is there a cleaner solution?

Does not work with database now() :)

Hi!

I was trying to test my expiring activeness of product (just scope in activerecord):

scope :active, where('expires_at > now()')

but Delorean only travels in ruby time, not in db time :) I know it is highly impossible to mock db time. but maybe somebody have some idea about it? maybe it is better not to use database specific methods, such as random() or now(), but pass for example Time.now converted to database date format? something like this:

scope :active, where("expires_at > #{Time.now}")

Wrong hour after jump

Time.now.utc => 2012-02-29 18:33:42 UTC
Delorean.jump 30.days => nil
Time.now.utc => 2012-03-30 17:33:45 UTC

Some how we are loosing one hour.

`alias_method': undefined method `today' for class `Class' (NameError)

I'm getting the following error when I try to start the rails server. I'm trying to create a vagrant box for this app. I suspect something might be off with my env and not necessarily with delorean, so I was hoping someone might know if this is a symptom of something else.

Environment:

  • RVM with ruby 1.9.3-p194
  • Vagrant with precise64 box
  • Bundler 1.3.4
vagrant@precise64:~/myapp$ bundle exec rails s
/home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/delorean-2.1.0/lib/delorean.rb:16:in `alias_method': undefined method `today' for class `Class' (NameError)
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/delorean-2.1.0/lib/delorean.rb:16:in `singletonclass'
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/delorean-2.1.0/lib/delorean.rb:15:in `<top (required)>'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
        from /home/vagrant/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
        from /home/vagrant/myapp/config/application.rb:8:in `<top (required)>'
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
        from /home/vagrant/myapp/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

DateTime.now not working with ruby 1.9.3

DateTime.now returns current time while Time.now return the correct time after traveling in time using delorean with ruby 1.9.3.
Using ruby 1.9.2 everything works fine.

time_travel_to does not consider hours and minutes

Hi,

I observed the following in my test cases:

ree-1.8.7-2011.03 :001 > Delorean.time_travel_to DateTime.strptime("2011-05-25 18:00", "%Y-%m-%d %H:%M")
=> nil
ree-1.8.7-2011.03 :002 > Time.now
=> Wed May 25 00:00:02 +0200 2011

It seems that the Delorean does not consider the hours. There is a workaround, though: I can use jump after calling time_travel_to

Cheers,
Zsolt

Miliseconds lost on DateTime

Due to the implementation of now method milliseconds are lost when using Delorean.

$ rails console
ruby-1.9.3-p125-perf :001 > DateTime.now.strftime("%L")
 => "462" 
ruby-1.9.3-p125-perf :002 > DateTime.now.strftime("%L")
 => "175" 
ruby-1.9.3-p125-perf :003 > require 'delorean'
 => true 
ruby-1.9.3-p125-perf :004 > DateTime.now.strftime("%L")
 => "000" 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.