rubyino 0.0.1 → 0.1.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 +4 -4
- data/README.org +21 -0
- data/lib/rubyino.rb +13 -6
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '05815328e1d01ca3c5678dad0d82d37783638b5f5167d29a348bbd8a9296110c'
|
4
|
+
data.tar.gz: 108b1df8cf5291fefd4d7db9e0d09e7e33989fa95e2af3e5cbde180ef4c69409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30d33d58530cd190e6cfe19e4a71f4a08110dd7048815fd7af57bbe9a4ccf06e26381ad1b7902b3cf214fe5113bb613bdd16132ccfdcc8689e5d08b2bbcaf2ff
|
7
|
+
data.tar.gz: 0e3ab7f63e8df4659ae04abee3b9d452fed848803cc962d943e62d567775c488394f65e25d17befb9b307160a68ec4b6e24a21372928ca3a483bd8057e49bd29
|
data/README.org
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Rubyino
|
2
|
+
Translate ruby to arduino
|
3
|
+
## install with gem
|
4
|
+
``` gem install rubyino ```
|
5
|
+
|
6
|
+
### or
|
7
|
+
|
8
|
+
```
|
9
|
+
git clone https://github.com/nimacpp/Rubyino.git
|
10
|
+
cd Rubyino
|
11
|
+
bundle install
|
12
|
+
```
|
13
|
+
# use Rubyino
|
14
|
+
## start use
|
15
|
+
``` rb = Rubyino.new("namefile") ```
|
16
|
+
## for print
|
17
|
+
``` rb.puts "hello world" #=> Keyboard.print("hello world"); ```
|
18
|
+
## for delay
|
19
|
+
``` rb.delay 500 #=> delay(500); ```
|
20
|
+
## for translate
|
21
|
+
``` rb.ter # for give output ```
|
data/lib/rubyino.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Rubyino
|
2
2
|
@@lines = [
|
3
3
|
"#include \"Keyboard.h\"\n",
|
4
4
|
"void typeKey(uint8_t key)
|
@@ -15,8 +15,8 @@ Keyboard.begin();"];
|
|
15
15
|
def initialize(path)
|
16
16
|
@@path = path+".ino"
|
17
17
|
end
|
18
|
-
def
|
19
|
-
@@lines.push "Keyboard.print(#{text});"
|
18
|
+
def print(text)
|
19
|
+
@@lines.push "Keyboard.print(\"#{text}\");"
|
20
20
|
end
|
21
21
|
def enter
|
22
22
|
@@line.push "typeKey(KEY_RETURN);"
|
@@ -24,17 +24,24 @@ Keyboard.begin();"];
|
|
24
24
|
def win_pls(key)
|
25
25
|
@@lines.push "Keyboard.press(KEY_LEFT_GUI);\nKeyboard.press('#{key[0]}');\nKeyboard.releaseAll();"
|
26
26
|
end
|
27
|
+
def use(lib)
|
28
|
+
@@lines.insert(0, "include <#{lib}>")
|
29
|
+
end
|
27
30
|
def select(array)
|
28
31
|
for i in array
|
29
|
-
@@lines.push "Keyboard.press(#{i});"
|
32
|
+
@@lines.push "Keyboard.press('#{i}');"
|
30
33
|
end
|
31
34
|
@@lines.push "Keyboard.releaseAll();"
|
32
35
|
end
|
33
36
|
def show
|
34
|
-
|
37
|
+
puts "Rubyino info"
|
38
|
+
puts "--------------------------"
|
39
|
+
puts " file name : #{@@path}"
|
40
|
+
puts "=========================="
|
41
|
+
puts @@lines
|
35
42
|
end
|
36
43
|
def delay(num)
|
37
|
-
@@lines.
|
44
|
+
@@lines.push "delay(#{num});"
|
38
45
|
end
|
39
46
|
def ter
|
40
47
|
@@lines.push " // Ending stream \nKeyboard.end();\n}\n/* Unused endless loop */\nvoid loop() {}"
|
metadata
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- nima cpp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: teranslate ruby to arduino
|
14
14
|
email: swithwebb31@email.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
|
-
extra_rdoc_files:
|
17
|
+
extra_rdoc_files:
|
18
|
+
- README.org
|
18
19
|
files:
|
20
|
+
- README.org
|
19
21
|
- lib/rubyino.rb
|
20
|
-
homepage: https://
|
22
|
+
homepage: https://rubygems.org/gems/hola
|
21
23
|
licenses:
|
22
|
-
-
|
24
|
+
- MIT
|
23
25
|
metadata:
|
24
26
|
source_code_uri: https://github.com/nimacpp/Rubyino
|
25
27
|
post_install_message:
|