browser_app_base 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a663679645691169b277437125a8aaa46c4c715a44989e0817e1cf5cce5e323
4
- data.tar.gz: b3df162bafae5721416912fb344aac90c9db7145aa9d1c06dd29ff1abd839ace
3
+ metadata.gz: eb0eb570025887ea6e618a27467df3ca7f8bea72481786a1b6bc41fe7b3b5a86
4
+ data.tar.gz: 70c09c0eda44c4d8d0dbfe3ea26f907cc06c609415fafd5ab6dc35661a7b8176
5
5
  SHA512:
6
- metadata.gz: 2236c27e11fcc04866d882e70290df7246512488e8d9d20fd92887e1a3cefa04f0edb311f6eb39b83de4d77e289b7f53da308d342dc798c6d7e891977badd4c8
7
- data.tar.gz: 10790d0d2e74c7395e83cbca9d19129df152f790b649de21bb4cb15b3d1c48554141ea981fb4a3a510325cd4fbd873480f1b78cd9d8dbe733040d8575912c0e7
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
- You need a Chrome browser to run it.
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 ~/test/ -a MyApp
34
+ $ create_browser_app -d /path/to/test/ -a MyApp
34
35
 
35
36
  ## add application code
36
- $ cd ~/test/
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
- $ /tmp/test/bin/start_my_app.rb
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 chrome",
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
- "version": 0.1,
116
- "setting_list": [
117
- {
118
- "name": "name1",
119
- "value": "value1 2 3 4",
120
- "type": "input",
121
- "select": "",
122
- "description": "設定項目1"
123
- },
124
- {
125
- "name": "name2",
126
- "value": true,
127
- "type": "checkbox",
128
- "select": "",
129
- "description": "有効にする場合はチェック"
130
- },
131
- {
132
- "name": "name3",
133
- "value": "3",
134
- "type": "select",
135
- "select": [
136
- "1",
137
- "2",
138
- "3",
139
- "4",
140
- "5"
141
- ],
142
- "description": "選択項目"
143
- },
144
- {
145
- "name": "name4",
146
- "value": "value4",
147
- "type": "input",
148
- "select": "",
149
- "description": "設定項目4"
150
- },
151
- {
152
- "name": "name5",
153
- "value": "value5",
154
- "type": "input",
155
- "select": "",
156
- "description": "設定項目5"
157
- },
158
- {
159
- "name": "name6",
160
- "value": "value6",
161
- "type": "input",
162
- "select": "",
163
- "description": "設定項目6"
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
@@ -17,7 +17,7 @@ Dir.mktmpdir { |tmpdir|
17
17
  Dir.glob("#{dir}/lib/*") do |f|
18
18
  if f =~ /config$/
19
19
  # configはhomeにコピー
20
- if !File.exists? "#{home_dir}/config"
20
+ if !File.exist? "#{home_dir}/config"
21
21
  puts "#{f} => #{home_dir}/"
22
22
  FileUtils.cp_r f, "#{home_dir}/"
23
23
  end
@@ -26,8 +26,12 @@ Dir.mktmpdir { |tmpdir|
26
26
  FileUtils.cp_r f, "#{outdir}/"
27
27
  end
28
28
  end
29
+ begin
29
30
  json = JSON.parse(File.read("#{home_dir}/config/setting.json"))
30
31
  old_version = json["version"]
32
+ rescue
33
+ old_version = ""
34
+ end
31
35
  json = JSON.parse(File.read("#{dir}/lib/config/setting.json"))
32
36
  new_version = json["version"]
33
37
  puts "#{old_version} == #{new_version}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrowserAppBase
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.8"
5
5
  end
@@ -51,6 +51,7 @@ module BrowserAppBase
51
51
 
52
52
  puts "#{path}/bin/start_sample.rb #{dir}/bin/start_#{app_file}"
53
53
  FileUtils.cp_r "#{path}/bin/start_sample.rb", "#{dir}/bin/start_#{app_file}"
54
+ FileUtils.cp_r "#{path}/bin/start_sample.rb", "#{dir}/bin/start_#{app_file.gsub(/rb$/,"rbw")}"
54
55
 
55
56
  load_app = <<"EOS"
56
57
  require '#{app_file}'
@@ -1,4 +1,5 @@
1
1
  {
2
- "chrome_win": "start chrome",
2
+ "chrome_win": "start msedge",
3
+ "chrome_win_": "start chrome",
3
4
  "chrome_linux": "google-chrome"
4
- }
5
+ }
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.6
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: 2022-10-16 00:00:00.000000000 Z
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.1.2
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: []