rubyino 0.0.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 +7 -0
- data/lib/rubyino.rb +49 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee7087c93358c4236927ffe7cc761d3e070ceceda5a8c4ab67129d500604fa7b
|
4
|
+
data.tar.gz: b9a56b7adb1978cc0582479954c61a6afd264ac396e5cc7b377ca1a1292f5b5a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0542ed91b428b41f9d1f508f0094c2df5d840b6eacb54e0b9dde79ef053bd82a177b1c373cc3af0d32885dc310ffad5a639b3756294f6e0d7e3140675055c001
|
7
|
+
data.tar.gz: 6d6b5d046d027bf57e1b11bbebb87ac94052a1dd85a0cee03304b4906138b7668bee80b9ad00c23cd8fce993b775bc0430393fda759182cb4228216f7cbe167f
|
data/lib/rubyino.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
class Key
|
2
|
+
@@lines = [
|
3
|
+
"#include \"Keyboard.h\"\n",
|
4
|
+
"void typeKey(uint8_t key)
|
5
|
+
{
|
6
|
+
Keyboard.press(key);
|
7
|
+
delay(50);
|
8
|
+
Keyboard.release(key);
|
9
|
+
}",
|
10
|
+
"/* Init function */
|
11
|
+
void setup()
|
12
|
+
{
|
13
|
+
// Begining the Keyboard stream
|
14
|
+
Keyboard.begin();"];
|
15
|
+
def initialize(path)
|
16
|
+
@@path = path+".ino"
|
17
|
+
end
|
18
|
+
def puts(text)
|
19
|
+
@@lines.push "Keyboard.print(#{text});"
|
20
|
+
end
|
21
|
+
def enter
|
22
|
+
@@line.push "typeKey(KEY_RETURN);"
|
23
|
+
end
|
24
|
+
def win_pls(key)
|
25
|
+
@@lines.push "Keyboard.press(KEY_LEFT_GUI);\nKeyboard.press('#{key[0]}');\nKeyboard.releaseAll();"
|
26
|
+
end
|
27
|
+
def select(array)
|
28
|
+
for i in array
|
29
|
+
@@lines.push "Keyboard.press(#{i});"
|
30
|
+
end
|
31
|
+
@@lines.push "Keyboard.releaseAll();"
|
32
|
+
end
|
33
|
+
def show
|
34
|
+
return " #{@@path}||#{@@lines}"
|
35
|
+
end
|
36
|
+
def delay(num)
|
37
|
+
@@lines.puts "delay(#{num});"
|
38
|
+
end
|
39
|
+
def ter
|
40
|
+
@@lines.push " // Ending stream \nKeyboard.end();\n}\n/* Unused endless loop */\nvoid loop() {}"
|
41
|
+
file = File.open(@@path, "w")
|
42
|
+
for i in @@lines
|
43
|
+
file.puts "#{i}\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
def arduino(text)
|
47
|
+
@@lines.push text
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubyino
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- NimaCpp
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: teranslate ruby to arduino
|
14
|
+
email: swithwebb31@email.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/rubyino.rb
|
20
|
+
homepage: https://github.com/nimacpp
|
21
|
+
licenses:
|
22
|
+
- OML
|
23
|
+
metadata:
|
24
|
+
source_code_uri: https://github.com/nimacpp/Rubyino
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubygems_version: 3.3.5
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: teranslate ruby to arduino
|
44
|
+
test_files: []
|