You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using ruby 1.9.1-p376 and have tried this with 1.9.2
The project is configured fine, but when I execute
victorhg$ inploy setup
/Users/victorhg/.rvm/gems/ruby-1.9.1-p376/gems/inploy-1.6.0/lib/inploy/dsl.rb:48:in `remote_run': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/victorhg/.rvm/gems/ruby-1.9.1-p376/gems/inploy-1.6.0/lib/inploy/deploy.rb:48:in `remote_setup'
from /Users/victorhg/.rvm/gems/ruby-1.9.1-p376/gems/inploy-1.6.0/lib/inploy/cli.rb:9:in `execute'
from /Users/victorhg/.rvm/gems/ruby-1.9.1-p376/gems/inploy-1.6.0/bin/inploy:7:in `<top (required)>'
from /Users/victorhg/.rvm/gems/ruby-1.9.1-p376/bin/inploy:19:in `load'
from /Users/victorhg/.rvm/gems/ruby-1.9.1-p376/bin/inploy:19:in `<main>'
Well, because of the change on how eval method handles local variables, we cannot have something like this on ruby 1.9:
eval "variable = 1"
print variable
The way inploy handles the configuration parameters is not working (at least for me). Here is the problem in the code:
inploy/deploy.rb:27
def configure
if file = configuration_file
deploy = self
eval file.read
local_variables.each do |variable
send "#{variable}=", eval(variable) rescue nil
end
end
end
When executing eval file.read the variables are not created as local variables, but only as local variables inside the eval scope. To solve this, I had to change the config/deploy file to created instance variables:
I thought to do this but the problem is that every time an attribute is declared, the person would have to remember to declare it also as a local variable in the configure method.
I applied a hack and it should be working now. Anyway, please send me a patch if you got a better implementation.
Hello,
I'm using ruby 1.9.1-p376 and have tried this with 1.9.2
The project is configured fine, but when I execute
Here's my config/deploy.rb file:
Explaining the problem:
Well, because of the change on how eval method handles local variables, we cannot have something like this on ruby 1.9:
The way inploy handles the configuration parameters is not working (at least for me). Here is the problem in the code:
When executing
eval file.read
the variables are not created as local variables, but only as local variables inside the eval scope. To solve this, I had to change the config/deploy file to created instance variables:Maybe there's a better way to make it work... or I would be really glad to hear that it's just some stupid mistake I did....
thank you...
The text was updated successfully, but these errors were encountered: