ruby-macrodroid 0.8.6 → 0.8.7
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ruby-macrodroid.rb +14 -9
- data/lib/ruby-macrodroid/actions.rb +42 -47
- data/lib/ruby-macrodroid/triggers.rb +31 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e161537334457ba0da45d5058d8a7a75a1a845cb2e5b9aa7895ea224aac472c5
|
4
|
+
data.tar.gz: 9503ca1e163739e18fba141a333e99fcf27eb3c34c34798f72099f723e63f3fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1035077a740b2308cde75c96da176d0dd616111bd9541b364ce2a9e3f13eb39a3ad49930222348a186fe1180bade2eb264e0a9cf4bf05ee5efd2802da27a3850
|
7
|
+
data.tar.gz: 6f0919e4921f12d5c646484f56b8c5b459335d3997559226803e4da30ec5e96e007882a247c0a52ff9766702066f28df534c044792c557a40335079828458da0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/ruby-macrodroid.rb
CHANGED
@@ -391,6 +391,7 @@ class Macro
|
|
391
391
|
local_variables: @local_variables,
|
392
392
|
m_trigger_list: @triggers.map(&:to_h),
|
393
393
|
m_action_list: @actions.map(&:to_h),
|
394
|
+
m_category: @category,
|
394
395
|
m_constraint_list: @constraints.map(&:to_h),
|
395
396
|
m_description: '',
|
396
397
|
m_name: title(),
|
@@ -414,6 +415,7 @@ class Macro
|
|
414
415
|
puts 'h:' + h.inspect
|
415
416
|
end
|
416
417
|
|
418
|
+
@category = h[:category]
|
417
419
|
@title = h[:name]
|
418
420
|
@description = h[:description]
|
419
421
|
|
@@ -449,17 +451,17 @@ class Macro
|
|
449
451
|
@actions = h[:action_list].map do |action|
|
450
452
|
object(action.to_snake_case)
|
451
453
|
end
|
452
|
-
|
454
|
+
puts 'before fetch constraints' if @debug
|
453
455
|
# fetch the constraints
|
454
456
|
@constraints = h[:constraint_list].map do |constraint|
|
455
457
|
object(constraint.to_snake_case)
|
456
458
|
end
|
457
|
-
|
459
|
+
puts 'after fetch constraints' if @debug
|
458
460
|
@h = h
|
459
461
|
|
460
462
|
%i(local_variables m_trigger_list m_action_list m_constraint_list)\
|
461
463
|
.each {|x| @h[x] = [] }
|
462
|
-
|
464
|
+
puts 'after @h set' if @debug
|
463
465
|
@h
|
464
466
|
|
465
467
|
end
|
@@ -476,6 +478,7 @@ class Macro
|
|
476
478
|
# level 2
|
477
479
|
|
478
480
|
@title = node.attributes[:name]
|
481
|
+
@category = node.attributes[:category]
|
479
482
|
@description = node.attributes[:description]
|
480
483
|
|
481
484
|
|
@@ -707,10 +710,11 @@ EOF
|
|
707
710
|
r
|
708
711
|
|
709
712
|
end.join("\n")
|
710
|
-
|
711
|
-
a = [
|
712
|
-
|
713
|
-
|
713
|
+
|
714
|
+
a = []
|
715
|
+
a << '# ' + @category + "\n" if @category
|
716
|
+
a << (colour ? "m".bg_cyan.gray.bold : 'm') + ': ' + @title
|
717
|
+
|
714
718
|
|
715
719
|
if @description and @description.length >= 1 then
|
716
720
|
a << (colour ? "d".bg_gray.gray.bold : 'd') + ': ' \
|
@@ -804,7 +808,7 @@ EOF
|
|
804
808
|
h2 = h.merge( macro: self)
|
805
809
|
puts 'h2: ' + h2.inspect
|
806
810
|
r = klass.new h2
|
807
|
-
|
811
|
+
puts 'r:' + r.inspect
|
808
812
|
r
|
809
813
|
|
810
814
|
end
|
@@ -842,6 +846,7 @@ class MacroDroid
|
|
842
846
|
if s[0] == '{' then
|
843
847
|
|
844
848
|
import_json(s)
|
849
|
+
puts 'after import_json' if @debug
|
845
850
|
|
846
851
|
elsif s[0] == '<'
|
847
852
|
|
@@ -934,7 +939,7 @@ class MacroDroid
|
|
934
939
|
end
|
935
940
|
|
936
941
|
alias to_json export_json
|
937
|
-
|
942
|
+
|
938
943
|
|
939
944
|
def to_h()
|
940
945
|
|
@@ -69,43 +69,6 @@ class Action < MacroObject
|
|
69
69
|
end
|
70
70
|
|
71
71
|
|
72
|
-
class LocationAction < Action
|
73
|
-
|
74
|
-
def initialize(h={})
|
75
|
-
super(h)
|
76
|
-
@group = 'location'
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
# Category: Location
|
82
|
-
#
|
83
|
-
class ShareLocationAction < LocationAction
|
84
|
-
|
85
|
-
def initialize(h={})
|
86
|
-
|
87
|
-
super()
|
88
|
-
|
89
|
-
options = {
|
90
|
-
email: '',
|
91
|
-
variable: {:m_stringValue=>"", :m_name=>"",
|
92
|
-
:m_decimalValue=>0.0, :isLocal=>true, :m_booleanValue=>false,
|
93
|
-
:excludeFromLog=>false, :m_intValue=>0, :m_type=>2},
|
94
|
-
sim_id: 0,
|
95
|
-
output_channel: 5,
|
96
|
-
old_variable_format: true
|
97
|
-
}
|
98
|
-
|
99
|
-
super(options.merge h)
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
def to_s(colour: false)
|
104
|
-
'ShareLocationAction ' + @h.inspect
|
105
|
-
end
|
106
|
-
|
107
|
-
alias to_summary to_s
|
108
|
-
end
|
109
72
|
|
110
73
|
|
111
74
|
class ApplicationAction < Action
|
@@ -1212,15 +1175,30 @@ class ForceLocationUpdateAction < LocationAction
|
|
1212
1175
|
alias to_summary to_s
|
1213
1176
|
end
|
1214
1177
|
|
1178
|
+
# Category: Location
|
1179
|
+
#
|
1180
|
+
class LocationAction < Action
|
1181
|
+
|
1182
|
+
def initialize(h={})
|
1183
|
+
super(h)
|
1184
|
+
@group = 'location'
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
end
|
1188
|
+
|
1215
1189
|
# Category: Location
|
1216
1190
|
#
|
1217
1191
|
class ShareLocationAction < LocationAction
|
1218
1192
|
|
1219
1193
|
def initialize(h={})
|
1194
|
+
|
1195
|
+
super()
|
1220
1196
|
|
1221
1197
|
options = {
|
1222
1198
|
email: '',
|
1223
|
-
variable: {:m_stringValue=>"", :m_name=>"",
|
1199
|
+
variable: {:m_stringValue=>"", :m_name=>"",
|
1200
|
+
:m_decimalValue=>0.0, :isLocal=>true, :m_booleanValue=>false,
|
1201
|
+
:excludeFromLog=>false, :m_intValue=>0, :m_type=>2},
|
1224
1202
|
sim_id: 0,
|
1225
1203
|
output_channel: 5,
|
1226
1204
|
old_variable_format: true
|
@@ -1231,12 +1209,14 @@ class ShareLocationAction < LocationAction
|
|
1231
1209
|
end
|
1232
1210
|
|
1233
1211
|
def to_s(colour: false)
|
1234
|
-
'
|
1212
|
+
@s = 'Share Location' + "\n GPS" # + @h.inspect
|
1213
|
+
super()
|
1235
1214
|
end
|
1236
1215
|
|
1237
1216
|
alias to_summary to_s
|
1238
1217
|
end
|
1239
1218
|
|
1219
|
+
|
1240
1220
|
# Category: Location
|
1241
1221
|
#
|
1242
1222
|
class SetLocationUpdateRateAction < LocationAction
|
@@ -1472,16 +1452,26 @@ class TextManipulationAction < Action
|
|
1472
1452
|
|
1473
1453
|
def to_s(colour: false)
|
1474
1454
|
|
1475
|
-
tm = @h[:text_manipulation]
|
1476
|
-
|
1477
|
-
s = case tm[:type].to_sym
|
1478
|
-
|
1455
|
+
#tm = @h[:text_manipulation][:type]
|
1456
|
+
|
1457
|
+
#s = case tm[:type].to_sym
|
1458
|
+
s = case 3 # @h[:text_manipulation][:option].to_i
|
1459
|
+
when 0 # :SubstringManipulation
|
1479
1460
|
"Substring(%s, %s)" % [@h[:text], tm[:params].join(', ')]
|
1461
|
+
when 1 # :ReplaceAllManipulation
|
1462
|
+
"Replace all(%s, %s, %s)" % [@h[:text], *tm[:params]]
|
1463
|
+
when 2 # :ExtractTextManipulation
|
1464
|
+
"Extract text(%s, %s)" % [@h[:text], tm[:params].join(', ')]
|
1465
|
+
when 3 # :UpperCaseManipulation
|
1466
|
+
"Upper case(%s)" % [@h[:text]]
|
1467
|
+
#'foo'
|
1468
|
+
when 4 # :LowerCaseManipulation
|
1469
|
+
"Lower case(%s)" % [@h[:text]]
|
1470
|
+
when 5 # :TrimWhitespaceManipulation
|
1471
|
+
"Trim whitespace(%s)" % [@h[:text]]
|
1480
1472
|
end
|
1481
1473
|
|
1482
|
-
|
1483
|
-
'Text Manipulation' + "\n " + s #+ ' ' + @h.inspect
|
1484
|
-
|
1474
|
+
'Text Manipulation' + "\n " + s.inspect #+ ' ' + @h.inspect
|
1485
1475
|
|
1486
1476
|
end
|
1487
1477
|
|
@@ -1489,6 +1479,9 @@ class TextManipulationAction < Action
|
|
1489
1479
|
|
1490
1480
|
end
|
1491
1481
|
|
1482
|
+
|
1483
|
+
|
1484
|
+
|
1492
1485
|
class PauseAction < Action
|
1493
1486
|
|
1494
1487
|
def initialize(h={})
|
@@ -1603,7 +1596,9 @@ class SendEmailAction < MessagingAction
|
|
1603
1596
|
end
|
1604
1597
|
|
1605
1598
|
def to_s(colour: false)
|
1606
|
-
|
1599
|
+
recipient = @h[:email_address]
|
1600
|
+
@s = 'Send EmailAction' + "\n To: " + recipient #+ ' ' + @h.inspect
|
1601
|
+
super()
|
1607
1602
|
end
|
1608
1603
|
|
1609
1604
|
alias to_summary to_s
|
@@ -1604,3 +1604,34 @@ class SwipeTrigger < Trigger
|
|
1604
1604
|
|
1605
1605
|
alias to_summary to_s
|
1606
1606
|
end
|
1607
|
+
|
1608
|
+
|
1609
|
+
|
1610
|
+
|
1611
|
+
# Category: User Input
|
1612
|
+
#
|
1613
|
+
class WidgetPressedTrigger < Trigger
|
1614
|
+
|
1615
|
+
def initialize(h={})
|
1616
|
+
|
1617
|
+
options = {
|
1618
|
+
:swipe_start_area=>0, :swipe_motion=>0, :cleared=>true,
|
1619
|
+
:image_id=>2130968576, :image_package_name=>"com.android.providers.settings",
|
1620
|
+
:image_resource_name=>"com.android.providers.settings", :widget_label=>"",
|
1621
|
+
:widget_type=>4
|
1622
|
+
}
|
1623
|
+
|
1624
|
+
super(options.merge h)
|
1625
|
+
|
1626
|
+
end
|
1627
|
+
|
1628
|
+
def to_s(colour: false)
|
1629
|
+
# 4 == cutom , 0 = green, 1 = blue, 2 = red, 3 = yellow
|
1630
|
+
style = %w(Green Blue Red Yellow Custom)[@h[:widget_type]]
|
1631
|
+
@s = "Widget Button (%s)" % [style] #+ @h.inspect
|
1632
|
+
super()
|
1633
|
+
end
|
1634
|
+
|
1635
|
+
alias to_summary to_s
|
1636
|
+
end
|
1637
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-macrodroid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
NZ2kdBIUDnAM24e0/wXdVxg4HnsZbdymxyzMQ4P5pKYcpI6oisBxI37p/Xy+wAg3
|
36
36
|
SBHno3GEuuD8ZWj24IMJpfbp
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-09-
|
38
|
+
date: 2020-09-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: glw
|
metadata.gz.sig
CHANGED
Binary file
|