aoc_cli 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.rubocop.yml +88 -0
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +187 -0
  8. data/README.md +88 -282
  9. data/Rakefile +9 -2
  10. data/Steepfile +13 -0
  11. data/aoc_cli.gemspec +36 -26
  12. data/db/migrate/1_create_events.rb +14 -0
  13. data/db/migrate/2_create_puzzles.rb +21 -0
  14. data/db/migrate/3_create_stats.rb +19 -0
  15. data/db/migrate/4_create_attempts.rb +19 -0
  16. data/db/migrate/5_create_locations.rb +17 -0
  17. data/db/migrate/6_create_puzzle_dir_sync_logs.rb +18 -0
  18. data/exe/aoc +5 -0
  19. data/lib/aoc_cli/components/attempts_table.erb +5 -0
  20. data/lib/aoc_cli/components/attempts_table.rb +58 -0
  21. data/lib/aoc_cli/components/docs_component.erb +19 -0
  22. data/lib/aoc_cli/components/docs_component.rb +41 -0
  23. data/lib/aoc_cli/components/errors_component.erb +8 -0
  24. data/lib/aoc_cli/components/errors_component.rb +36 -0
  25. data/lib/aoc_cli/components/progress_table.erb +1 -0
  26. data/lib/aoc_cli/components/progress_table.rb +43 -0
  27. data/lib/aoc_cli/components/puzzle_sync_component.erb +2 -0
  28. data/lib/aoc_cli/components/puzzle_sync_component.rb +26 -0
  29. data/lib/aoc_cli/configurators/session_configurator.rb +7 -0
  30. data/lib/aoc_cli/controllers/application_controller.rb +27 -0
  31. data/lib/aoc_cli/controllers/concerns/error_concern.rb +17 -0
  32. data/lib/aoc_cli/controllers/concerns/location_concern.rb +79 -0
  33. data/lib/aoc_cli/controllers/default_controller.rb +9 -0
  34. data/lib/aoc_cli/controllers/event_controller.rb +35 -0
  35. data/lib/aoc_cli/controllers/help/event_controller.rb +11 -0
  36. data/lib/aoc_cli/controllers/help/puzzle_controller.rb +13 -0
  37. data/lib/aoc_cli/controllers/puzzle_controller.rb +39 -0
  38. data/lib/aoc_cli/core/attempt_parser.rb +69 -0
  39. data/lib/aoc_cli/core/processor.rb +32 -0
  40. data/lib/aoc_cli/core/repository.rb +74 -0
  41. data/lib/aoc_cli/core/request.rb +37 -0
  42. data/lib/aoc_cli/core/resource.rb +39 -0
  43. data/lib/aoc_cli/core/stats_parser.rb +43 -0
  44. data/lib/aoc_cli/helpers/table_generator.rb +64 -0
  45. data/lib/aoc_cli/helpers/view_helper.rb +35 -0
  46. data/lib/aoc_cli/models/attempt.rb +67 -0
  47. data/lib/aoc_cli/models/event.rb +9 -0
  48. data/lib/aoc_cli/models/location.rb +24 -0
  49. data/lib/aoc_cli/models/puzzle.rb +28 -0
  50. data/lib/aoc_cli/models/puzzle_dir_sync_log.rb +14 -0
  51. data/lib/aoc_cli/models/stats.rb +43 -0
  52. data/lib/aoc_cli/presenters/attempt_presenter.rb +29 -0
  53. data/lib/aoc_cli/presenters/puzzle_presenter.rb +29 -0
  54. data/lib/aoc_cli/presenters/stats_presenter.rb +32 -0
  55. data/lib/aoc_cli/processors/event_initialiser.rb +64 -0
  56. data/lib/aoc_cli/processors/puzzle_dir_synchroniser.rb +80 -0
  57. data/lib/aoc_cli/processors/puzzle_initialiser.rb +91 -0
  58. data/lib/aoc_cli/processors/puzzle_refresher.rb +27 -0
  59. data/lib/aoc_cli/processors/resource_attacher.rb +22 -0
  60. data/lib/aoc_cli/processors/solution_poster.rb +72 -0
  61. data/lib/aoc_cli/processors/stats_initialiser.rb +36 -0
  62. data/lib/aoc_cli/processors/stats_refresher.rb +23 -0
  63. data/lib/aoc_cli/validators/collection_type_validator.rb +57 -0
  64. data/lib/aoc_cli/validators/event_year_validator.rb +42 -0
  65. data/lib/aoc_cli/validators/included_validator.rb +21 -0
  66. data/lib/aoc_cli/validators/integer_validator.rb +32 -0
  67. data/lib/aoc_cli/validators/path_validator.rb +39 -0
  68. data/lib/aoc_cli/validators/type_validator.rb +54 -0
  69. data/lib/aoc_cli/version.rb +1 -1
  70. data/lib/aoc_cli/views/event/attach.erb +3 -0
  71. data/lib/aoc_cli/views/event/init.erb +3 -0
  72. data/lib/aoc_cli/views/help/event/attach.erb +32 -0
  73. data/lib/aoc_cli/views/help/event/init.erb +38 -0
  74. data/lib/aoc_cli/views/help/event/progress.erb +12 -0
  75. data/lib/aoc_cli/views/help/puzzle/attempts.erb +12 -0
  76. data/lib/aoc_cli/views/help/puzzle/init.erb +31 -0
  77. data/lib/aoc_cli/views/help/puzzle/solve.erb +33 -0
  78. data/lib/aoc_cli/views/help/puzzle/sync.erb +32 -0
  79. data/lib/aoc_cli/views/puzzle/init.erb +3 -0
  80. data/lib/aoc_cli/views/puzzle/solve.erb +10 -0
  81. data/lib/aoc_cli.rb +32 -16
  82. data/rbs_collection.lock.yaml +168 -0
  83. data/rbs_collection.yaml +28 -0
  84. data/sig/aoc_cli/components/attempts_table.rbs +29 -0
  85. data/sig/aoc_cli/components/docs_component.rbs +15 -0
  86. data/sig/aoc_cli/components/errors_component.rbs +19 -0
  87. data/sig/aoc_cli/components/progress_table.rbs +28 -0
  88. data/sig/aoc_cli/components/puzzle_sync_component.rbs +19 -0
  89. data/sig/aoc_cli/configurators/session_configurator.rbs +7 -0
  90. data/sig/aoc_cli/controllers/application_controller.rbs +12 -0
  91. data/sig/aoc_cli/controllers/concerns/error_concern.rbs +9 -0
  92. data/sig/aoc_cli/controllers/concerns/location_concern.rbs +35 -0
  93. data/sig/aoc_cli/controllers/default_controller.rbs +7 -0
  94. data/sig/aoc_cli/controllers/event_controller.rbs +18 -0
  95. data/sig/aoc_cli/controllers/help/event_controller.rbs +11 -0
  96. data/sig/aoc_cli/controllers/help/puzzle_controller.rbs +13 -0
  97. data/sig/aoc_cli/controllers/puzzle_controller.rbs +15 -0
  98. data/sig/aoc_cli/core/attempt_parser.rbs +41 -0
  99. data/sig/aoc_cli/core/processor.rbs +25 -0
  100. data/sig/aoc_cli/core/repository.rbs +25 -0
  101. data/sig/aoc_cli/core/request.rbs +29 -0
  102. data/sig/aoc_cli/core/resource.rbs +25 -0
  103. data/sig/aoc_cli/core/stats_parser.rbs +23 -0
  104. data/sig/aoc_cli/helpers/table_generator.rbs +36 -0
  105. data/sig/aoc_cli/helpers/view_helper.rbs +15 -0
  106. data/sig/aoc_cli/models/attempt.rbs +35 -0
  107. data/sig/aoc_cli/models/event.rbs +17 -0
  108. data/sig/aoc_cli/models/location.rbs +19 -0
  109. data/sig/aoc_cli/models/puzzle.rbs +28 -0
  110. data/sig/aoc_cli/models/puzzle_dir_sync_log.rbs +11 -0
  111. data/sig/aoc_cli/models/stats.rbs +53 -0
  112. data/sig/aoc_cli/presenters/attempt_presenter.rbs +13 -0
  113. data/sig/aoc_cli/presenters/puzzle_presenter.rbs +19 -0
  114. data/sig/aoc_cli/presenters/stats_presenter.rbs +19 -0
  115. data/sig/aoc_cli/processors/event_initialiser.rbs +26 -0
  116. data/sig/aoc_cli/processors/puzzle_dir_synchroniser.rbs +40 -0
  117. data/sig/aoc_cli/processors/puzzle_initialiser.rbs +37 -0
  118. data/sig/aoc_cli/processors/puzzle_refresher.rbs +21 -0
  119. data/sig/aoc_cli/processors/resource_attacher.rbs +16 -0
  120. data/sig/aoc_cli/processors/solution_poster.rbs +34 -0
  121. data/sig/aoc_cli/processors/stats_initialiser.rbs +15 -0
  122. data/sig/aoc_cli/processors/stats_refresher.rbs +19 -0
  123. data/sig/aoc_cli/validators/collection_type_validator.rbs +24 -0
  124. data/sig/aoc_cli/validators/event_year_validator.rbs +19 -0
  125. data/sig/aoc_cli/validators/included_validator.rbs +11 -0
  126. data/sig/aoc_cli/validators/integer_validator.rbs +15 -0
  127. data/sig/aoc_cli/validators/path_validator.rbs +17 -0
  128. data/sig/aoc_cli/validators/type_validator.rbs +22 -0
  129. data/sig/aoc_cli.rbs +6 -0
  130. data/sig/http.rbs +3 -0
  131. data/sig/kangaru.rbs +5 -0
  132. data/sig/nokogiri.rbs +3 -0
  133. data/sig/reverse_markdown.rbs +3 -0
  134. metadata +142 -34
  135. data/.gitignore +0 -5
  136. data/bin/aoc +0 -4
  137. data/bin/console +0 -15
  138. data/bin/setup +0 -7
  139. data/lib/aoc_cli/commands.rb +0 -232
  140. data/lib/aoc_cli/database.rb +0 -224
  141. data/lib/aoc_cli/day.rb +0 -124
  142. data/lib/aoc_cli/db/reddit.db +0 -0
  143. data/lib/aoc_cli/errors.rb +0 -275
  144. data/lib/aoc_cli/files.rb +0 -163
  145. data/lib/aoc_cli/help.rb +0 -77
  146. data/lib/aoc_cli/interface.rb +0 -81
  147. data/lib/aoc_cli/paths.rb +0 -101
  148. data/lib/aoc_cli/solve.rb +0 -104
  149. data/lib/aoc_cli/tables.rb +0 -138
  150. data/lib/aoc_cli/tools.rb +0 -120
  151. data/lib/aoc_cli/year.rb +0 -116
  152. data/sample/aoc.rc +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48d955e92e44900dc1e8055d26e2e8ce92bd1516ac57c18dd946cb6e53ad7666
4
- data.tar.gz: b9138b981d6d99454f247f1fe20767923e563dce0189cc2b231868dc23a20f83
3
+ metadata.gz: 523ec81af92a97e0d60f5e7490d29feb336e2c1577eecb00c7510c47171dfb87
4
+ data.tar.gz: 6c6f424ee15d996c12d9552d6a7681fd946b0f0724c5803f3344bfdb41eaad72
5
5
  SHA512:
6
- metadata.gz: 88766c1b68f745590eb203475e20336e07e9a228519745b5a46bdfb1fe5e5137cf4f48867f818a219b84e500ca581c6584465aa1c47154b59e5d91b5a536411c
7
- data.tar.gz: c9801850f6b949c5a87e601fcb0d61359e43770bbf693208f711c7a543b91fabf9461781f757c4cb854a160e875b4081985eb95f04ea11d400ba2260cae35ba3
6
+ metadata.gz: cd1fd05753d8fc593f37b6f28db96bb58cb9eae931a8b28852513ed25bf6cdcc300c44f4963a1581207dd8001b4d9fc0115ac582b6d79d49e1766c54dc17fbe7
7
+ data.tar.gz: 1a5a042be37b1e4b661c05417a94312701c26eb794895cfc58455099ef9cd16f3c6df57ac74d096d20f5298019415b6beea15acc875f465728ef7314ad5dd031
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,88 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+ SuggestExtensions: false
7
+
8
+ Gemspec/RequireMFA:
9
+ Enabled: false
10
+
11
+ Layout/ExtraSpacing:
12
+ AllowForAlignment: true
13
+ Layout/LineLength:
14
+ Max: 80
15
+ Layout/MultilineMethodCallIndentation:
16
+ Enabled: false
17
+
18
+ Lint/AmbiguousBlockAssociation:
19
+ Enabled: false
20
+ Lint/ConstantDefinitionInBlock:
21
+ Exclude:
22
+ - spec/spec_helper.rb
23
+ Lint/MissingSuper:
24
+ Enabled: false
25
+
26
+ Metrics/BlockLength:
27
+ Exclude:
28
+ - db/migrate/**/*.rb
29
+
30
+ Naming/MethodParameterName:
31
+ AllowedNames:
32
+ - by
33
+ - to
34
+ - id
35
+ Naming/VariableNumber:
36
+ EnforcedStyle: snake_case
37
+
38
+ Style/ArgumentsForwarding:
39
+ Enabled: false
40
+ Style/CharacterLiteral:
41
+ Enabled: false
42
+ Style/Documentation:
43
+ Enabled: false
44
+ Style/ExplicitBlockArgument:
45
+ Enabled: false
46
+ Style/FormatStringToken:
47
+ EnforcedStyle: template
48
+ Style/FrozenStringLiteralComment:
49
+ Enabled: false
50
+ Style/RescueStandardError:
51
+ EnforcedStyle: implicit
52
+ Style/StringLiterals:
53
+ EnforcedStyle: double_quotes
54
+
55
+ RSpec/AnyInstance:
56
+ Enabled: false
57
+ RSpec/ContextWording:
58
+ Prefixes:
59
+ - when
60
+ - with
61
+ - without
62
+ - if
63
+ - unless
64
+ - and
65
+ - but
66
+ RSpec/DescribeClass:
67
+ Exclude:
68
+ - spec/aoc_cli/controllers/**/*.rb
69
+ RSpec/DescribedClass:
70
+ SkipBlocks: true
71
+ RSpec/ExpectChange:
72
+ EnforcedStyle: block
73
+ RSpec/FilePath:
74
+ Exclude:
75
+ - spec/aoc_cli/models/**/*.rb
76
+ - spec/aoc_cli/controllers/**/*.rb
77
+ RSpec/LetSetup:
78
+ Enabled: false
79
+ RSpec/MultipleMemoizedHelpers:
80
+ Max: 15
81
+ RSpec/NestedGroups:
82
+ Enabled: false
83
+ RSpec/SharedExamples:
84
+ Enabled: false
85
+ RSpec/SpecFilePathFormat:
86
+ Exclude:
87
+ - spec/aoc_cli/models/**/*.rb
88
+ - spec/aoc_cli/controllers/**/*.rb
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -29,3 +29,7 @@
29
29
  - Year refresh now creates the calendar table if it does not exist
30
30
  - Update terminal-table version requirements
31
31
  - Add version flag
32
+
33
+ ## 13-03-21
34
+ ### 0.2.3
35
+ - SQLite Bug fix for text-only answers
data/Gemfile CHANGED
@@ -1,4 +1,12 @@
1
1
  source "https://rubygems.org"
2
+
2
3
  gemspec
3
4
 
5
+ gem "factory_bot"
4
6
  gem "rake", "~> 13.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "rubocop", "~> 1.21"
9
+ gem "rubocop-rspec"
10
+ gem "steep"
11
+ gem "vcr"
12
+ gem "webmock"
data/Gemfile.lock ADDED
@@ -0,0 +1,187 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ aoc_cli (1.0.0)
5
+ http
6
+ kangaru
7
+ nokogiri
8
+ reverse_markdown
9
+ sequel_polymorphic
10
+ terminal-table
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ abbrev (0.1.1)
16
+ activesupport (7.1.2)
17
+ base64
18
+ bigdecimal
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ connection_pool (>= 2.2.5)
21
+ drb
22
+ i18n (>= 1.6, < 2)
23
+ minitest (>= 5.1)
24
+ mutex_m
25
+ tzinfo (~> 2.0)
26
+ addressable (2.8.5)
27
+ public_suffix (>= 2.0.2, < 6.0)
28
+ ast (2.4.2)
29
+ base64 (0.2.0)
30
+ bigdecimal (3.1.5)
31
+ cgi (0.4.1)
32
+ colorize (1.1.0)
33
+ concurrent-ruby (1.2.2)
34
+ connection_pool (2.4.1)
35
+ crack (0.4.5)
36
+ rexml
37
+ csv (3.2.8)
38
+ diff-lcs (1.5.0)
39
+ domain_name (0.6.20231109)
40
+ drb (2.2.0)
41
+ ruby2_keywords
42
+ erb (4.0.3)
43
+ cgi (>= 0.3.3)
44
+ factory_bot (6.4.2)
45
+ activesupport (>= 5.0.0)
46
+ ffi (1.16.3)
47
+ ffi-compiler (1.0.1)
48
+ ffi (>= 1.0.0)
49
+ rake
50
+ fileutils (1.7.2)
51
+ hashdiff (1.0.1)
52
+ http (5.1.1)
53
+ addressable (~> 2.8)
54
+ http-cookie (~> 1.0)
55
+ http-form_data (~> 2.2)
56
+ llhttp-ffi (~> 0.4.0)
57
+ http-cookie (1.0.5)
58
+ domain_name (~> 0.5)
59
+ http-form_data (2.3.0)
60
+ i18n (1.14.1)
61
+ concurrent-ruby (~> 1.0)
62
+ json (2.6.3)
63
+ kangaru (0.2.4)
64
+ colorize (~> 1.1)
65
+ erb (~> 4.0)
66
+ sequel (~> 5.72)
67
+ sqlite3 (~> 1.6)
68
+ zeitwerk (~> 2.6)
69
+ language_server-protocol (3.17.0.3)
70
+ listen (3.8.0)
71
+ rb-fsevent (~> 0.10, >= 0.10.3)
72
+ rb-inotify (~> 0.9, >= 0.9.10)
73
+ llhttp-ffi (0.4.0)
74
+ ffi-compiler (~> 1.0)
75
+ rake (~> 13.0)
76
+ logger (1.6.0)
77
+ minitest (5.20.0)
78
+ mutex_m (0.2.0)
79
+ nokogiri (1.15.5-arm64-darwin)
80
+ racc (~> 1.4)
81
+ nokogiri (1.15.5-x86_64-linux)
82
+ racc (~> 1.4)
83
+ parallel (1.23.0)
84
+ parser (3.2.2.4)
85
+ ast (~> 2.4.1)
86
+ racc
87
+ public_suffix (5.0.4)
88
+ racc (1.7.3)
89
+ rainbow (3.1.1)
90
+ rake (13.1.0)
91
+ rb-fsevent (0.11.2)
92
+ rb-inotify (0.10.1)
93
+ ffi (~> 1.0)
94
+ rbs (3.3.2)
95
+ abbrev
96
+ regexp_parser (2.8.2)
97
+ reverse_markdown (2.1.1)
98
+ nokogiri
99
+ rexml (3.2.6)
100
+ rspec (3.12.0)
101
+ rspec-core (~> 3.12.0)
102
+ rspec-expectations (~> 3.12.0)
103
+ rspec-mocks (~> 3.12.0)
104
+ rspec-core (3.12.2)
105
+ rspec-support (~> 3.12.0)
106
+ rspec-expectations (3.12.3)
107
+ diff-lcs (>= 1.2.0, < 2.0)
108
+ rspec-support (~> 3.12.0)
109
+ rspec-mocks (3.12.6)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.12.0)
112
+ rspec-support (3.12.1)
113
+ rubocop (1.57.2)
114
+ json (~> 2.3)
115
+ language_server-protocol (>= 3.17.0)
116
+ parallel (~> 1.10)
117
+ parser (>= 3.2.2.4)
118
+ rainbow (>= 2.2.2, < 4.0)
119
+ regexp_parser (>= 1.8, < 3.0)
120
+ rexml (>= 3.2.5, < 4.0)
121
+ rubocop-ast (>= 1.28.1, < 2.0)
122
+ ruby-progressbar (~> 1.7)
123
+ unicode-display_width (>= 2.4.0, < 3.0)
124
+ rubocop-ast (1.30.0)
125
+ parser (>= 3.2.1.0)
126
+ rubocop-capybara (2.19.0)
127
+ rubocop (~> 1.41)
128
+ rubocop-factory_bot (2.24.0)
129
+ rubocop (~> 1.33)
130
+ rubocop-rspec (2.25.0)
131
+ rubocop (~> 1.40)
132
+ rubocop-capybara (~> 2.17)
133
+ rubocop-factory_bot (~> 2.22)
134
+ ruby-progressbar (1.13.0)
135
+ ruby2_keywords (0.0.5)
136
+ securerandom (0.3.0)
137
+ sequel (5.75.0)
138
+ bigdecimal
139
+ sequel_polymorphic (0.5.0)
140
+ sequel (>= 4.0.0, < 6)
141
+ sqlite3 (1.6.9-arm64-darwin)
142
+ sqlite3 (1.6.9-x86_64-linux)
143
+ steep (1.6.0)
144
+ activesupport (>= 5.1)
145
+ concurrent-ruby (>= 1.1.10)
146
+ csv (>= 3.0.9)
147
+ fileutils (>= 1.1.0)
148
+ json (>= 2.1.0)
149
+ language_server-protocol (>= 3.15, < 4.0)
150
+ listen (~> 3.0)
151
+ logger (>= 1.3.0)
152
+ parser (>= 3.1)
153
+ rainbow (>= 2.2.2, < 4.0)
154
+ rbs (>= 3.1.0)
155
+ securerandom (>= 0.1)
156
+ strscan (>= 1.0.0)
157
+ terminal-table (>= 2, < 4)
158
+ strscan (3.0.7)
159
+ terminal-table (3.0.2)
160
+ unicode-display_width (>= 1.1.1, < 3)
161
+ tzinfo (2.0.6)
162
+ concurrent-ruby (~> 1.0)
163
+ unicode-display_width (2.5.0)
164
+ vcr (6.2.0)
165
+ webmock (3.19.1)
166
+ addressable (>= 2.8.0)
167
+ crack (>= 0.3.2)
168
+ hashdiff (>= 0.4.0, < 2.0.0)
169
+ zeitwerk (2.6.12)
170
+
171
+ PLATFORMS
172
+ arm64-darwin-21
173
+ x86_64-linux
174
+
175
+ DEPENDENCIES
176
+ aoc_cli!
177
+ factory_bot
178
+ rake (~> 13.0)
179
+ rspec (~> 3.0)
180
+ rubocop (~> 1.21)
181
+ rubocop-rspec
182
+ steep
183
+ vcr
184
+ webmock
185
+
186
+ BUNDLED WITH
187
+ 2.4.1