ruby-macrodroid 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ruby-macrodroid.rb +64 -11
- metadata +16 -16
- 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: b2bb7feb730c6e27fa5a975bfdbf07828880549917f2f827444024baab88520d
|
4
|
+
data.tar.gz: 1c6e78b40874c2ddc5760d052974998071c581ba5cc3c52dcef58c2d1cd288ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5f66318dc99e82aa73fb6ce5ba11604f290f57d5757cfcdc46664165095b950cebf30da91b4dd9623200f5b615306f40f7815eefb78fe3f7eb65f5567dfd940
|
7
|
+
data.tar.gz: '03767919cd1943368facf1c7b66c8ebc6cffeceef99123e9d24957adc6cbedc336fa55468c05b73df691cb8c204d629dfdc085933aaee86370dbecf5f67e6b00'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/ruby-macrodroid.rb
CHANGED
@@ -664,7 +664,7 @@ end
|
|
664
664
|
EOF
|
665
665
|
end
|
666
666
|
|
667
|
-
def to_s()
|
667
|
+
def to_s(colour: false)
|
668
668
|
|
669
669
|
indent = 0
|
670
670
|
actions = @actions.map do |x|
|
@@ -673,7 +673,11 @@ EOF
|
|
673
673
|
|
674
674
|
r = if indent <= 0 then
|
675
675
|
|
676
|
-
|
676
|
+
if colour then
|
677
|
+
"a".bg_blue.gray.bold + ": %s" % s
|
678
|
+
else
|
679
|
+
"a: %s" % s
|
680
|
+
end
|
677
681
|
|
678
682
|
elsif indent > 0
|
679
683
|
|
@@ -689,8 +693,15 @@ EOF
|
|
689
693
|
end
|
690
694
|
|
691
695
|
if s =~ /^If/i then
|
696
|
+
|
692
697
|
if indent < 1 then
|
693
|
-
|
698
|
+
|
699
|
+
r = if colour then
|
700
|
+
"a".bg_blue.gray.bold + ":\n %s" % s
|
701
|
+
else
|
702
|
+
"a:\n %s" % s
|
703
|
+
end
|
704
|
+
|
694
705
|
indent += 1
|
695
706
|
else
|
696
707
|
r = (' ' * indent) + "%s" % s
|
@@ -704,15 +715,21 @@ EOF
|
|
704
715
|
end.join("\n")
|
705
716
|
|
706
717
|
a = [
|
707
|
-
'm: ' + @title,
|
708
|
-
@triggers.map {|x| "t:
|
718
|
+
(colour ? "m".bg_cyan.gray.bold : 'm') + ': ' + @title,
|
719
|
+
@triggers.map {|x| (colour ? "t".bg_red.gray.bold : 't') \
|
720
|
+
+ ": %s" % x}.join("\n"),
|
709
721
|
actions
|
710
722
|
]
|
711
723
|
|
712
|
-
|
724
|
+
if @constraints.any? then
|
725
|
+
a << @constraints.map do |x|
|
726
|
+
(colour ? "c".bg_green.gray.bold : 'c') + ": %s" % x
|
727
|
+
end.join("\n")
|
728
|
+
end
|
713
729
|
|
714
730
|
if @description and @description.length >= 1 then
|
715
|
-
a.insert(1,
|
731
|
+
a.insert(1, (colour ? "d".bg_gray.gray.bold : 'd') + ': ' \
|
732
|
+
+ @description.gsub(/\n/,"\n "))
|
716
733
|
end
|
717
734
|
|
718
735
|
a.join("\n") + "\n"
|
@@ -899,15 +916,16 @@ class MacroDroid
|
|
899
916
|
@macros.map(&:to_pc).join("\n\n")
|
900
917
|
end
|
901
918
|
|
902
|
-
def to_s()
|
919
|
+
def to_s(colour: false)
|
903
920
|
|
904
921
|
lines = []
|
905
922
|
|
906
923
|
if @geofences.any? then
|
907
|
-
lines << @geofences.map {|_, value|
|
924
|
+
lines << @geofences.map {|_, value| (colour ? "g".green.bold : 'g') \
|
925
|
+
+ ': ' + value.to_s}.join("\n\n") + "\n"
|
908
926
|
end
|
909
927
|
|
910
|
-
lines << @macros.map(
|
928
|
+
lines << @macros.map {|x| x.to_s(colour: colour)}.join("\n")
|
911
929
|
lines.join("\n")
|
912
930
|
|
913
931
|
end
|
@@ -3379,6 +3397,35 @@ class ClearLogAction < LoggingAction
|
|
3379
3397
|
|
3380
3398
|
end
|
3381
3399
|
|
3400
|
+
class PauseAction < Action
|
3401
|
+
|
3402
|
+
def initialize(h={})
|
3403
|
+
|
3404
|
+
options = {
|
3405
|
+
delay_in_milli_seconds: 0, delay_in_seconds: 1, use_alarm: false
|
3406
|
+
}
|
3407
|
+
super(h)
|
3408
|
+
|
3409
|
+
end
|
3410
|
+
|
3411
|
+
def to_s()
|
3412
|
+
|
3413
|
+
su = Subunit.new(units={minutes:60, hours:60},
|
3414
|
+
seconds: @h[:delay_in_seconds])
|
3415
|
+
|
3416
|
+
ms = @h[:delay_in_milli_seconds]
|
3417
|
+
|
3418
|
+
duration = if su.to_h.has_key?(:minutes) or (ms < 1) then
|
3419
|
+
su.strfunit("%X")
|
3420
|
+
else
|
3421
|
+
"%s %s ms" % [su.strfunit("%X"), ms]
|
3422
|
+
end
|
3423
|
+
|
3424
|
+
"Wait " + duration
|
3425
|
+
end
|
3426
|
+
|
3427
|
+
end
|
3428
|
+
|
3382
3429
|
class MediaAction < Action
|
3383
3430
|
|
3384
3431
|
def initialize(h={})
|
@@ -4871,9 +4918,15 @@ class VolumeConstraint < Constraint
|
|
4871
4918
|
option: 0
|
4872
4919
|
}
|
4873
4920
|
|
4874
|
-
super(options.merge h)
|
4921
|
+
super(options.merge filter(options, h))
|
4875
4922
|
|
4876
4923
|
end
|
4924
|
+
|
4925
|
+
def to_s()
|
4926
|
+
a = ['Volume On', 'Vibrate Only' 'Silent', 'Vibrate or Silent']
|
4927
|
+
|
4928
|
+
"Ringer Volume\n " + a[@h[:option]]
|
4929
|
+
end
|
4877
4930
|
|
4878
4931
|
end
|
4879
4932
|
|
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.7.
|
4
|
+
version: 0.7.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-12 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: glw
|
@@ -101,22 +101,22 @@ dependencies:
|
|
101
101
|
name: subunit
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 0.6.0
|
107
104
|
- - "~>"
|
108
105
|
- !ruby/object:Gem::Version
|
109
106
|
version: '0.6'
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.6.1
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- - ">="
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: 0.6.0
|
117
114
|
- - "~>"
|
118
115
|
- !ruby/object:Gem::Version
|
119
116
|
version: '0.6'
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.6.1
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: geozone
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,22 +141,22 @@ dependencies:
|
|
141
141
|
name: rxfhelper
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- - "~>"
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: '1.0'
|
147
144
|
- - ">="
|
148
145
|
- !ruby/object:Gem::Version
|
149
|
-
version: 1.0
|
146
|
+
version: 1.1.0
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '1.1'
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- - "~>"
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
version: '1.0'
|
157
154
|
- - ">="
|
158
155
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.0
|
156
|
+
version: 1.1.0
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.1'
|
160
160
|
- !ruby/object:Gem::Dependency
|
161
161
|
name: chronic_cron
|
162
162
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|