<commit_before>#######################################################
#
# ruboto.rb (by <NAME>)
#
# Wrapper for using RubotoActivity in Ruboto IRB
#
#######################################################

$RUBOTO_VERSION = 4

def confirm_ruboto_version(required_version, exact=true)
  raise "requires $RUBOTO_VERSION=#{required_version} or greater, current version #{$RUBOTO_VERSION}" if $RUBOTO_VERSION < required_version and not exact
  raise "requires $RUBOTO_VERSION=#{required_version}, current version #{$RUBOTO_VERSION}" if $RUBOTO_VERSION != required_version and exact
end

require 'java'



%w(Activity BroadcastReceiver).map do |klass|
  java_import "org.ruboto.Ruboto#{klass}"
end

RUBOTO_CLASSES = [RubotoActivity, RubotoBroadcastReceiver]

# Automate this?
#java_import "org.ruboto.embedded.RubotoView"

java_import "android.app.Activity"
java_import "android.content.Intent"
java_import "android.os.Bundle"

java_import "android.view.View"
java_import "android.view.ViewGroup"

java_import "android.widget.Toast"

java_import "android.widget.ArrayAdapter"
java_import "java.util.Arrays"
java_import "java.util.ArrayList"
java_import "android.R"

java_import "android.util.Log"

module Ruboto
  java_import "THE_PACKAGE.R"
  begin
    Id = JavaUtilities.get_proxy_class("THE_PACKAGE.R$id")
  rescue NameError
    Log.d "RUBOTO", "no R$id"
  end<commit_msg>add Service to the stuff ruboto.rb metaprograms<commit_after>#######################################################
#
# ruboto.rb (by <NAME>)
#
# Wrapper for using RubotoActivity in Ruboto IRB
#
#######################################################

$RUBOTO_VERSION = 4

def confirm_ruboto_version(required_version, exact=true)
  raise "requires $RUBOTO_VERSION=#{required_version} or greater, current version #{$RUBOTO_VERSION}" if $RUBOTO_VERSION < required_version and not exact
  raise "requires $RUBOTO_VERSION=#{required_version}, current version #{$RUBOTO_VERSION}" if $RUBOTO_VERSION != required_version and exact
end

require 'java'



%w(Activity BroadcastReceiver Service).map do |klass|
  java_import "org.ruboto.Ruboto#{klass}"
end

RUBOTO_CLASSES = [RubotoActivity, RubotoBroadcastReceiver, RubotoService]

# Automate this?
#java_import "org.ruboto.embedded.RubotoView"

java_import "android.app.Activity"
java_import "android.content.Intent"
java_import "android.os.Bundle"

java_import "android.view.View"
java_import "android.view.ViewGroup"

java_import "android.widget.Toast"

java_import "android.widget.ArrayAdapter"
java_import "java.util.Arrays"
java_import "java.util.ArrayList"
java_import "android.R"

java_import "android.util.Log"

module Ruboto
  java_import "THE_PACKAGE.R"
  begin
    Id = JavaUtilities.get_proxy_class("THE_PACKAGE.R$id")
  rescue NameError
    Log.d "RUBOTO", "no R$id"
  end
{'fraction_non_alphanumeric': 0.17649160414433726, 'fraction_numerical': 0.0007145409074669524, 'mean_word_length': 6.865168539325842, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4128052', 'n_tokens_mistral': 941, 'n_tokens_neox': 906, 'n_words': 195}