Compare commits

..

1 commit

Author SHA1 Message Date
5e6537c0e9
Crude datadog testing 2024-01-10 14:13:12 +01:00
3 changed files with 1 additions and 43 deletions

19
LICENSE
View file

@ -1,19 +0,0 @@
Copyright (c) 2020 Loic Nageleisen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -1,23 +0,0 @@
# minimal-rack
Minimal Rack-based apps for historical and toying purposes
This covers Rack, Rails, Sinatra, Grape, and possibly more Rack-based stuff in the future.
# Idea
Sometimes I want to toy around with specific versions of a framework on specific versions of Ruby or this or that web server, explore how versions behave, and Rack being Rack, what happens when you nest things and what you can and cannot nest.
Instead of hacking code for each version, manually changing Gemfiles back and forth, possibly using bad versions, or generating a thousand Rails apps, these profide a simple, compact, dynamic way to just get what I want and hack on the actual thing I want to learn about.
# Usage
* `compatibility` is a stupid YAML file with various version constraints.
* Native execution: `ruby {thing}.rb` serves `{thing}`. There is version resolution so `ruby rails.rb 7.0` gives you a Rails 7.0.something app, `ruby rails.rb 7.0.0` gives you exactly 7.0.0. There is server resolution too , so `ruby rails.rb 7.0 puma` serves with Puma.
* Docker execution: `rake:serve[rails]` gives you some rails, `:serve[rails:7.0]` gives you a Rails 7.0.something app like above, `rake:serve[rails,2.5]` gives you some rails version compatible with and running under ruby 2.5, give it `2.5-alpine` instead or add `musl` and it'll obey, and guess what you can shove `puma` or `thin` or whatever inside those brackets too.
* No bundler commands. There is bundler, but it's inline to dynamically describe deps, so, magic.
# Caveats
- There's a small issue with version selection vs how a thing version is specified in compatibility: if you say 'rails 7' it'll pick 7.1 but run with another compatibility match from a lesser version.
- There's no automatic web server picking (yet?), so it defaults to Thin but sometimes Thin doesn't work (e.g Rack 3)

View file

@ -193,7 +193,7 @@ class HelloController < action_controller_api_class
end end
end end
Datadog.configure do |c| Datadog.configuration do |c|
c.diagnostics.debug = ['true', '1'].include?(ENV['DD_DIAGNOSTICS']) c.diagnostics.debug = ['true', '1'].include?(ENV['DD_DIAGNOSTICS'])
c.tracing.enabled = true c.tracing.enabled = true
c.tracing.instrument :rack c.tracing.instrument :rack