Skip to content

Commit 5d8c95e

Browse files
OriPekelmanclaude
andcommitted
catalog: harvest #9 @ 5c9790c — +11 verified (146 ★), rubysl batch, 3 new bugs filed
Batch 9 (incl. rubysl-* stdlib ports): +11 ★ (stringglob, ios-deploy, yoshiki, amazon, bundler_signature_check, rumm, rubysl-enumerator, rwdschedule, moneybook, rubysl-weakref...); catalog 135→146. Filed: - #1357 unary operator methods (def -@/+@) emit literal '@' into C ids - #1358 def <<(x) on a user class lowered as C bit-shift, not dispatch - #1356 comment: alias-source resolution also misses inherited/module/ plain methods (rubysl-logger, slowweb, rubysl-prime, rbgraph) Reinforced: #1348 (to_ascii/abbrev too-few-args), #1352 (self undeclared x5), #1354 (cvar undeclared: i18n-globals, validiso). #1307 confirmed working as designed (rubysl-english gets the clear diagnostic). Pooled: rand(2^32) int-overflow core-dump (rubysl-tmpdir), rescue-var lv_e undeclared (server_health_check), custom-Error-subclass codegen (red_blocks). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 56a5538 commit 5d8c95e

143 files changed

Lines changed: 5671 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

harness/smoke/GData.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Smoke: GData gem — Google Data API client (legacy, 2007-era)
2+
# Exercises: GData::Spreadsheet#entry (XML generation), attribute readers from GData::Base
3+
4+
# Stub unavailable external gems so CRuby can load this gem.
5+
# Under Spinel, plain `require` to other gems is silently ignored anyway.
6+
$LOADED_FEATURES << 'hpricot' unless $LOADED_FEATURES.include?('hpricot')
7+
$LOADED_FEATURES << 'builder' unless $LOADED_FEATURES.include?('builder')
8+
module Hpricot; end unless defined?(Hpricot)
9+
module Builder;
10+
class XmlMarkup; end
11+
end unless defined?(Builder)
12+
13+
# Pre-declare GData as a module so that gdata/base.rb can reopen it.
14+
# (The top-level gdata.rb declares it as a class, causing a TypeError when
15+
# gdata/base.rb tries to reopen it as a module. The bin scripts bypass this
16+
# by requiring gdata/spreadsheet or gdata/blogger directly.)
17+
module GData
18+
VERSION = '0.0.4'
19+
end unless defined?(GData) && GData.is_a?(Module) && !GData.is_a?(Class)
20+
21+
require 'gdata/base'
22+
require 'gdata/spreadsheet'
23+
24+
# --- GData::Spreadsheet attribute readers (from GData::Base) ---
25+
gs = GData::Spreadsheet.new('spreadsheet_abc123')
26+
puts gs.service # => wise
27+
puts gs.source # => gdata-ruby
28+
puts gs.url # => spreadsheets.google.com
29+
30+
# --- GData::Spreadsheet#entry generates an Atom+GS XML fragment ---
31+
# Default row=1, col=1
32+
xml1 = gs.entry('SQRT(16)', 1, 1)
33+
puts xml1.include?("xmlns:gs='http://schemas.google.com/spreadsheets/2006'") # => true
34+
puts xml1.include?("inputValue='=SQRT(16)'") # => true
35+
puts xml1.include?("row='1'") # => true
36+
puts xml1.include?("col='1'") # => true
37+
38+
# Custom row/col
39+
xml2 = gs.entry('SUM(B2:B10)', 4, 2)
40+
puts xml2.include?("inputValue='=SUM(B2:B10)'") # => true
41+
puts xml2.include?("row='4'") # => true
42+
puts xml2.include?("col='2'") # => true
43+
44+
# --- @headers nil => public path in evaluate_cell (test the path string logic) ---
45+
# We can't call the network, but the path computation logic uses @headers truthiness.
46+
# Construct what the path would be (no-auth => 'public')
47+
expected_path_fragment = gs.instance_variable_get(:@headers) ? "private" : "public"
48+
puts expected_path_fragment # => public
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'indirizzo'
2+
3+
# Parse a standard US address
4+
a = Indirizzo::Address.new("1600 Pennsylvania Ave NW, Washington, DC 20500")
5+
puts a.number
6+
puts a.state
7+
puts a.zip
8+
puts a.street.first
9+
puts a.city.first
10+
11+
# Parse an address with a building type suffix
12+
b = Indirizzo::Address.new("350 Fifth Avenue, New York, NY 10118")
13+
puts b.number
14+
puts b.state
15+
puts b.zip
16+
17+
# Test po_box? on a regular address (should be false)
18+
puts a.po_box?.inspect
19+
20+
# Test intersection? on a regular address (should be false)
21+
puts a.intersection?.inspect
22+
23+
# Test Map lookup
24+
puts Indirizzo::State["California"]
25+
puts Indirizzo::State["TX"]
26+
puts Indirizzo::Directional["North"]
27+
puts Indirizzo::Suffix_Type["Street"]

