Skip to content

Instantly share code, notes, and snippets.

View boc-tothefuture's full-sized avatar

boc-tothefuture

  • Google
  • Cary, NC
View GitHub Profile
class Foo
def initialize()
@num=5
end
def coerce(other)
puts "Coerce called with #{other.inspect} and class #{other.class}"
[other, @num]
end
getStackTrace at java/lang/Thread.java:1607
getBacktraceData at org/jruby/runtime/backtrace/TraceType.java:242
getBacktrace at org/jruby/runtime/backtrace/TraceType.java:53
captureBacktrace at org/jruby/RubyException.java:371
preRaise at org/jruby/exceptions/RaiseException.java:115
<init> at org/jruby/exceptions/RaiseException.java:65
<init> at org/jruby/exceptions/Exception.java:38
<init> at org/jruby/exceptions/StandardError.java:38
<init> at org/jruby/exceptions/NameError.java:38
<init> at org/jruby/exceptions/NoMethodError.java:38
Exception `NameError' at java/lang/Thread.java:1607 - cannot load Java class org.openhab.core.thing.internal.ThingImpl
Exception `NameError' at java/lang/Thread.java:1607 - cannot load Java class org.openhab.core.thing.internal.ThingImpl
Exception `NameError' at java/lang/Thread.java:1607 - cannot load Java class org.openhab.core.thing.internal.ThingImpl
NameError: cannot load Java class org.openhab.core.thing.internal.ThingImpl
getStackTrace at java/lang/Thread.java:1607
getBacktraceData at org/jruby/runtime/backtrace/TraceType.java:242
getBacktrace at org/jruby/runtime/backtrace/TraceType.java:53
captureBacktrace at org/jruby/RubyException.java:371
preRaise at org/jruby/exceptions/RaiseException.java:115
<init> at org/jruby/exceptions/RaiseException.java:65
Automation manager not loaded: true
Scope Values called!
## Java Output Below showing items being put into ScriptEngine
Filtered!
Condition:interface org.openhab.core.automation.Condition
Action:interface org.openhab.core.automation.Action
ConditionBuilder:class org.openhab.core.automation.util.ConditionBuilder
Trigger:interface org.openhab.core.automation.Trigger
Configuration:class org.openhab.core.config.core.Configuration
@boc-tothefuture
boc-tothefuture / import.rb
Created November 7, 2020 21:40
Importing into Context
def debug_variables()
pp "Instance #{instance_variables}"
pp "Global #{global_variables}"
pp "Load Path #{$LOAD_PATH}"
# pp "Constants #{Module.constants}"
end
puts "Checking for Automation manager: #{$automationManager.nil?}"
until $automationManager
"***Classpath****"
["file:/Users/personal/openhab-2.5.10/conf/automation/jruby/jruby-complete-9.2.13.0.jar"]
"*******"
"***Classpath****"
["file:/Users/personal/openhab-2.5.10/conf/automation/jruby/jruby-complete-9.2.13.0.jar"]
"*******"
"***special****"
["/Users/personal/openhab-2.5.10/conf/automation/jruby/lib/ruby/2.5/site_ruby", "/Users/personal/openhab-2.5.10/conf/automation/jruby/lib/ruby/stdlib", "uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared/gems/did_you_mean-1.2.0/lib", "uri:classloader:/META-INF/jruby.home/lib/ruby/2.5/site_ruby", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib"]
"*******"
"***Load Path****"
@boc-tothefuture
boc-tothefuture / test.rb
Created October 30, 2020 21:06
OpenHab/JRuby
#require 'java'
#require 'jruby'
#require 'logger'
#require 'csv'
p "***Classpath****"
p $CLASSPATH
p "*******"
$CLASSPATH << '/Users/boc@us.ibm.com/personal/openhab-2.5.10/conf/automation/jruby/jruby-complete-9.2.13.0.jar'
==> default: ===> Missing/wrong version packages: ksh, compat-glibc, compat-glibc-headers, kernel-devel, compat-libstdc++-33, compat-libstdc++-33.i686, libstdc++.i686, nss-softokn-freebl.i686, glibc.i686, libgcc.i686, ksh, compat-glibc, compat-glibc-headers, kernel-devel, compat-libstdc++-33, compat-libstdc++-33(x86-32), libstdc++(x86-32), nss-softokn-freebl(x86-32), glibc(x86-32), libgcc(x86-32)
==> default: ===> Running as root; installing missing/wrong version build_depends and depends with Puppet
==> default: ===> Installing package: ksh
==> default: ===> created
==> default: ===> Installing package: compat-glibc
==> default: ===> created
==> default: ===> Installing package: compat-glibc-headers
==> default: ===> Installing package: kernel-devel
==> default: ===> created
==> default: ===> Installing package: compat-libstdc++-33
cd build/recipes
sudo fpm-cook clean --tmp-root /tmp/fpm-temp --cache-dir /tmp/fpm-cache --pkg-dir /home/vagrant/build/pkg
sudo fpm-cook install-deps
sudo fpm-cook package --no-deps --tmp-root /tmp/fpm-temp --cache-dir /tmp/fpm-cache --pkg-dir /home/vagrant/build/pkg
@boc-tothefuture
boc-tothefuture / gist:0d1c722a0e306aad3cc9
Created August 25, 2015 21:40
FPM Cookery Test with Package Dependency Issue
class Test < FPM::Cookery::Recipe
name 'Test'
version '1:1.0.0.0'
source '', :with => :noop
omnibus_package true
omnibus_dir '/tmp'
def build
end