debugging eval, weird pipeline cache problems

This commit is contained in:
Torsten 2023-02-08 20:37:47 +02:00
parent e6e6265e26
commit 9080e458c4
9 changed files with 34 additions and 23 deletions

View File

@ -6,9 +6,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "vue_r" , path: "../"
gem "rails"
gem "bootsnap" , "1.15.0"
gem "puma" , "5.6.5"
gem "haml-rails"
gem "sqlite3"
gem "active_hash"
gem "opal-rails"

View File

@ -76,8 +76,6 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
bootsnap (1.15.0)
msgpack (~> 1.2)
builder (3.2.4)
concurrent-ruby (1.2.0)
crass (1.0.6)
@ -108,7 +106,6 @@ GEM
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.17.0)
msgpack (1.6.0)
net-imap (0.3.4)
date
net-protocol
@ -196,8 +193,8 @@ PLATFORMS
DEPENDENCIES
active_hash
bootsnap (= 1.15.0)
haml-rails
opal-rails
puma (= 5.6.5)
rails
sqlite3

View File

@ -1 +1,6 @@
require "vue_r"
require 'opal'
require 'promise'
require 'native'
require 'browser/setup/mini'
require "vue_r/application"
require "vue_r/mounter"

View File

@ -3,15 +3,17 @@
= #@image.attributes
.flex.justify-center
%a.underline{ e_click: "bg_change" , r_class: 'back'}
%a.underline{ e_click: "bg_change" , r_class: 'back(50)'}
{{ back }}
:opal
class Clicker < VueR::Application
def bg_change
self.state = !self.state
end
def back
self.state ? "bg-cyan-50" : "bg-cyan-200"
def back(arg)
puts "Arg:#{arg}:#{arg.class}"
str = self.state ? "bg-cyan-50" : "bg-cyan-200"
str + " " + arg.to_s
end
end

View File

@ -1,6 +1,7 @@
require_relative "boot"
require "rails/all"
require 'sprockets/railtie'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.

View File

@ -1,4 +1,3 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.

View File

@ -57,8 +57,8 @@ Rails.application.configure do
config.active_record.verbose_query_logs = true
# Suppress logger output for asset requests.
config.assets.quiet = true
config.assets.quiet = false
config.assets.debug = true
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true

View File

@ -1,6 +1,6 @@
require 'opal'
require 'native'
require 'promise'
require 'native'
require 'browser/setup/mini'
require "vue_r/application"
require "vue_r/mounter"

View File

@ -65,27 +65,33 @@ module VueR
def send_self(expression)
method , args = decompose(expression)
puts "Sending #{method}(#{args.join(',')})"
self.send method , *args
method = method.strip
puts "Sending #{method}(#{args&.join(',')})"
if(args == nil or args.empty?)
self.send( method )
else
self.send( method , *args )
end
end
def decompose(expression)
matches = expression.match(/\b[^()]+\((.*)\)$/)
return expression if matches.blank?
return expression if matches.nil?
method = expression.split("(").first
return [method , [] ] if m[1].empty?
args = m[1].split(",").collect{| arg | transform_arg(arg) }
puts "METHOD:#{method}"
return [method , [] ] if matches[1].empty?
args = matches[1].split(",").collect{| arg | transform_arg(arg) }
return [method , args]
end
def transform_arg(arg)
arg = arg.strip
puts "Arg:#{arg}:"
def transform_arg(argument)
arg = argument.strip
#puts "Arg:#{arg}:"
return true if arg == "true"
return false if arg == "false"
return nil if arg == "nil"
return arg.to_i if arg == arg.to_to_s
arg
return arg.to_i if arg == arg.to_i.to_s
return arg
end
end
end