...is probably \s. It matches the following whitespace characters: " " (space) \n (newline) \r (carriage return) \t (tab) \f (form feed/page break) However, in some cases these may not be good...

github.com

...option --ignore-app-not-running and due to that the command will exit with return code 0. With the next request to your application passenger will start your application based...

...def inline!(version) # It is recommended to watch for a feature flag, see below. return version unless Rails.config.feature_inline_email_images # `attachments` is provided by Rails, see the linked documentation...

attachments[version.url] end This helper expects a Carrierwave version as in input. It returns an object that represents the attachment and responds to the #url method. Mailer view:

...entire layout will probably also contain that text (in a descendant) and Capybara will return it. See Find the innermost DOM element that contains a given string. Footnotes

ruby-doc.org

...result.to_d(0) is the required precision parameter, which is applied to the BigDecimal return value. Using Rationals has some pitfalls you should be aware of: Multiplying a Rational with...

docs.ruby-lang.org

Furthermore, you can add a "modifier" to the percent notation to control the return type of the expression: %s Symbol %i Array of Symbols %q String

if [ $count -eq 0 ]; then echo "No files created or found to copy." return 1 fi printf "$uri_list" | head -c -1 | xclip -selection clipboard -t text/uri-list echo "📋 Copied...

makandra dev

...offense for rule "space-before-blocks" [#180343876] Fix ESLint offense for rule "no-useless-return" [#180343876] Add ESLint without any offenses

...rescue ActionController::ParameterMissing {} end def note_scope # Restrict what the user may access by returning a scope with conditions. Note.all end def load_notes @notes ||= note_scope .strict_loading # Raise...

...preloaded will raise an ActiveRecord::StrictLoadingViolationError. There is a private method #note_params that returns a permitted attributes hash that can be set through the #update and #create actions.

Ruby's __FILE__ keyword returns the path to the current file. On popular for this are Ruby binaries: #!/usr/bin/env ruby $LOAD_PATH << File.expand_path('../../lib', __FILE__) require 'my_cli'

Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...

...it will wait for any beforeunload to be handled before e.g. a page.refresh statement returns. That that this also applies to wrapped calls like accept_confirm { page.refresh }. Recommendation

...which's expected name is hard coded. A popular example is extension_allowlist, which returns an array of strings and let's you only upload files that have a filename...

...Project.find_each do |project| project.recalculate_statistics! end Both find_in_batches and find_each return records ordered by ID because they need to be able to iterate in batches. Modern...

digitalocean.com

...Yarn requires Node.js 4.0 or higher to be installed. Check if command -v "node" returns a path and you load NVM before Yarn. This could look like this:

...your browser window for 10 seconds. The reason is that evaluate_script will always return a result. The return value will be converted back to Ruby objects, which in case...

unpoly.com

...planner.js, tooltips.js // Simple boolean flag up.compiler('[date-picker]', (element) => { const picker = flatpickr(element, { /* config */ }) return () => picker.destroy() }) // With configuration data (via up-data) up.compiler('[planner]', (container, { type, view, icons }) => { window.Planner = new...

'fish' => nil, 'birds' => '1' } ] end let(:csv) { generate_csv(csv_data) } # This will return a CSV with one header row and four data rows

stackoverflow.com

...never create a new object in an implicit conversion method. This method should either return self or not be implemented at all. Obviously, this is the reason behind this recent...

...path(path, expires_at = 2.hours.from_now, allow_fuzzy_expiry: true, secret: Rails.application.secrets.url_signature_secret) return unless path uri = URI.parse(path) if allow_fuzzy_expiry expires_at = expires_at.end_of_hour...

To return non-HTML responses (like XLS spreadsheets), we usually use the respond_to do |format| format.xls do # send spreadsheet end end This is often, but not always the same...

...name is missing' end context 'when admin' do before { … } describe '#last_action' do it 'returns the last action performed by the user' it 'is nil for a new user'

...than calling other step definitions. Because you are using plain ruby, you can use return values, structured arguments (e.g. hash options), etc. I often have files like the session_steps.rb (below...

...order of test-writing and implementation is up to you. When you're done, return to writing the code. The specced thing now exists, so you can continue making that...