harness/smoke/O_O.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
require 'O_O'
2+
3+
# O_O is a StandardError subclass — its entire API is raise/rescue
4+
5+
# 1. Class hierarchy
6+
puts O_O.ancestors.include?(StandardError) # true
7+
puts O_O.ancestors.include?(Exception) # true
8+
puts O_O.superclass # StandardError
9+
10+
# 2. Raise and rescue with default message
11+
begin
12+
raise O_O
13+
rescue O_O => e
14+
puts e.class # O_O
15+
puts e.is_a?(StandardError) # true
16+
end
17+
18+
# 3. Raise with a custom message
19+
begin
20+
raise O_O, "something went wrong"
21+
rescue O_O => e
22+
puts e.message # something went wrong
23+
end
24+
25+
# 4. Rescue as StandardError (polymorphism)
26+
caught = false
27+
begin
28+
raise O_O, "caught as std"
29+
rescue StandardError => e
30+
caught = true
31+
puts e.class # O_O
32+
end
33+
puts caught # true
34+
35+
# 5. Not caught by RuntimeError rescue
36+
caught_runtime = false
37+
begin
38+
raise O_O, "not runtime"
39+
rescue RuntimeError
40+
caught_runtime = true
41+
rescue O_O
42+
caught_runtime = false
43+
end
44+
puts caught_runtime # false

harness/smoke/aaf-gumboot.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# frozen_string_literal: true
2+
3+
# aaf-gumboot: AAF Rails bootstrap helpers gem
4+
# Public surface that loads without Rails/ActiveSupport/Mysql2:
5+
# Gumboot module + Gumboot::VERSION
6+
# Gumboot::Strap requires active_support (deep_merge) and is Rails-only.
7+
8+
require 'aaf-gumboot'
9+
10+
# Module identity
11+
puts Gumboot.class
12+
puts Gumboot.name
13+
14+
# Version constant
15+
puts Gumboot::VERSION
16+
puts Gumboot::VERSION.split('.').map(&:to_i).all? { |n| n >= 0 }
17+
18+
# Module is a proper Ruby module with no instance methods beyond Object
19+
public_methods = Gumboot.public_methods(false).sort
20+
puts public_methods.inspect
21+
22+
# Demonstrate that Gumboot is a properly defined module
23+
puts Gumboot.is_a?(Module)
24+
puts Gumboot.respond_to?(:name)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Smoke: activeadmin_globalize_inputs
2+
# The gem reopens Formtastic::FormBuilder and adds globalize_inputs.
3+
# All real logic requires Rails/ActiveAdmin/formtastic at runtime, so we
4+
# exercise what is actually self-contained: the module structure and the
5+
# method definition added by the gem.
6+
7+
# Stub out the heavy deps so the require succeeds
8+
module Formtastic
9+
class FormBuilder
10+
end
11+
end
12+
13+
require 'activeadmin_globalize_inputs'
14+
15+
# Verify the method was grafted onto the class
16+
has_method = Formtastic::FormBuilder.method_defined?(:globalize_inputs)
17+
puts "globalize_inputs defined: #{has_method}"
18+
19+
# Verify the module hierarchy
20+
puts "Formtastic::FormBuilder ancestors include Formtastic::FormBuilder: #{Formtastic::FormBuilder.ancestors.include?(Formtastic::FormBuilder)}"
21+
22+
# Verify it's an instance method (not a class method)
23+
class_method = Formtastic::FormBuilder.respond_to?(:globalize_inputs)
24+
puts "globalize_inputs is NOT a class method: #{!class_method}"
25+
26+
# Confirm the method arity (accepts *args and a block)
27+
arity = Formtastic::FormBuilder.instance_method(:globalize_inputs).arity
28+
puts "globalize_inputs arity: #{arity}"

harness/smoke/adyen-skinbuilder.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Smoke test for adyen-skinbuilder
2+
# The main require only loads version; hash.rb is a standalone extension.
3+
require 'adyen-skinbuilder'
4+
require 'hash'
5+
6+
# Exercise the VERSION constant
7+
puts Adyen::Skinbuilder::VERSION
8+
9+
# Exercise Hash#symbolize_keys! with string keys
10+
h = { 'name' => 'adyen', 'version' => 42, 'nested' => { 'key' => 'value' } }
11+
h.symbolize_keys!
12+
puts h[:name]
13+
puts h[:version]
14+
puts h[:nested][:key]
15+
16+
# Verify the method returns self (mutates in place)
17+
h2 = { 'a' => 1, 'b' => 2 }
18+
result = h2.symbolize_keys!
19+
puts result.equal?(h2)
20+
puts h2[:a]
21+
puts h2[:b]

