browser_app_base 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +64 -61
- data/bin/start_sample.rb +1 -1
- data/lib/browser_app_base/version.rb +1 -1
- data/lib/template/config/browser.json +3 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0eb570025887ea6e618a27467df3ca7f8bea72481786a1b6bc41fe7b3b5a86
|
4
|
+
data.tar.gz: 70c09c0eda44c4d8d0dbfe3ea26f907cc06c609415fafd5ab6dc35661a7b8176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5114a8aecabd7b9434635a0d4368bdcf40f8fc1da03f4171a089a69f5158b0ea04ec4348269eef6096ef66b4cc44a611828278c781b32972f7146f5d1e8b38f5
|
7
|
+
data.tar.gz: 5aeadef51294e212916da7141fe05df0a942c3c0626706e7d08c57cf27de4c88685f08ab2534b15b71cdf2ada3a2a084b79eb1814be7b15e77e38b1c0b52dea8
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
Windows and Linux browser-based desktop application templates.
|
4
4
|
|
5
|
-
|
5
|
+
On Linux, the Chrome browser is used by default.
|
6
|
+
On Windows, the Edge browser is used by default.
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -30,10 +31,10 @@ Or install it yourself as:
|
|
30
31
|
|
31
32
|
## Create app templat
|
32
33
|
|
33
|
-
$ create_browser_app -d
|
34
|
+
$ create_browser_app -d /path/to/test/ -a MyApp
|
34
35
|
|
35
36
|
## add application code
|
36
|
-
$ cd
|
37
|
+
$ cd /path/to/test/
|
37
38
|
$ vi my_app.rb
|
38
39
|
|
39
40
|
```ruby
|
@@ -59,26 +60,27 @@ ui application sample
|
|
59
60
|
## Start application
|
60
61
|
|
61
62
|
```shell
|
62
|
-
$ /
|
63
|
+
$ /path/to/test/bin/start_my_app.rb
|
63
64
|
```
|
64
65
|
|
65
66
|
![app](img/app.png)
|
66
67
|
|
67
68
|
## browser setting
|
69
|
+
Configure your browser for Windows or Linux.
|
68
70
|
|
69
71
|
${home}/${app_nane}/config/browser.json
|
70
|
-
Set the path for your Windows or Linux Chrome browser
|
71
72
|
|
72
73
|
```json
|
73
74
|
{
|
74
|
-
"chrome_win": "start
|
75
|
+
"chrome_win": "start msedge",
|
76
|
+
"chrome_win_": "start chrome",
|
75
77
|
"chrome_linux": "/bin/google-chrome"
|
76
78
|
}
|
77
79
|
```
|
78
80
|
|
79
81
|
## Send a message from your browser application to your ruby application
|
80
82
|
|
81
|
-
Use the send_message function
|
83
|
+
Use the send_message function.
|
82
84
|
|
83
85
|
main.js sample
|
84
86
|
```javascript
|
@@ -90,7 +92,7 @@ $("#exec").click(function () {
|
|
90
92
|
|
91
93
|
## Send a message from the ruby application to the browser application
|
92
94
|
|
93
|
-
Use the app_send function
|
95
|
+
Use the app_send function.
|
94
96
|
|
95
97
|
my_app_sample.rb sample
|
96
98
|
```ruby
|
@@ -106,64 +108,65 @@ end
|
|
106
108
|
```
|
107
109
|
|
108
110
|
## Application Setting
|
111
|
+
You can add settings by modifying setting.json.
|
109
112
|
|
110
113
|
${home}/${app_nane}/config/setting.json
|
111
114
|
|
112
115
|
|
113
116
|
```json
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
"
|
135
|
-
"
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
117
|
+
[
|
118
|
+
{
|
119
|
+
"name": "name1",
|
120
|
+
"value": "value1 2 3 4",
|
121
|
+
"type": "input",
|
122
|
+
"select": "",
|
123
|
+
"description": "設定項目1"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"name": "name2",
|
127
|
+
"value": true,
|
128
|
+
"type": "checkbox",
|
129
|
+
"select": "",
|
130
|
+
"description": "有効にする場合はチェック"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"name": "name3",
|
134
|
+
"value": "2",
|
135
|
+
"type": "select",
|
136
|
+
"select": [
|
137
|
+
"1",
|
138
|
+
"2",
|
139
|
+
"3",
|
140
|
+
"4",
|
141
|
+
"5"
|
142
|
+
],
|
143
|
+
"description": "選択項目"
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"name": "name4",
|
147
|
+
"value": "value4",
|
148
|
+
"type": "input",
|
149
|
+
"select": "",
|
150
|
+
"description": "設定項目4"
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"name": "name5",
|
154
|
+
"value": "value5",
|
155
|
+
"type": "input",
|
156
|
+
"select": "",
|
157
|
+
"description": "設定項目5"
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"name": "name6",
|
161
|
+
"value": "value6",
|
162
|
+
"type": "input",
|
163
|
+
"select": "",
|
164
|
+
"description": "設定項目6"
|
165
|
+
}
|
166
|
+
]
|
167
|
+
```
|
168
|
+
You can access the settings from your Ruby application like this:
|
169
|
+
|
167
170
|
```ruby
|
168
171
|
class MyApp < AppMainBase
|
169
172
|
def start(argv)
|
data/bin/start_sample.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser_app_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- masataka kuwayama
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -135,7 +135,7 @@ files:
|
|
135
135
|
homepage: https://github.com/kuwayama1971/BrowserAppBase
|
136
136
|
licenses: []
|
137
137
|
metadata: {}
|
138
|
-
post_install_message:
|
138
|
+
post_install_message:
|
139
139
|
rdoc_options: []
|
140
140
|
require_paths:
|
141
141
|
- lib
|
@@ -150,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
154
|
-
signing_key:
|
153
|
+
rubygems_version: 3.4.20
|
154
|
+
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: browser app base
|
157
157
|
test_files: []
|