Last active
June 20, 2016 14:11
-
-
Save mvidner/c02b0367a622eddc373774f291a24b83 to your computer and use it in GitHub Desktop.
ruby-lint loading definitions of overlapping namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "project-base" | |
require_relative "project-ui" | |
module Project | |
class Foo | |
def dialog_exists? | |
UI.WidgetExists(:dialog) | |
end | |
end | |
end | |
Project.hello | |
puts Project::UI.WidgetExists(:button) | |
puts Project::Foo.new.dialog_exists? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires: | |
- ./defs-project | |
- ./defs-ui-nested |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires: | |
- ./defs-project | |
- ./defs-ui-top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was automatically generated, any manual changes will be lost the | |
# next time this file is generated. | |
# | |
# Platform: ruby 2.1.2 | |
puts "loaded #{__FILE__}" | |
RubyLint.registry.register('Project') do |defs| | |
puts "registering Project (base)" | |
defs.define_constant('Project') do |klass| | |
klass.inherits(defs.constant_proxy('Object', RubyLint.registry)) | |
klass.define_method('hello') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was automatically generated, any manual changes will be lost the | |
# next time this file is generated. | |
# | |
# Platform: ruby 2.1.2 | |
puts "loaded #{__FILE__}" | |
RubyLint.registry.register('Project::UI') do |defs| | |
puts "registering Project::UI" | |
defs.define_constant('Project::UI') do |klass| | |
klass.inherits(defs.constant_proxy('Object', RubyLint.registry)) | |
klass.define_method('WidgetExists') do |method| | |
method.define_rest_argument('args') | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was automatically generated, any manual changes will be lost the | |
# next time this file is generated. | |
# | |
# Platform: ruby 2.1.2 | |
puts "loaded #{__FILE__}" | |
RubyLint.registry.register('Project') do |defs| | |
puts "registering Project (ui)" | |
defs.define_constant('Project') do |klass| | |
klass.inherits(defs.constant_proxy('Object', RubyLint.registry)) | |
end | |
defs.define_constant('Project::UI') do |klass| | |
klass.inherits(defs.constant_proxy('Object', RubyLint.registry)) | |
klass.define_method('WidgetExists') do |method| | |
method.define_rest_argument('args') | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Project | |
def self.hello | |
puts "Hello, Project" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Project | |
class UI | |
def self.WidgetExists(*args) | |
"#{args.inspect} exists" | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ruby app.rb | |
ruby-lint -c cfg-top.yml app.rb | |
ruby-lint -c cfg-nested.yml app.rb | |
exit | |
# the definitions were made like this | |
rake -r project-base generate:definitions[Project,.]; mv project.rb defs-project.rb | |
rake -r project-ui generate:definitions[Project,.]; mv project.rb defs-ui-top.rb | |
rake -r project-ui generate:definitions[Project::UI,.]; mv project.rb defs-ui-nested.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is issue https://github.com/YorickPeterse/ruby-lint/issues/181