harness/smoke/amazon.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'amazon'
2+
3+
# amazon 0.0.1 is a skeleton gem ("Squat") with only a VERSION constant
4+
# and an empty module. There is no public API beyond the module itself.
5+
6+
puts Amazon::VERSION
7+
puts Amazon.class
8+
puts Amazon.is_a?(Module)
9+
puts Amazon.respond_to?(:new)

harness/smoke/angael.rb

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
require 'angael'
2+
3+
# Exercise Angael::Worker module inclusion and state methods
4+
class MyWorker
5+
include Angael::Worker
6+
7+
def work
8+
# no-op in tests
9+
end
10+
end
11+
12+
w = MyWorker.new
13+
14+
# Initially not started (no pid)
15+
puts w.stopped? # true
16+
puts w.started? # false
17+
puts w.stopping? # nil/false (not yet set)
18+
19+
# inspect shows class name and pid (nil)
20+
puts w.inspect # #<JobWorker:... @pid=>
21+
22+
# Exercise Angael::Manager instantiation
23+
m = Angael::Manager.new(MyWorker, 3)
24+
puts m.workers.size # 3
25+
puts m.workers.all? { |w| w.is_a?(MyWorker) } # true
26+
27+
# Manager with restart_after option
28+
m2 = Angael::Manager.new(MyWorker, 2, [], restart_after: 10)
29+
puts m2.workers.size # 2
30+
31+
# Invalid restart_after raises ArgumentError
32+
begin
33+
Angael::Manager.new(MyWorker, 1, [], restart_after: 0)
34+
puts "no error"
35+
rescue ArgumentError => e
36+
puts "ArgumentError: #{e.message}"
37+
end
38+
39+
# ProcessHelper#exit_status(nil) returns [nil, nil]
40+
class PH
41+
include Angael::ProcessHelper
42+
end
43+
ph = PH.new
44+
result = ph.exit_status(nil)
45+
puts result.inspect # [nil, nil]
46+
47+
# VERSION
48+
puts Angael::VERSION # 0.1.3
49+
50+
# LOOP_SLEEP_SECONDS
51+
puts Angael::Manager::LOOP_SLEEP_SECONDS # 1

harness/smoke/as-duration.rb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
require 'as-duration'
2+
3+
# Basic Duration creation via Numeric core_ext methods
4+
d_secs = 30.seconds
5+
puts d_secs.to_i # => 30
6+
puts d_secs.to_f # => 30.0
7+
8+
d_mins = 5.minutes
9+
puts d_mins.to_i # => 300
10+
11+
d_hours = 2.hours
12+
puts d_hours.to_i # => 7200
13+
14+
d_days = 3.days
15+
puts d_days.to_i # => 259200
16+
17+
# Integer-only methods
18+
d_months = 2.months
19+
puts d_months.to_i # => 5184000
20+
21+
d_years = 1.year
22+
puts d_years.to_i # => 31536000
23+
24+
# Addition of durations
25+
combined = 1.hour + 30.minutes
26+
puts combined.to_i # => 5400
27+
28+
# Subtraction
29+
diff = 2.hours - 30.minutes
30+
puts diff.to_i # => 5400
31+
32+
# Negation
33+
neg = -5.minutes
34+
puts neg.to_i # => -300
35+
36+
# Comparison
37+
puts (1.hour > 30.minutes) # => true
38+
puts (1.hour == 60.minutes) # => true
39+
puts (1.minute < 1.hour) # => true
40+
41+
# parts inspection
42+
d = 3.days
43+
parts = d.parts
44+
puts parts.inspect # => [[:days, 3]]
45+
46+
# advance a fixed Time (UTC, deterministic)
47+
base_time = Time.utc(2024, 1, 1, 12, 0, 0)
48+
advanced = 1.day.from(base_time)
49+
puts advanced.year # => 2024
50+
puts advanced.month # => 1
51+
puts advanced.day # => 2
52+
puts advanced.hour # => 12
53+
54+
# advance by months
55+
base_time2 = Time.utc(2024, 3, 31, 0, 0, 0)
56+
advanced2 = 1.month.from(base_time2)
57+
puts advanced2.year # => 2024
58+
puts advanced2.month # => 4
59+
puts advanced2.day # => 30 (Apr has 30 days)
60+
61+
# until / before
62+
earlier = 2.hours.until(base_time)
63+
puts earlier.year # => 2024
64+
puts earlier.hour # => 10
65+
66+
# weeks
67+
d_weeks = 2.weeks
68+
puts d_weeks.to_i # => 1209600

0 commit comments

Comments
 (0)