applin-rails 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/applin/rails/version.rb +1 -1
- data/lib/applin/rails.rb +0 -1
- data/lib/applin.rb +85 -83
- data/sig/applin.rbs +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8867eef768fdce7a5c2bf8c18a83e8adc99ad18854578c82815c1d7016199866
|
4
|
+
data.tar.gz: 7c4633294fc36b21e876aa93b9d3d85380eb30ef9db4bbaeacd96c83e84b3032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ed3689644ff339a5bbcf9a3728f5903e19de48f7c184035c0f31b21f9536978482fbcad122e8413cfc419c4e5315dd889376ae9c4b32685c4d777f8ed56455
|
7
|
+
data.tar.gz: 80c63c298656f77b900a5380692a59e1f9b4166893039a082b8d9577167a2fb58afbf4ec8115b1442e909aa6db2033e764dc184de94ec5deeb57d894e9ec605b
|
data/README.md
CHANGED
@@ -15,6 +15,12 @@ To add the gem to your Rails application:
|
|
15
15
|
* Docs: <https://www.applin.dev/docs/backend-libraries.html>
|
16
16
|
* Example: <https://github.com/leonhard-llc/applin-rails-demo>
|
17
17
|
|
18
|
+
## Changes
|
19
|
+
- v0.6.0
|
20
|
+
- Support ApplinIos v0.25.0.
|
21
|
+
- Add `poll_delay_ms` to checkbox and textfield.
|
22
|
+
- Remove checkbox `rpc` field.
|
23
|
+
|
18
24
|
## Contributing
|
19
25
|
Bug reports and pull requests are welcome on GitHub at <https://github.com/leonhard-llc/applin-rails>.
|
20
26
|
|
data/lib/applin/rails/version.rb
CHANGED
data/lib/applin/rails.rb
CHANGED
data/lib/applin.rb
CHANGED
@@ -20,6 +20,86 @@ module Applin
|
|
20
20
|
|
21
21
|
module_function
|
22
22
|
|
23
|
+
# Actions ###################################################################
|
24
|
+
|
25
|
+
def choose_photo(upload_url:)
|
26
|
+
"choose_photo:#{upload_url}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def copy_to_clipboard(text)
|
30
|
+
"copy_to_clipboard:#{text}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def launch_url(url)
|
34
|
+
"launch_url:#{url}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def logout
|
38
|
+
"logout"
|
39
|
+
end
|
40
|
+
|
41
|
+
def on_user_error_poll
|
42
|
+
"on_user_error_poll"
|
43
|
+
end
|
44
|
+
|
45
|
+
def poll
|
46
|
+
"poll"
|
47
|
+
end
|
48
|
+
|
49
|
+
def pop
|
50
|
+
"pop"
|
51
|
+
end
|
52
|
+
|
53
|
+
def push(page_key)
|
54
|
+
"push:#{page_key}"
|
55
|
+
end
|
56
|
+
|
57
|
+
def replace_all(page_key)
|
58
|
+
"replace_all:#{page_key}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def rpc(url)
|
62
|
+
"rpc:#{url}"
|
63
|
+
end
|
64
|
+
|
65
|
+
def take_photo(upload_url:)
|
66
|
+
"take_photo:#{upload_url}"
|
67
|
+
end
|
68
|
+
|
69
|
+
# Pages #####################################################################
|
70
|
+
|
71
|
+
def nav_page(
|
72
|
+
title:,
|
73
|
+
start: nil,
|
74
|
+
end_: nil,
|
75
|
+
ephemeral: nil,
|
76
|
+
stream: nil,
|
77
|
+
poll_seconds: nil,
|
78
|
+
&widget_block
|
79
|
+
)
|
80
|
+
{
|
81
|
+
typ: :nav_page,
|
82
|
+
start: start,
|
83
|
+
end: end_,
|
84
|
+
ephemeral: ephemeral,
|
85
|
+
title: title,
|
86
|
+
stream: stream,
|
87
|
+
poll_seconds: poll_seconds,
|
88
|
+
widget: widget_block.yield,
|
89
|
+
}.compact
|
90
|
+
end
|
91
|
+
|
92
|
+
def plain_page(title: nil, ephemeral: nil, stream: nil, poll_seconds: nil, &widget_block)
|
93
|
+
{
|
94
|
+
typ: :plain_page,
|
95
|
+
title: title,
|
96
|
+
ephemeral: ephemeral,
|
97
|
+
stream: stream,
|
98
|
+
poll_seconds: poll_seconds,
|
99
|
+
widget: widget_block.yield,
|
100
|
+
}.compact
|
101
|
+
end
|
102
|
+
|
23
103
|
# Widgets ###################################################################
|
24
104
|
|
25
105
|
def back_button(actions:)
|
@@ -30,12 +110,12 @@ module Applin
|
|
30
110
|
{ typ: :button, text: text, actions: actions }
|
31
111
|
end
|
32
112
|
|
33
|
-
def checkbox(text:, var_name:, actions: nil, initial_bool: nil,
|
113
|
+
def checkbox(text:, var_name:, actions: nil, initial_bool: nil, poll_delay_ms: nil)
|
34
114
|
{
|
35
115
|
typ: :checkbox,
|
36
116
|
actions: actions,
|
37
117
|
initial_bool: initial_bool,
|
38
|
-
|
118
|
+
poll_delay_ms: poll_delay_ms,
|
39
119
|
text: text,
|
40
120
|
var_name: var_name,
|
41
121
|
}.compact
|
@@ -118,7 +198,8 @@ module Applin
|
|
118
198
|
label: nil,
|
119
199
|
max_chars: nil,
|
120
200
|
max_lines: nil,
|
121
|
-
min_chars: nil
|
201
|
+
min_chars: nil,
|
202
|
+
poll_delay_ms: nil
|
122
203
|
)
|
123
204
|
{
|
124
205
|
typ: :textfield,
|
@@ -130,89 +211,10 @@ module Applin
|
|
130
211
|
max_chars: max_chars,
|
131
212
|
max_lines: max_lines,
|
132
213
|
min_chars: min_chars,
|
214
|
+
poll_delay_ms: poll_delay_ms,
|
133
215
|
var_name: var_name,
|
134
216
|
}.compact
|
135
217
|
end
|
136
218
|
|
137
|
-
# Pages #####################################################################
|
138
|
-
|
139
|
-
def nav_page(
|
140
|
-
title:,
|
141
|
-
start: nil,
|
142
|
-
end_: nil,
|
143
|
-
ephemeral: nil,
|
144
|
-
stream: nil,
|
145
|
-
poll_seconds: nil,
|
146
|
-
&widget_block
|
147
|
-
)
|
148
|
-
{
|
149
|
-
typ: :nav_page,
|
150
|
-
start: start,
|
151
|
-
end: end_,
|
152
|
-
ephemeral: ephemeral,
|
153
|
-
title: title,
|
154
|
-
stream: stream,
|
155
|
-
poll_seconds: poll_seconds,
|
156
|
-
widget: widget_block.yield,
|
157
|
-
}.compact
|
158
|
-
end
|
159
|
-
|
160
|
-
def plain_page(title: nil, ephemeral: nil, stream: nil, poll_seconds: nil, &widget_block)
|
161
|
-
{
|
162
|
-
typ: :plain_page,
|
163
|
-
title: title,
|
164
|
-
ephemeral: ephemeral,
|
165
|
-
stream: stream,
|
166
|
-
poll_seconds: poll_seconds,
|
167
|
-
widget: widget_block.yield,
|
168
|
-
}.compact
|
169
|
-
end
|
170
|
-
|
171
|
-
# Actions ###################################################################
|
172
|
-
|
173
|
-
def choose_photo(upload_url:)
|
174
|
-
"choose_photo:#{upload_url}"
|
175
|
-
end
|
176
|
-
|
177
|
-
def copy_to_clipboard(text)
|
178
|
-
"copy_to_clipboard:#{text}"
|
179
|
-
end
|
180
|
-
|
181
|
-
def launch_url(url)
|
182
|
-
"launch_url:#{url}"
|
183
|
-
end
|
184
|
-
|
185
|
-
def logout
|
186
|
-
"logout"
|
187
|
-
end
|
188
|
-
|
189
|
-
def nothing
|
190
|
-
"nothing"
|
191
|
-
end
|
192
|
-
|
193
|
-
def poll
|
194
|
-
"poll"
|
195
|
-
end
|
196
|
-
|
197
|
-
def pop
|
198
|
-
"pop"
|
199
|
-
end
|
200
|
-
|
201
|
-
def push(page_key)
|
202
|
-
"push:#{page_key}"
|
203
|
-
end
|
204
|
-
|
205
|
-
def replace_all(page_key)
|
206
|
-
"replace_all:#{page_key}"
|
207
|
-
end
|
208
|
-
|
209
|
-
def rpc(url)
|
210
|
-
"rpc:#{url}"
|
211
|
-
end
|
212
|
-
|
213
|
-
def take_photo(upload_url:)
|
214
|
-
"take_photo:#{upload_url}"
|
215
|
-
end
|
216
|
-
|
217
219
|
# rubocop:enable Metrics/MethodLength, Metrics/ParameterLists
|
218
220
|
end
|
data/sig/applin.rbs
CHANGED
@@ -35,7 +35,13 @@ module Applin
|
|
35
35
|
|
36
36
|
def button: (text: String, actions: Array[action]) -> widget
|
37
37
|
|
38
|
-
def checkbox: (
|
38
|
+
def checkbox: (
|
39
|
+
text: String,
|
40
|
+
var_name: String,
|
41
|
+
actions: Array[action]?,
|
42
|
+
initial_bool: bool?,
|
43
|
+
poll_delay_ms: Numeric?,
|
44
|
+
) -> widget
|
39
45
|
|
40
46
|
def choose_photo: (upload_url: String) -> action
|
41
47
|
|
@@ -74,7 +80,7 @@ module Applin
|
|
74
80
|
poll_seconds: Numeric?,
|
75
81
|
) { () -> widget } -> page
|
76
82
|
|
77
|
-
def
|
83
|
+
def on_user_error_poll: -> action
|
78
84
|
|
79
85
|
def plain_page: (
|
80
86
|
title: String?,
|
@@ -110,6 +116,7 @@ module Applin
|
|
110
116
|
label: String?,
|
111
117
|
max_chars: Numeric?,
|
112
118
|
max_lines: Numeric?,
|
113
|
-
min_chars: Numeric
|
119
|
+
min_chars: Numeric?,
|
120
|
+
poll_delay_ms: Numeric?
|
114
121
|
) -> widget
|
115
122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applin-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Leonhard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create mobile apps using only backend code. Applin™ is a Server-Driven
|
14
14
|
UI (SDUI) system.
|