-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method +' for class
Date' (NameError)
#38
Comments
@naiyyar the issue is with High Sierra: the system version of ruby was upgraded to 2.3.1 from 1.8. There is a gem that ships with Ruby called edit: this ended up not being the issue because the |
The following update to motion-support's Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MotionSupport'
app.detect_dependencies = false
app.sdk_version = '10.0'
app.deployment_target = '10.0'
files = [
'motion-support/motion/_stdlib/date.rb',
'motion-support/motion/_stdlib/array.rb',
'motion-support/motion/_stdlib/cgi.rb',
'motion-support/motion/_stdlib/time.rb',
'motion-support/motion/_stdlib/enumerable.rb'
]
files.each do |f|
app.ordered_build_files.delete(f)
end
files.each do |f|
app.ordered_build_files.unshift(f)
end
end |
Ok. Thanks @amirrajan Now How can i fix it in my app. Should i remove the motion-support until fix for this is available? also i'm unable to create a new app |
@amirrajan i forked motion-support gem and changed rake file accordingly and still getting same issue https://github.com/naiyyar/motion-support/blob/master/Rakefile |
@naiyyar fully qualify the paths and see if that works? files = [
File.expand_path('motion-support/motion/_stdlib/date.rb'),
File.expand_path('motion-support/motion/_stdlib/array.rb'),
File.expand_path('motion-support/motion/_stdlib/cgi.rb'),
File.expand_path('motion-support/motion/_stdlib/time.rb'),
File.expand_path('motion-support/motion/_stdlib/enumerable.rb')
] |
Ok i'll try this after release. For now i removed gem from the app. |
I'll get the exact |
This fixes it |
I added @jeremiahlukus's patch to |
@colinta that did fix my problem. It's basically a workaround (commenting out the code that crashed) for the deeper issue of of the changed behaviour on High Sierra. My concern is that we are stripping out that duration functionality. I'm not using it, but if anyone else does, this'll break their code. But who knows if anyone is even using it... it does not appear to be covered by any unit tests. |
Really good point, let's rethink this... I'll revert that commit for now. |
The deeper issue is: clayallsopp/motion-require#16 This is a much harder problem (code parsing with |
@colinta yes. It's working. Thanks |
Any progress on this issue guys? As an FYI, I too tried @jeremiahlukus's fork as seen here: jeremiahlukus@52d4abf and it worked like a charm. |
Amir has a fork that I'm waiting on, to test a fix @marcamillion. Hopefully we'll get it all straightened out this weekend. |
Thanks, Lori!
… On Feb 17, 2018, at 9:16 AM, Lori M Olson ***@***.***> wrote:
Amir has a fork that I'm waiting on, to test a fix @marcamillion. Hopefully we'll get it all straightened out this weekend.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Updates: The issue comes down to cyclical dependencies (which are easy enough to resolve... just tedious). Ultimately, I'm recommending that we remove the reliance on motion_require and set Steps to diagnose:
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
module Motion; module Project
class Dependency
def cyclic?(dependencies, def_path, ref_path)
deps = dependencies[def_path]
if deps
if deps.include?(ref_path)
App.warn("Possible cyclical dependency between #{def_path} and #{ref_path}'s class hierarchy. Consider revision if runtime exceptions occur around undefined symbols.")
return true
end
deps.each do |file|
return true if cyclic?(dependencies, file, ref_path)
end
end
false
end
end
end; end
# in hash.rb
class Hash
defined?(Enumerable)
end
# in array.rb
class Array
defined?(Object)
defined?(Enumerable)
end
class Inflections
defined?(Object) # think of this as a preprocessor directive
StringClass = Object.const_get('String') # this ensures that a circular dependency doesn't exist between `String` and `Inflections` (Inflections should be built first).
# Specifies a new pluralization rule and its replacement. The rule can
# either be a string or a regular expression. The replacement should
# always be a string that may include references to the matched data from
# the rule.
def plural(rule, replacement)
@uncountables.delete(rule) if rule.is_a?(StringClass)
@uncountables.delete(replacement)
@plurals.prepend([rule, replacement])
end
# Specifies a new singularization rule and its replacement. The rule can
# either be a string or a regular expression. The replacement should
# always be a string that may include references to the matched data from
# the rule.
def singular(rule, replacement)
@uncountables.delete(rule) if rule.is_a?(StringClass)
@uncountables.delete(replacement)
@singulars.prepend([rule, replacement])
end
end I know this feels weird (and it's worth talking through). But at the end of the day. RubyMotion is compiled so these quasi-preprocessor-directives are needed. I have this repo and am slowly flattening and working through the circular dependencies and removing motion_require (trying to get a minimum patch this fixes these issues): https://github.com/amirrajan/motion-support-trouble-shooting Ask and you shall receive contributor access so you can help me uncomment code piece by piece. |
This is fixed in the most recent version of motion-support. |
Hello,
I have updated ruby motion version to v5 and using xcode9.2(ios11) and getting
undefined method
+' for classDate' (NameError)
/.rvm/gems/ruby-2.3.1/gems/motion-support-1.1.0/motion/core_ext/date/calculation: undefined method
+' for classDate' (NameError)
While 2 days ago same was working absolutely fine with xcode8.3(ios10). and before updating rubymotion version.
Thanks
The text was updated successfully, but these errors were encountered: