Git Product home page Git Product logo

duby's Introduction

duby's People

Contributors

bobzoller avatar consiliens avatar headius avatar nex3 avatar osseta avatar technomancy avatar xraid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

duby's Issues

Classpath parsing fails on Linux when compiling duby

The classpath parsing code in lib/duby.rb line:240

  when '--classpath', '-c'
    args.shift
   args.shift.split(RbConfig::CONFIG['PATH_SEPARATOR']).each do |path|
      $CLASSPATH << path
    end

PATH_SEPARATOR on Ubuntu returns '' as it is not set and thus the parsing fails to correctly parse out the classpath.

This needs a default value of ';' (semi-colon) under Windows and ':' (colon) on *nix. Also where class paths are hardcoded to use ':' (see rake tasks) this should be generated to use the correct delimiter for each OS.

FYI: the error you get on linux is:
llinux:~/duby$ ../jruby/bin/jruby -S rake compile
mkdir -p dist
mkdir -p build
Compiling Ruby sources
Generating Java class DubyCommand to build/org/jruby/duby/DubyCommand.java
javac -d build -cp ../jruby/lib/jruby.jar:. build/org/jruby/duby/DubyCommand.java
Compiling Duby sources
org/jruby/duby/ant/compile.duby:2: cannot load Java class org.jruby.duby.DubyCommand
import org.jruby.duby.DubyCommand
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Closures blocking out the surrounding scope for classes/instances

An example, with the Android API:

hello = self
btn.setOnClickListener do
  def onClick(v)
    return if hello.txt.getText.toString.length == 0
    hello.addMessage("hellotester", Hello(v.getContext).txt.getText.toString)
    message = Bundle.new
    message.putString("say", Hello(v.getContext).txt.getText.toString)
    Message m = Message.obtain
    m.setData(message)
    hello.client.handler.sendMessage(m)
    hello.txt.setText("")
  end
end

hello is not accessible. Workaround here is to use Hello(v.getContext) (where Hello is the name of the class).

Direct access to ARGV

It is currently possible to access the command line arguments when writing a Duby script like this

class MyClass
  def self.main(args:String[])
     puts args
  end
end

But it's not possible to use ARGV like it is in Ruby. This script will currently fail:

puts ARGV

It would be cool if ARGV would be available outside explicitly declared classes.
In the generated java code, args is available at the moment, but at compile time, the type of args cannot be inferred. I guess it could be enough to globally declare args as String[] but I prefer the usage of ARGV outside of an explicit main method.

Accessing nested classes

Accessing nested classes currently tries to call the nested class as a method on the parent, rather than just getting that class.

Current workaround is to import the nested class itself, via this syntax:

import "Child", "com.example.Parent$Child"

And then just use Child.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.