code-ruby 5.0.5 → 5.0.6
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
- data/VERSION +1 -1
- data/lib/code/object/global.rb +38 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5963b86d5da47531a3cdb1e0dfc740e40d0ce1d0dc4b381404cccdc3e71d42b7
|
|
4
|
+
data.tar.gz: 91f10f5aae107a12869804601768eabef6937e02637dfae037de3cabae698e31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a99802efe33c9737f812734bcff47fa42a749cbc6734ad319d3f1d9f9414ebfb93c6d2e832b6c29894bb2cf2ec1488dcd8992b4595e1bacdfb384377e791d365
|
|
7
|
+
data.tar.gz: c2f6e44533b734cb197d3e7cb05312b8c0437907be9b243cea78621aee695243774e006bb9aa2e5cffad666f85992d924f6c479bf64913de64dec72b361de714
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.0.
|
|
1
|
+
5.0.6
|
data/lib/code/object/global.rb
CHANGED
|
@@ -91,12 +91,19 @@ class Code
|
|
|
91
91
|
]
|
|
92
92
|
}.freeze
|
|
93
93
|
WAIT_UNIT_SECONDS = {
|
|
94
|
+
millisecond: 0.001,
|
|
94
95
|
milliseconds: 0.001,
|
|
96
|
+
second: 1,
|
|
95
97
|
seconds: 1,
|
|
98
|
+
minute: ::ActiveSupport::Duration::SECONDS_PER_MINUTE,
|
|
96
99
|
minutes: ::ActiveSupport::Duration::SECONDS_PER_MINUTE,
|
|
100
|
+
hour: ::ActiveSupport::Duration::SECONDS_PER_HOUR,
|
|
97
101
|
hours: ::ActiveSupport::Duration::SECONDS_PER_HOUR,
|
|
102
|
+
day: ::ActiveSupport::Duration::SECONDS_PER_DAY,
|
|
98
103
|
days: ::ActiveSupport::Duration::SECONDS_PER_DAY,
|
|
104
|
+
month: ::ActiveSupport::Duration::SECONDS_PER_MONTH,
|
|
99
105
|
months: ::ActiveSupport::Duration::SECONDS_PER_MONTH,
|
|
106
|
+
year: ::ActiveSupport::Duration::SECONDS_PER_YEAR,
|
|
100
107
|
years: ::ActiveSupport::Duration::SECONDS_PER_YEAR
|
|
101
108
|
}.freeze
|
|
102
109
|
FUNCTIONS = {
|
|
@@ -376,9 +383,9 @@ class Code
|
|
|
376
383
|
description:
|
|
377
384
|
"waits for the combined duration, defaulting to one second, and returns nothing.",
|
|
378
385
|
examples: [
|
|
379
|
-
"wait(
|
|
380
|
-
"wait(
|
|
381
|
-
"wait(
|
|
386
|
+
"wait(second: 0)",
|
|
387
|
+
"wait(minutes: 0, second: 0)",
|
|
388
|
+
"wait(hour: 0, days: 0, month: 0, years: 0, millisecond: 0)"
|
|
382
389
|
]
|
|
383
390
|
},
|
|
384
391
|
"read" => {
|
|
@@ -684,24 +691,38 @@ class Code
|
|
|
684
691
|
when "wait"
|
|
685
692
|
sig(args) do
|
|
686
693
|
{
|
|
694
|
+
millisecond: Number.maybe,
|
|
687
695
|
milliseconds: Number.maybe,
|
|
696
|
+
second: Number.maybe,
|
|
688
697
|
seconds: Number.maybe,
|
|
698
|
+
minute: Number.maybe,
|
|
689
699
|
minutes: Number.maybe,
|
|
700
|
+
hour: Number.maybe,
|
|
690
701
|
hours: Number.maybe,
|
|
702
|
+
day: Number.maybe,
|
|
691
703
|
days: Number.maybe,
|
|
704
|
+
month: Number.maybe,
|
|
692
705
|
months: Number.maybe,
|
|
706
|
+
year: Number.maybe,
|
|
693
707
|
years: Number.maybe
|
|
694
708
|
}
|
|
695
709
|
end
|
|
696
710
|
|
|
697
711
|
if code_arguments.any?
|
|
698
712
|
code_wait(
|
|
713
|
+
millisecond: code_value.code_get(:millisecond),
|
|
699
714
|
milliseconds: code_value.code_get(:milliseconds),
|
|
715
|
+
second: code_value.code_get(:second),
|
|
700
716
|
seconds: code_value.code_get(:seconds),
|
|
717
|
+
minute: code_value.code_get(:minute),
|
|
701
718
|
minutes: code_value.code_get(:minutes),
|
|
719
|
+
hour: code_value.code_get(:hour),
|
|
702
720
|
hours: code_value.code_get(:hours),
|
|
721
|
+
day: code_value.code_get(:day),
|
|
703
722
|
days: code_value.code_get(:days),
|
|
723
|
+
month: code_value.code_get(:month),
|
|
704
724
|
months: code_value.code_get(:months),
|
|
725
|
+
year: code_value.code_get(:year),
|
|
705
726
|
years: code_value.code_get(:years)
|
|
706
727
|
)
|
|
707
728
|
else
|
|
@@ -735,21 +756,35 @@ class Code
|
|
|
735
756
|
end
|
|
736
757
|
|
|
737
758
|
def code_wait(
|
|
759
|
+
millisecond: nil,
|
|
738
760
|
milliseconds: nil,
|
|
761
|
+
second: nil,
|
|
739
762
|
seconds: nil,
|
|
763
|
+
minute: nil,
|
|
740
764
|
minutes: nil,
|
|
765
|
+
hour: nil,
|
|
741
766
|
hours: nil,
|
|
767
|
+
day: nil,
|
|
742
768
|
days: nil,
|
|
769
|
+
month: nil,
|
|
743
770
|
months: nil,
|
|
771
|
+
year: nil,
|
|
744
772
|
years: nil
|
|
745
773
|
)
|
|
746
774
|
values = {
|
|
775
|
+
millisecond: millisecond,
|
|
747
776
|
milliseconds: milliseconds,
|
|
777
|
+
second: second,
|
|
748
778
|
seconds: seconds,
|
|
779
|
+
minute: minute,
|
|
749
780
|
minutes: minutes,
|
|
781
|
+
hour: hour,
|
|
750
782
|
hours: hours,
|
|
783
|
+
day: day,
|
|
751
784
|
days: days,
|
|
785
|
+
month: month,
|
|
752
786
|
months: months,
|
|
787
|
+
year: year,
|
|
753
788
|
years: years
|
|
754
789
|
}
|
|
755
790
|
duration =
|