MonkeyEngine 1.1.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +19 -16
- data/.rspec +3 -0
- data/.rubocop.yml +192 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -2
- data/Gemfile +3 -1
- data/Gemfile.lock +70 -0
- data/Rakefile +3 -2
- data/dictionaries/en-US.txt +466554 -0
- data/lib/Action/action.rb +5 -6
- data/lib/Monkey/monkey.rb +17 -13
- data/lib/Monkey.rb +3 -1
- data/lib/MonkeyAction/monkey_action.rb +3 -3
- data/lib/MonkeyAction/monkey_action_dead.rb +8 -8
- data/lib/MonkeyAction/monkey_action_eat.rb +6 -6
- data/lib/MonkeyAction/monkey_action_pause.rb +6 -7
- data/lib/MonkeyAction/monkey_action_sleep.rb +6 -6
- data/lib/MonkeyAction/monkey_action_type.rb +15 -12
- data/lib/MonkeyAction/monkey_action_wake.rb +8 -8
- data/lib/MonkeyAction/monkey_timed_action.rb +6 -6
- data/lib/MonkeyActions.rb +2 -0
- data/lib/MonkeyEngine/action_rules.rb +20 -18
- data/lib/MonkeyEngine/exceptions.rb +7 -7
- data/lib/MonkeyEngine/monkey_engine.rb +11 -14
- data/lib/MonkeyEngine/version.rb +3 -1
- data/lib/MonkeyEngine.rb +3 -1
- data/lib/MonkeyFactory/monkey_factory.rb +3 -4
- data/lib/MonkeyFactory.rb +3 -1
- data/lib/MonkeyKeyboard/keyboard_char.rb +3 -3
- data/lib/MonkeyKeyboard/keyboard_input.rb +4 -3
- data/lib/MonkeyKeyboard/keyboard_key.rb +12 -10
- data/lib/MonkeyKeyboard/keyboard_key_evaluator.rb +6 -8
- data/lib/MonkeyKeyboard/monkey_keyboard_en_us.rb +100 -80
- data/lib/MonkeyKeyboardEnUs.rb +3 -1
- data/lib/MonkeyManager/monkey_manager.rb +17 -15
- data/lib/MonkeyManager.rb +3 -1
- data/lib/MonkeyService/monkey_service.rb +8 -9
- data/lib/MonkeyService.rb +3 -1
- data/lib/tasks/engine.rb +63 -54
- data/monkeyengine.gemspec +26 -20
- data/spec/action_rules_spec.rb +17 -23
- data/spec/engine_spec.rb +15 -20
- data/spec/keyboard_char_spec.rb +4 -5
- data/spec/keyboard_key_spec.rb +8 -9
- data/spec/monkey_action_eat_spec.rb +17 -18
- data/spec/monkey_action_pause_spec.rb +19 -20
- data/spec/monkey_action_sleep_spec.rb +19 -20
- data/spec/monkey_action_type_spec.rb +25 -24
- data/spec/monkey_action_wake_spec.rb +10 -11
- data/spec/monkey_factory_spec.rb +7 -15
- data/spec/monkey_keyboard_en_us_spec.rb +10 -19
- data/spec/monkey_manager_spec.rb +3 -2
- data/spec/monkey_service_spec.rb +26 -29
- data/spec/monkey_spec.rb +3 -2
- data/spec/{spec_helpers.rb → spec_helper.rb} +7 -5
- data/spec/support/shared_examples.rb +16 -16
- metadata +69 -55
- data/.idea/.name +0 -1
- data/.idea/.rakeTasks +0 -7
- data/.idea/MonkeyEngine.iml +0 -133
- data/.idea/codeStyleSettings.xml +0 -13
- data/.idea/encodings.xml +0 -5
- data/.idea/misc.xml +0 -5
- data/.idea/modules.xml +0 -9
- data/.idea/runConfigurations/All_specs_in_test__MonkeyEngine.xml +0 -38
- data/.idea/runConfigurations/IRB_console.xml +0 -25
- data/.idea/runConfigurations/Start_Yard_Server.xml +0 -26
- data/.idea/runConfigurations/monkey_run.xml +0 -26
- data/.idea/scopes/scope_settings.xml +0 -5
- data/.idea/vcs.xml +0 -7
- data/.idea/workspace.xml +0 -886
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1fdf0a5f0ea4f5c0f273c39861ecba684ce0946e7d79e3614b02b21a31f9297d
|
4
|
+
data.tar.gz: 7fb57980b14f6997f3dbc0f3318098e8a88d378643d14f8082462169d9557c98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8d7d05635c56b4576cc2661cfd57926d421dda2282002f0b85c4769e5b6f0d49afbf61cd245f85be427d9f1b348d8ea651bfd4cf50319a7bb2192f8dabe0cda
|
7
|
+
data.tar.gz: 765db556503e17d6a1d048cb21727e614a8902cd01e1ca0484d1871478d83e3affc56b156a3b81c99f303bd08fbc1eb9d75cb71479b28bf3298a5e5c1009b4d7
|
data/.gitignore
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
/rdoc/
|
1
11
|
*.gem
|
2
|
-
|
3
|
-
|
4
|
-
.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
12
|
+
|
13
|
+
# rspec failure tracking
|
14
|
+
.rspec_status
|
15
|
+
|
16
|
+
/.vscode/
|
17
|
+
*.code-workspace
|
18
|
+
|
19
|
+
scratch.rb
|
20
|
+
readme.txt
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 3.0.1
|
7
|
+
NewCops: enable
|
8
|
+
Exclude:
|
9
|
+
- '.git/**/*'
|
10
|
+
- '.idea/**/*'
|
11
|
+
- 'init/*'
|
12
|
+
- 'Rakefile'
|
13
|
+
- '*.gemspec'
|
14
|
+
# - 'spec/**/*'
|
15
|
+
- 'vendor/**/*'
|
16
|
+
- 'scratch*.rb'
|
17
|
+
- 'snippets*.rb'
|
18
|
+
|
19
|
+
# Align the elements of a hash literal if they span more than one line.
|
20
|
+
Layout/HashAlignment:
|
21
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
22
|
+
|
23
|
+
# Alignment of parameters in multi-line method definition.
|
24
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
25
|
+
# level of indentation relative to the start of the line with the method
|
26
|
+
# definition.
|
27
|
+
#
|
28
|
+
# def my_method(a,
|
29
|
+
# b)
|
30
|
+
Layout/ParameterAlignment:
|
31
|
+
EnforcedStyle: with_fixed_indentation
|
32
|
+
|
33
|
+
# Alignment of parameters in multi-line method call.
|
34
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
35
|
+
# level of indentation relative to the start of the line with the method call.
|
36
|
+
#
|
37
|
+
# my_method(a,
|
38
|
+
# b)
|
39
|
+
Layout/ArgumentAlignment:
|
40
|
+
EnforcedStyle: with_fixed_indentation
|
41
|
+
|
42
|
+
# a = case n
|
43
|
+
# when 0
|
44
|
+
# x * 2
|
45
|
+
# else
|
46
|
+
# y / 3
|
47
|
+
# end
|
48
|
+
Layout/CaseIndentation:
|
49
|
+
EnforcedStyle: end
|
50
|
+
|
51
|
+
# Enforces a configured order of definitions within a class body
|
52
|
+
Layout/ClassStructure:
|
53
|
+
Enabled: true
|
54
|
+
|
55
|
+
# Align `end` with the matching keyword or starting expression except for
|
56
|
+
# assignments, where it should be aligned with the LHS.
|
57
|
+
Layout/EndAlignment:
|
58
|
+
EnforcedStyleAlignWith: variable
|
59
|
+
AutoCorrect: true
|
60
|
+
|
61
|
+
# The `consistent` style enforces that the first element in an array
|
62
|
+
# literal where the opening bracket and the first element are on
|
63
|
+
# seprate lines is indented the same as an array literal which is not
|
64
|
+
# defined inside a method call.
|
65
|
+
Layout/FirstArrayElementIndentation:
|
66
|
+
EnforcedStyle: consistent
|
67
|
+
|
68
|
+
# The `consistent` style enforces that the first key in a hash
|
69
|
+
# literal where the opening brace and the first key are on
|
70
|
+
# seprate lines is indented the same as a hash literal which is not
|
71
|
+
# defined inside a method call.
|
72
|
+
Layout/FirstHashElementIndentation:
|
73
|
+
EnforcedStyle: consistent
|
74
|
+
|
75
|
+
# Indent multi-line methods instead of aligning with periods
|
76
|
+
Layout/MultilineMethodCallIndentation:
|
77
|
+
EnforcedStyle: indented
|
78
|
+
|
79
|
+
# Allow `debug` in tasks for now
|
80
|
+
Lint/Debugger:
|
81
|
+
Exclude:
|
82
|
+
- 'RakeFile'
|
83
|
+
|
84
|
+
# A calculated magnitude based on number of assignments, branches, and
|
85
|
+
# conditions.
|
86
|
+
# NOTE: This is temporarily disabled until we can eliminate existing Rubocop
|
87
|
+
# complaints
|
88
|
+
Metrics/AbcSize:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
# Avoid long blocks with many lines.
|
92
|
+
Metrics/BlockLength:
|
93
|
+
Exclude:
|
94
|
+
- 'RakeFile'
|
95
|
+
- 'db/seeds.rb'
|
96
|
+
- 'spec/**/*.rb'
|
97
|
+
|
98
|
+
# Avoid classes longer than 100 lines of code.
|
99
|
+
# NOTE: This is temporarily disabled until we can eliminate existing Rubocop
|
100
|
+
# complaints
|
101
|
+
Metrics/ClassLength:
|
102
|
+
Max: 200
|
103
|
+
Exclude:
|
104
|
+
- 'spec/**/*.rb'
|
105
|
+
|
106
|
+
# A complexity metric that is strongly correlated to the number of test cases
|
107
|
+
# needed to validate a method.
|
108
|
+
Metrics/CyclomaticComplexity:
|
109
|
+
Max: 9
|
110
|
+
|
111
|
+
# Limit lines to 80 characters
|
112
|
+
Layout/LineLength:
|
113
|
+
Exclude:
|
114
|
+
- 'RakeFile'
|
115
|
+
- 'spec/**/*.rb'
|
116
|
+
|
117
|
+
# Avoid methods longer than 15 lines of code.
|
118
|
+
Metrics/MethodLength:
|
119
|
+
Max: 20
|
120
|
+
AllowedMethods:
|
121
|
+
- swagger_path
|
122
|
+
- operation
|
123
|
+
|
124
|
+
|
125
|
+
# A complexity metric geared towards measuring complexity for a human reader.
|
126
|
+
Metrics/PerceivedComplexity:
|
127
|
+
Max: 10
|
128
|
+
|
129
|
+
NestedGroups:
|
130
|
+
Max: 4
|
131
|
+
|
132
|
+
# Naming/FileName:
|
133
|
+
# Exclude:
|
134
|
+
# - 'lib/file.rb'
|
135
|
+
|
136
|
+
# Allow `downcase == ` instead of forcing `casecmp`
|
137
|
+
Performance/Casecmp:
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
# Require children definitions to be nested or compact in classes and modules
|
141
|
+
Style/ClassAndModuleChildren:
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
# Document classes and non-namespace modules.
|
145
|
+
# (Disabled for now, may revisit later)
|
146
|
+
Style/Documentation:
|
147
|
+
Enabled: false
|
148
|
+
|
149
|
+
# Checks the formatting of empty method definitions.
|
150
|
+
Style/EmptyMethod:
|
151
|
+
EnforcedStyle: expanded
|
152
|
+
|
153
|
+
# Add the frozen_string_literal comment to the top of files to help transition
|
154
|
+
# to frozen string literals by default.
|
155
|
+
Style/FrozenStringLiteralComment:
|
156
|
+
EnforcedStyle: always
|
157
|
+
|
158
|
+
# Check for conditionals that can be replaced with guard clauses
|
159
|
+
Style/GuardClause:
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
Style/MixinUsage:
|
163
|
+
Exclude:
|
164
|
+
- 'RakeFile'
|
165
|
+
|
166
|
+
# Avoid multi-line method signatures.
|
167
|
+
Style/MultilineMethodSignature:
|
168
|
+
Enabled: true
|
169
|
+
|
170
|
+
# Don't use option hashes when you can use keyword arguments.
|
171
|
+
Style/OptionHash:
|
172
|
+
Enabled: true
|
173
|
+
|
174
|
+
# Use return instead of return nil.
|
175
|
+
Style/ReturnNil:
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
# Allow code like `return x, y` as it's occasionally handy.
|
179
|
+
Style/RedundantReturn:
|
180
|
+
AllowMultipleReturnValues: true
|
181
|
+
|
182
|
+
# Prefer symbols instead of strings as hash keys.
|
183
|
+
Style/StringHashKeys:
|
184
|
+
Enabled: true
|
185
|
+
|
186
|
+
# Checks if configured preferred methods are used over non-preferred.
|
187
|
+
Style/StringMethods:
|
188
|
+
Enabled: true
|
189
|
+
|
190
|
+
# Checks for use of parentheses around ternary conditions.
|
191
|
+
Style/TernaryParentheses:
|
192
|
+
EnforcedStyle: require_parentheses_when_complex
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### Version 2.0.1
|
2
|
+
- Update ruby gems.
|
3
|
+
- Various refactors.
|
4
|
+
|
5
|
+
### Version 2.0.0
|
6
|
+
- Use LittleWeasel gem for dictionary.
|
7
|
+
- Gem update to patch CVEs.
|
8
|
+
|
1
9
|
### Version 1.1.0
|
2
|
-
|
3
|
-
|
10
|
+
- Made some changes to the sample rake task $ bundle exec rake engine:run
|
11
|
+
- Added this CHANGELOG.md file
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
MonkeyEngine (2.0.1)
|
5
|
+
LittleWeasel (~> 5.0, >= 5.0.3)
|
6
|
+
ProtectedConstructor (~> 2.0, >= 2.0.3)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
LittleWeasel (5.0.6)
|
12
|
+
activesupport (~> 6.1, >= 6.1.3.2)
|
13
|
+
ProtectedConstructor (2.1.4)
|
14
|
+
activesupport (6.1.7.6)
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
19
|
+
zeitwerk (~> 2.3)
|
20
|
+
byebug (11.1.3)
|
21
|
+
coderay (1.1.3)
|
22
|
+
colorize (0.8.1)
|
23
|
+
concurrent-ruby (1.2.2)
|
24
|
+
diff-lcs (1.5.0)
|
25
|
+
i18n (1.14.1)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
method_source (1.0.0)
|
28
|
+
minitest (5.19.0)
|
29
|
+
pry (0.14.2)
|
30
|
+
coderay (~> 1.1)
|
31
|
+
method_source (~> 1.0)
|
32
|
+
pry-byebug (3.10.1)
|
33
|
+
byebug (~> 11.0)
|
34
|
+
pry (>= 0.13, < 0.15)
|
35
|
+
rake (13.0.6)
|
36
|
+
redcarpet (2.3.0)
|
37
|
+
rspec (3.12.0)
|
38
|
+
rspec-core (~> 3.12.0)
|
39
|
+
rspec-expectations (~> 3.12.0)
|
40
|
+
rspec-mocks (~> 3.12.0)
|
41
|
+
rspec-core (3.12.2)
|
42
|
+
rspec-support (~> 3.12.0)
|
43
|
+
rspec-expectations (3.12.3)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.12.0)
|
46
|
+
rspec-mocks (3.12.6)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.12.0)
|
49
|
+
rspec-support (3.12.1)
|
50
|
+
tzinfo (2.0.6)
|
51
|
+
concurrent-ruby (~> 1.0)
|
52
|
+
yard (0.9.34)
|
53
|
+
zeitwerk (2.6.11)
|
54
|
+
|
55
|
+
PLATFORMS
|
56
|
+
x86_64-darwin-19
|
57
|
+
x86_64-darwin-21
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
MonkeyEngine!
|
61
|
+
bundler (~> 2.3, >= 2.3.20)
|
62
|
+
colorize (~> 0.8.1)
|
63
|
+
pry-byebug (~> 3.9)
|
64
|
+
rake (~> 13.0, >= 13.0.6)
|
65
|
+
redcarpet (~> 2.3, >= 2.3.0)
|
66
|
+
rspec (~> 3.10)
|
67
|
+
yard (~> 0.9.28)
|
68
|
+
|
69
|
+
BUNDLED WITH
|
70
|
+
2.3.22
|
data/Rakefile
CHANGED