thunderbolt 0.1.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a505429fd8ef2a2bc599354c42a8884261f1e2c7dac2763ec8e7a2994c6d5fff
4
- data.tar.gz: 6f9402b1b97988597a920b38b20ea6d19598edc4888549237920d15977074039
3
+ metadata.gz: e7aa98238a287ec0c46c5e792d7f8ea0bed40ce302bacdcae6109c209e798c3b
4
+ data.tar.gz: ce79efcaf4c27beb9719848ad6c9d2b936f3e789bd6585de115dbcc6744939c2
5
5
  SHA512:
6
- metadata.gz: 0a9b4ce5c31f73cac0569926a9ce2cb9ecc64ed65a603ecf72ab141947fd3d89acab65edef9254121e2d302f6d6f237ed74e9061759955e5b092aa5aa4a0485f
7
- data.tar.gz: 37e0be69244b75d10b55fdd9b65e94433c771d5c3bc4d90b73a25357cea6f6cbeb875cfb81c87e9a5a3406b2524ac21a6a404c85a6506f4bbe4e4ebeb9af35bf
6
+ metadata.gz: 12c82254f3e546081c1b022bac53eab3856c113bb53937b5a331f2a40873e8e9050e95f2a49452f74ae78802afbc0df2376ebdc75741042a1c05eaf209014e35
7
+ data.tar.gz: 3bacf82a554d31c339c34bcc06dc4cefc01114f94d235266b7794aa1c53be34f0b7ace3b62b4f223d59f2702683643afd56f8243655493549e4c15a898b15e88
data/README.md CHANGED
@@ -1,43 +1 @@
1
- # Thunderbolt
2
-
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/thunderbolt`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15
- ```
16
-
17
- If bundler is not being used to manage dependencies, install the gem by executing:
18
-
19
- ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21
- ```
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/thunderbolt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/thunderbolt/blob/master/CODE_OF_CONDUCT.md).
36
-
37
- ## License
38
-
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Thunderbolt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/thunderbolt/blob/master/CODE_OF_CONDUCT.md).
1
+ Comming Soon
metadata CHANGED
@@ -1,34 +1,119 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thunderbolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
- - albertalef
8
- bindir: exe
7
+ - Albert Alef
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
12
- description: The best ruby web framework
13
- email:
14
- - albertalef@protonmail.com
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: thundercli
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - '='
17
+ - !ruby/object:Gem::Version
18
+ version: 0.2.1
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - '='
24
+ - !ruby/object:Gem::Version
25
+ version: 0.2.1
26
+ - !ruby/object:Gem::Dependency
27
+ name: thunderchunk
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - '='
31
+ - !ruby/object:Gem::Version
32
+ version: 0.2.1
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '='
38
+ - !ruby/object:Gem::Version
39
+ version: 0.2.1
40
+ - !ruby/object:Gem::Dependency
41
+ name: thunderfoundation
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.2.1
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '='
52
+ - !ruby/object:Gem::Version
53
+ version: 0.2.1
54
+ - !ruby/object:Gem::Dependency
55
+ name: thunderframe
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '='
59
+ - !ruby/object:Gem::Version
60
+ version: 0.2.1
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '='
66
+ - !ruby/object:Gem::Version
67
+ version: 0.2.1
68
+ - !ruby/object:Gem::Dependency
69
+ name: thunderoperation
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '='
73
+ - !ruby/object:Gem::Version
74
+ version: 0.2.1
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '='
80
+ - !ruby/object:Gem::Version
81
+ version: 0.2.1
82
+ - !ruby/object:Gem::Dependency
83
+ name: thunderspec
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '='
87
+ - !ruby/object:Gem::Version
88
+ version: 0.2.1
89
+ type: :runtime
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '='
94
+ - !ruby/object:Gem::Version
95
+ version: 0.2.1
96
+ - !ruby/object:Gem::Dependency
97
+ name: thunderwire
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '='
101
+ - !ruby/object:Gem::Version
102
+ version: 0.2.1
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: 0.2.1
15
110
  executables: []
16
111
  extensions: []
17
112
  extra_rdoc_files: []
18
113
  files:
19
- - CHANGELOG.md
20
114
  - README.md
21
- - Rakefile
22
- - lib/thunderbolt.rb
23
- - lib/thunderbolt/version.rb
24
- homepage: https://avantsoft.com.br/pt-br/
25
- licenses:
26
- - MIT
115
+ licenses: []
27
116
  metadata:
28
- allowed_push_host: https://rubygems.org
29
- homepage_uri: https://avantsoft.com.br/pt-br/
30
- source_code_uri: https://avantsoft.com.br/pt-br/
31
- changelog_uri: https://avantsoft.com.br/pt-br/
32
117
  rubygems_mfa_required: 'true'
33
118
  rdoc_options: []
34
119
  require_paths:
@@ -37,14 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
37
122
  requirements:
38
123
  - - ">="
39
124
  - !ruby/object:Gem::Version
40
- version: 3.2.0
125
+ version: '3.4'
41
126
  required_rubygems_version: !ruby/object:Gem::Requirement
42
127
  requirements:
43
128
  - - ">="
44
129
  - !ruby/object:Gem::Version
45
130
  version: '0'
46
131
  requirements: []
47
- rubygems_version: 3.7.2
132
+ rubygems_version: 3.6.9
48
133
  specification_version: 4
49
- summary: The best ruby web framework
134
+ summary: Operations with declarative flows, organized in chunks
50
135
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2025-10-19
4
-
5
- - Initial release
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Thunderbolt
4
- VERSION = "0.1.0"
5
- end
data/lib/thunderbolt.rb DELETED
@@ -1,104 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "thunderbolt/version"
4
- require "rubygems"
5
- require "eventmachine"
6
- require "debug"
7
- require "json"
8
- require "active_support/all"
9
-
10
- module Thunderbolt
11
- class Error < StandardError; end
12
- # Your code goes here...
13
-
14
- module WebSocketServer
15
- def self.connections
16
- @connections ||= []
17
- end
18
-
19
- def post_init
20
- WebSocketServer.connections << self
21
- end
22
-
23
- def receive_data(data)
24
- puts "Data:"
25
- puts data
26
-
27
- headers = parse_headers(data)
28
-
29
- frames = headers == {} ? parse_frames(data) : []
30
-
31
- frames.each do |e|
32
- puts e[:decoded_payload]
33
- end
34
-
35
- send_data build_response(headers) if frames.empty?
36
- end
37
-
38
- def parse_headers(data)
39
- return {} unless data.lines[0].include?("HTTP/1.1")
40
-
41
- found_data_separator = false
42
-
43
- data.lines[1..].map do |line|
44
- found_data_separator = line == "\r\n"
45
-
46
- found_data_separator ? nil : line.chomp.split(": ", 2)
47
- end.compact.to_h
48
- end
49
-
50
- def parse_frames(data)
51
- first_frame = parse_frame(data)
52
-
53
- result = (parse_frames(first_frame[:packed_byte_array]) unless first_frame[:packed_byte_array].blank?)
54
-
55
- [first_frame, result].compact.flatten
56
- end
57
-
58
- def parse_frame(data)
59
- return if data.empty?
60
-
61
- byte_array = data.unpack("C*")
62
-
63
- info_byte_int = byte_array.shift(1).first
64
- length_byte_int = byte_array.shift(1).first
65
- mask_bytes = byte_array.shift(4)
66
-
67
- length = (length_byte_int & 0b01111111)
68
-
69
- encoded_payload = byte_array.shift(length)
70
-
71
- decoded_payload = encoded_payload.map.with_index { |a, i| a ^ mask_bytes[i % 4] }.pack("C*")
72
-
73
- {
74
- info_byte_int:,
75
- length_byte_int:,
76
- mask_bytes:,
77
- length:,
78
- byte_array:,
79
- packed_byte_array: byte_array.pack("C*"),
80
- decoded_payload:
81
- }
82
- end
83
-
84
- def build_response(headers)
85
- accept_key = Digest::SHA1.base64digest "#{headers["Sec-WebSocket-Key"]}258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
86
-
87
- <<~RESPONSE
88
- HTTP/1.1 101 Switching Protocols\r
89
- Upgrade: websocket\r
90
- Connection: Upgrade\r
91
- Sec-WebSocket-Accept: #{accept_key}\r
92
- \r
93
- RESPONSE
94
- end
95
-
96
- def unbind
97
- WebSocketServer.connections.delete(self)
98
- end
99
- end
100
-
101
- EventMachine.run do
102
- EventMachine.start_server "127.0.0.1", 8081, WebSocketServer
103
- end
104
- end