makandra dev

...despite syntax error could look like this: cucumber: # ... script: - main_cucumber_run_passed=true - bundle exec rake "knapsack:cucumber[--strict --tags 'not @real-stripe-requests' -f progress -f rerun -o...

...cucumber_run_passed =~ false ]]; then (echo -e "\033[0;33mRerunning failed tests:\033[0m"; bundle exec cucumber @tmp/failing_features.txt --strict --tags "not @real-stripe-requests" -f pretty -f junit -o tmp/artifacts/reports...

...the failing features as argument for `geordi cucumber` geordi cucumber `cat tmp/parallel_cucumber_failures.log` Without geordi bundle exec cucumber @tmp/parallel_cucumber_failures.log or # Run the `cucumber profile` command bundle exec cucumber -p rerun

...additional Rake tasks. Unfortunately when whenever register a runner command, it doesn't use bundle exec in the resulting crontab. This gets you errors like this: `gem_original_require': no...

...such file to load -- bundler/setup (LoadError) You can work around this by putting this on the top of your config/schedule.rb: job_type :runner, "cd :path && bundle exec rails runner -e...

...colleagues don't have a big overhead with merge conflicts. Get all existing offenses bundle exec rubocop --parallel --format offenses 541/541 files 383 Layout/ArrayAlignment 352 Layout/ArgumentAlignment -- 735 Total Initially exclude...

...config/ext/rspec.yml - config/ext/rails.yml # 383 Layout/ArrayAlignment: Enabled: false # 352 Layout/ArgumentAlignment: Enabled: false You can also run bundle exec rubocop --auto-gen-config to create a file that excludes all current violations.

...active_support/continuous_integration" ActiveSupport::ContinuousIntegration.run do step "Setup", "bin/setup --skip-server" step "Security: Rubygems audit", "bundle", "audit" step "Security: NPM audit", "npm", "audit" step "Security: Importmap vulnerability audit", "bin/importmap", "audit"

...as NPM packages provided by Fontsource. We recommend using those instead of downloading and bundling font files yourself. (See below for a list of benefits.) Usage Go to fontsource.org and...

...your repo, just a few lines of text to package.json and your CSS. Your bundler will still package all font files, even unneeded ones, but that consumes only disk space...

...with a seed output of 20689: CI_NODE_INDEX=2 CI_NODE_TOTAL=8 bundle exec rake "knapsack:rspec[--seed=20689]" Note: the environment variable CI_NODE_INDEX starts at...

...both sections Report specs + Leftover specs in rspec 3/8 and run them with e.g. bundle exec --seed=20689 spec/models/user_spec.rb spec/models/post_spec.rb...

makandracards.com

git bisect good abcdef1234 Now tell git what to do git bisect run bundle exec cucumber features/my.feature:42 Wait for the results to come in: Git will bisect until...

...inside the tasks or scripts folder. Example for a task: The slim task lib/tasks/gitlab.rb: # bundle exec rake gitlab:user_export namespace :gitlab do desc 'Export all users as XSLX'

end end end Example for a script: The slim ruby script: lib/scripts/user_export.rb: # bundle exec rails runner -e development lib/scripts/user_export.rb Gitlab::UserExport.new.export The main code lib/scripts/gitlab/user_export.rb: module Gitlab

...below is taken from the excid3/esbuild-rails package. Let's say we have an application.js bundle that imports jQuery, sets window.$ and then imports code that uses the global $() function: // application.js...

...for: some-app_staging 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging bundle exec rake some-task' # End Whenever generated tasks for: some-app_staging Bad

...generated tasks for: /var/www/some-app_staging/releases/20201215171150 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging bundle exec rake some-task' # End Whenever generated tasks for: /var/www/some-app_staging/releases/20201215171150 # Begin Whenever generated tasks for...

...require and export directives with function calls to a Webpack-provided module registry. Webpack bundles everything into a single large file UglifyJS compresses the output by removing comments, renaming local...

}] ] } UglifyJS also has compatibility settings Once Babel and Webpack is done, the resulting bundle is run through UglifyJS to remove comments, shorten variable names, etc. This results in a...

Install rails-erd following the steps in their installation instructions. Run bundle exec rake erd Open erd.pdf Generating an ERD for only some models of a Rails...

...test the cron output like this (no changes will be made to your crontab): bundle exec whenever --set environment=staging bundle exec whenever --set environment=production Installing jobs only for...

...output like this (no changes will be made to your crontab): STAGE=customer1-staging bundle exec whenever STAGE=customer2-staging bundle exec whenever

...gem by adding this to the top of your Gemfile: gem 'i18n' Then run bundle install

...can use the method say_status. Statuses used by Rails are: say_status :run, 'bundle install' say_status :identical, :blue, 'some_file' say_status :remove, :green, 'some_file'

...to use cucumber_spinner if it is available in your Gemfile Runs Cucumber under bundle exec Uses an old version of Firefox for Selenium (Javascript) features if you setup your...

...all examples in spec if you don't give an argument Runs RSpec under bundle exec Runs examples in parallel if parallel_tests gem was found in you Gemfile

...contents on the fly (like some CSV). Add zip_tricks to your Gemfile and bundle install. In your controller, include ZipTricks::RailsStreaming. You can then use the zip_tricks_stream...

...streaming existing file attachments (from ActiveStorage, Carrierwave, etc.). Add zipline to your Gemfile and bundle install. In your controller, include Zipline. You can then use the zipline method in controller...

...Here is how to do that automatically. Add premailer-rails to your Gemfile and bundle. Done! premailer-rails will automatically generate a text part for you. Actually, you may want...

...set the variable KNAPSACK_GENERATE_REPORT to true like so: KNAPSACK_GENERATE_REPORT=true bundle exec rspec You can set in your .spec_heper file (or within the features/support/.. folder...

makandra dev

Defending Against NPM Supply Chain Attacks: A Practical Guide Ruby: Cooldown period for bundler and brakeman

...at the same time With a custom Capistrano task: CMD='zgrep -P "..." RAILS_ROOT/log/production.log' bundle exec cap production app:run_cmd See Capistrano 3: Running a command on all servers...

edgeapi.rubyonrails.org

...everyone on the project might need to re-recreate their test databases like so: bundle exec rails parallel:drop && bundle exec rails parallel:prepare

Unfortunately, this does not work properly in a multi-file environment, where a bundler like Webpack or esbuild requires individual files. While you could @import (or @use) another file...

...files, you need to stop concatenating files using the import and require of your bundler. Instead you must concatenate files using Sass' @import statement...