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

Integrate the repl completely into scald.rb. Fixup scald-rb for better hdfs-local mode now with our provides #902

Merged
merged 11 commits into from
Jun 25, 2014

Conversation

ianoc
Copy link
Collaborator

@ianoc ianoc commented Jun 16, 2014

Tested with ruby 1.9.3 , may not support 1.8.7, though not really too worried about that.

@sriramkrishnan
Copy link
Collaborator

Don't know enough Ruby to review this properly, but couple of comments:


# Now run a basic test for the REPL
# If the content of the output is different, diff will fail with a non-zero exit code
$SCALD_REPL < tutorial/ReplTutorial1.scala
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the repl test.

@bholt
Copy link
Contributor

bholt commented Jun 17, 2014

Cool, thanks @ianoc! Can't test it at the moment, but looks like you've gotten it to find the paths for Hadoop, excellent.

@bholt
Copy link
Contributor

bholt commented Jun 23, 2014

I did have a couple problems running from 1.8.7, all it took to make it work for both (for me), was the following:

diff --git a/scripts/scald.rb b/scripts/scald.rb
index b6bcde6..b064668 100755
--- a/scripts/scald.rb
+++ b/scripts/scald.rb
@@ -165,7 +165,7 @@ def find_dependencies(org, dep, version)
   mapVer
 end

-def find_dependency(org="org.scala-lang", dep, version)
+def find_dependency(dep, version, org="org.scala-lang")
   dep = find_dependencies(org, dep, version)["#{org}:#{dep}:#{version}"]
   raise "Dependency #{dep}:#{version} not found" unless dep
   dep
@@ -574,10 +574,7 @@ SHELL_COMMAND =
   end

 def getStty()
-  r, w = IO.pipe
-  system("stty -g", :out=>w, :err=>"/dev/null")
-  w.close
-  r.read.strip
+  `stty -g 2>/dev/null`
 end

 def restoreStty(stty)

(Ruby 1.8.7 doesn't support out of order default args, and system has undergone several changes throughout ruby versions, so just sticking with backticks in this case seems more portable)

@bholt
Copy link
Contributor

bholt commented Jun 23, 2014

I also am just a bit irked by the warning: already initialized constant SCALA_LIB_DIR message I get every time. We could just rename the variable to be a global variable rather than constant ($scala_lib_dir).

@bholt
Copy link
Contributor

bholt commented Jun 23, 2014

One more thing: should we default to enabling -Yrepl-sync when they specify --repl? It seems like a sensible default, and it would not be something I would necessarily think to look for a flag to fix.

@bholt
Copy link
Contributor

bholt commented Jun 23, 2014

This should close #888.

@ianoc
Copy link
Collaborator Author

ianoc commented Jun 23, 2014

I removed the default arg... moving it to the end breaks maven conventions. Uses the backticks

@bholt
Copy link
Contributor

bholt commented Jun 24, 2014

lgtm, runs on 1.8.7

@ianoc
Copy link
Collaborator Author

ianoc commented Jun 24, 2014

@johnynek merge?

jcoveney added a commit that referenced this pull request Jun 25, 2014
Integrate the repl completely into scald.rb. Fixup scald-rb for better hdfs-local mode now with our provides
@jcoveney jcoveney merged commit 25538b3 into develop Jun 25, 2014
@jcoveney jcoveney deleted the feature/fixReplLocalHDFS branch June 25, 2014 22:11
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.

None yet

4 participants