Skip to content
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

search for index.js #2 #18

Closed
wants to merge 4 commits into from
Closed

search for index.js #2 #18

wants to merge 4 commits into from

Conversation

simi
Copy link

@simi simi commented Apr 27, 2015

followup to #17

I try to add specs soon.

/cc @cowboyd @ftiasch

@cowboyd
Copy link
Owner

cowboyd commented May 21, 2015

Ok, this looks good. Can we add some specs for the new behavior?

@simi
Copy link
Author

simi commented May 21, 2015

sure

@Wardrop
Copy link

Wardrop commented Oct 14, 2016

Can this be merged already?

@cowboyd
Copy link
Owner

cowboyd commented Oct 17, 2016

@Wardrop As you can see from the last comment this PR is waiting on specs for the added behavior so the answer to your question is no. However, if you would like to take a crack at writing those specs, I would be happy to assist in any way I can.

@ojab
Copy link

ojab commented Dec 10, 2016

At least this should be added to correctly require files in modules that was required by dirname:

diff --git a/lib/commonjs/module.rb b/lib/commonjs/module.rb
index 27b318d..4529ee5 100644
--- a/lib/commonjs/module.rb
+++ b/lib/commonjs/module.rb
@@ -5,6 +5,9 @@ module CommonJS
     attr_accessor :exports

     def initialize(id, env, append = false)
+      id.sub!(%r{/index.js$}, '') if append
       @id = id
       @env = env
       @exports = env.new_object

@simi simi closed this Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants