mission_control-web 0.0.1 → 0.2.0

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +122 -15
  4. data/Rakefile +21 -3
  5. data/app/assets/config/mission_control_web_manifest.js +2 -0
  6. data/app/assets/stylesheets/mission_control/web/application.css +15 -0
  7. data/app/assets/stylesheets/mission_control/web/vendor/bulma.min.css +1 -0
  8. data/app/controllers/concerns/mission_control/web/application_scoped.rb +17 -0
  9. data/app/controllers/mission_control/web/application_controller.rb +4 -0
  10. data/app/controllers/mission_control/web/errors_controller.rb +6 -0
  11. data/app/controllers/mission_control/web/routes_controller.rb +52 -0
  12. data/app/helpers/mission_control/web/applications_helper.rb +9 -0
  13. data/app/helpers/mission_control/web/routes_helper.rb +9 -0
  14. data/app/javascript/mission_control/web/application.js +1 -0
  15. data/app/models/concerns/mission_control/web/route/applications.rb +17 -0
  16. data/app/models/mission_control/web/application/routes.rb +24 -0
  17. data/app/models/mission_control/web/application.rb +34 -0
  18. data/app/models/mission_control/web/application_record.rb +3 -0
  19. data/app/models/mission_control/web/current.rb +8 -0
  20. data/app/models/mission_control/web/route.rb +14 -0
  21. data/app/views/layouts/mission_control/web/application.html.erb +23 -0
  22. data/app/views/mission_control/web/application/_current_application_selector.html.erb +15 -0
  23. data/app/views/mission_control/web/application/_flash.html.erb +3 -0
  24. data/app/views/mission_control/web/application/_form_errors.html.erb +11 -0
  25. data/app/views/mission_control/web/application/_navbar.html.erb +14 -0
  26. data/app/views/mission_control/web/errors/disallowed.html.erb +8 -0
  27. data/app/views/mission_control/web/routes/_form.html.erb +26 -0
  28. data/app/views/mission_control/web/routes/_route.html.erb +13 -0
  29. data/app/views/mission_control/web/routes/edit.html.erb +8 -0
  30. data/app/views/mission_control/web/routes/index.html.erb +27 -0
  31. data/app/views/mission_control/web/routes/new.html.erb +8 -0
  32. data/app/views/mission_control/web/routes/show.html.erb +42 -0
  33. data/config/importmap.rb +2 -0
  34. data/config/routes.rb +7 -0
  35. data/db/migrate/20221025093008_create_mission_control_web_routes.rb +14 -0
  36. data/lib/generators/mission_control/web/install/admin_generator.rb +38 -0
  37. data/lib/generators/mission_control/web/install/middleware_generator.rb +26 -0
  38. data/lib/generators/mission_control/web/install_generator.rb +6 -0
  39. data/lib/mission_control/web/action_dispatch_request.rb +7 -0
  40. data/lib/mission_control/web/bulma_form_builder.rb +50 -0
  41. data/lib/mission_control/web/configuration.rb +21 -0
  42. data/lib/mission_control/web/engine.rb +45 -0
  43. data/lib/mission_control/web/errors/resource_not_found.rb +2 -0
  44. data/lib/mission_control/web/request_filter.rb +17 -0
  45. data/lib/mission_control/web/request_filter_middleware.rb +26 -0
  46. data/lib/mission_control/web/routes_cache.rb +52 -0
  47. data/lib/mission_control/web/version.rb +1 -3
  48. data/lib/mission_control/web.rb +18 -4
  49. data/lib/tasks/mission_control/web_tasks.rake +4 -0
  50. metadata +147 -8
  51. data/LICENSE.txt +0 -21
  52. data/mission_control-web.gemspec +0 -35
  53. data/sig/mission_control/web.rbs +0 -6
@@ -1,10 +1,24 @@
1
- # frozen_string_literal: true
1
+ require "mission_control/web/engine"
2
+ require "active_support/core_ext/module/attribute_accessors_per_thread"
2
3
 
3
- require_relative "web/version"
4
+ require "zeitwerk"
5
+ loader = Zeitwerk::Loader.new
6
+ loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
7
+ loader.push_dir(File.expand_path("..", __dir__))
8
+ loader.ignore(File.expand_path("..", __dir__) + "/generators")
9
+ loader.setup
4
10
 
5
11
  module MissionControl
6
12
  module Web
7
- class Error < StandardError; end
8
- # Your code goes here...
13
+ mattr_reader :configuration, default: Configuration.new
14
+ thread_mattr_accessor :current_redis
15
+
16
+ def self.redis
17
+ current_redis || configuration.redis
18
+ end
19
+
20
+ def self.host_application
21
+ @host_application ||= Application.find_or_initialize_by_name(configuration.host_application_name)
22
+ end
9
23
  end
10
24
  end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :mission_control_web do
3
+ # # Task goes here
4
+ # end
metadata CHANGED
@@ -1,15 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mission_control-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lewis Buckley
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.3.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: importmap-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: turbo-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "<"
53
+ - !ruby/object:Gem::Version
54
+ version: '7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: redis
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-performance
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
13
111
  description:
14
112
  email:
15
113
  - lewis@hey.com
@@ -17,13 +115,54 @@ executables: []
17
115
  extensions: []
18
116
  extra_rdoc_files: []
19
117
  files:
20
- - LICENSE.txt
118
+ - MIT-LICENSE
21
119
  - README.md
22
120
  - Rakefile
121
+ - app/assets/config/mission_control_web_manifest.js
122
+ - app/assets/stylesheets/mission_control/web/application.css
123
+ - app/assets/stylesheets/mission_control/web/vendor/bulma.min.css
124
+ - app/controllers/concerns/mission_control/web/application_scoped.rb
125
+ - app/controllers/mission_control/web/application_controller.rb
126
+ - app/controllers/mission_control/web/errors_controller.rb
127
+ - app/controllers/mission_control/web/routes_controller.rb
128
+ - app/helpers/mission_control/web/applications_helper.rb
129
+ - app/helpers/mission_control/web/routes_helper.rb
130
+ - app/javascript/mission_control/web/application.js
131
+ - app/models/concerns/mission_control/web/route/applications.rb
132
+ - app/models/mission_control/web/application.rb
133
+ - app/models/mission_control/web/application/routes.rb
134
+ - app/models/mission_control/web/application_record.rb
135
+ - app/models/mission_control/web/current.rb
136
+ - app/models/mission_control/web/route.rb
137
+ - app/views/layouts/mission_control/web/application.html.erb
138
+ - app/views/mission_control/web/application/_current_application_selector.html.erb
139
+ - app/views/mission_control/web/application/_flash.html.erb
140
+ - app/views/mission_control/web/application/_form_errors.html.erb
141
+ - app/views/mission_control/web/application/_navbar.html.erb
142
+ - app/views/mission_control/web/errors/disallowed.html.erb
143
+ - app/views/mission_control/web/routes/_form.html.erb
144
+ - app/views/mission_control/web/routes/_route.html.erb
145
+ - app/views/mission_control/web/routes/edit.html.erb
146
+ - app/views/mission_control/web/routes/index.html.erb
147
+ - app/views/mission_control/web/routes/new.html.erb
148
+ - app/views/mission_control/web/routes/show.html.erb
149
+ - config/importmap.rb
150
+ - config/routes.rb
151
+ - db/migrate/20221025093008_create_mission_control_web_routes.rb
152
+ - lib/generators/mission_control/web/install/admin_generator.rb
153
+ - lib/generators/mission_control/web/install/middleware_generator.rb
154
+ - lib/generators/mission_control/web/install_generator.rb
23
155
  - lib/mission_control/web.rb
156
+ - lib/mission_control/web/action_dispatch_request.rb
157
+ - lib/mission_control/web/bulma_form_builder.rb
158
+ - lib/mission_control/web/configuration.rb
159
+ - lib/mission_control/web/engine.rb
160
+ - lib/mission_control/web/errors/resource_not_found.rb
161
+ - lib/mission_control/web/request_filter.rb
162
+ - lib/mission_control/web/request_filter_middleware.rb
163
+ - lib/mission_control/web/routes_cache.rb
24
164
  - lib/mission_control/web/version.rb
25
- - mission_control-web.gemspec
26
- - sig/mission_control/web.rbs
165
+ - lib/tasks/mission_control/web_tasks.rake
27
166
  homepage: https://github.com/basecamp/mission_control-web
28
167
  licenses:
29
168
  - MIT
@@ -45,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
184
  - !ruby/object:Gem::Version
46
185
  version: '0'
47
186
  requirements: []
48
- rubygems_version: 3.5.5
187
+ rubygems_version: 3.5.9
49
188
  signing_key:
50
189
  specification_version: 4
51
190
  summary: Operational controls for Rails web traffic
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Rosa Gutierrez
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/mission_control/web/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "mission_control-web"
7
- spec.version = MissionControl::Web::VERSION
8
- spec.authors = [ "Lewis Buckley" ]
9
- spec.email = [ "lewis@hey.com" ]
10
- spec.homepage = "https://github.com/basecamp/mission_control-web"
11
-
12
- spec.summary = "Operational controls for Rails web traffic"
13
- spec.license = "MIT"
14
-
15
- spec.metadata["homepage_uri"] = spec.homepage
16
- spec.metadata["source_code_uri"] = spec.homepage
17
-
18
- # Specify which files should be added to the gem when it is released.
19
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
- spec.files = Dir.chdir(__dir__) do
21
- `git ls-files -z`.split("\x0").reject do |f|
22
- (File.expand_path(f) == __FILE__) ||
23
- f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
24
- end
25
- end
26
- spec.bindir = "exe"
27
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
29
-
30
- # Uncomment to register a new dependency of your gem
31
- # spec.add_dependency "example-gem", "~> 1.0"
32
-
33
- # For more information and examples about making a new gem, check out our
34
- # guide at: https://bundler.io/guides/creating_gem.html
35
- end
@@ -1,6 +0,0 @@
1
- module MissionControl
2
- module Web
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
- end
6
- end