Skip to main content

New answers tagged

1 vote

How to use existing chromium profile for ferrum?

I had to disable incognito mode and pass only user data directory path like this: OPTS = { incognito: false, browser_options: { 'user-data-dir' => '/tmp/chromium' } } Ferrum::Browser.new(...
Alex's user avatar
  • 13
Tooling
0 votes
0 replies
0 views

Automating repetitive tasks with Ruby and Selenium WebDriver

Updated. I think now it is clear what I want to do.
Shruikan's user avatar
Tooling
0 votes
0 replies
0 views

Automating repetitive tasks with Ruby and Selenium WebDriver

You need to spend more time thinking about what you want and present a better explanation to us. Right now we're having to guess on a lot of things. Window? What kind of window? Are you talking about ...
JeffC's user avatar
  • 26.6k
0 votes

Emulate Default Object#inspect Output?

how about this class Aaa def initialize ; @name='aaa' ; end def inspect ; 'foo' end end a = Aaa.new #=> foo just one line: Object.instance_method(:inspect).bind_call a #=> "#<Aaa:...
Toni Schilling's user avatar
Tooling
0 votes
0 replies
0 views

Automating repetitive tasks with Ruby and Selenium WebDriver

What kind of info? Previous question provides more accurate info How to post multiple serial numbers from file to a website EDIT: I updated my question
Shruikan's user avatar
Tooling
2 votes
0 replies
0 views

Automating repetitive tasks with Ruby and Selenium WebDriver

You need to provide WAY more info if you want a reasonable answer.
JeffC's user avatar
  • 26.6k
0 votes

difference between calling super and calling super()

When we call super without parentheses, it automatically passes all arguments from the child method to the parent method. When we call super(), it invokes the parent method without passing any ...
Abhishek Tanwar's user avatar
Advice
0 votes
0 replies
0 views

Remove un-numbered lines from vscode

Found solution do not know if only one or correct one. Had tried searching setting for line and space and changing setting with no result. Watched video where there searched for height (not same ...
user3285799's user avatar
2 votes
Accepted

Convert a string to only have regular alphabet characters, from any language

Don’t try to define a Unicode “cutoff.” Instead, sanitize and rebuild the boolean query before sending it to MySQL. In Rails: Normalize Unicode (so weird presentation characters don’t break parsing). ...
Adelino Silva's user avatar
0 votes

How to mass create with smarter_csv for an API - Ruby on Rails

Mass importing data into your DB table is very easy with SmarterCSV: def upload seller_id = @current_user.sellers.first.id options = { chunk_size: 1000 } SmarterCSV.process(params[:file]....
Tilo's user avatar
  • 33.8k
0 votes

RSpec Cannot find my Controllers Uninitialized Constant

another response from the future just add the following to your controller RSpec.configure { |c| c.before { expect(controller).not_to be_nil } }
timjini's user avatar
  • 199
5 votes
Accepted

Regex Named Capture Group also Include Complete String

Just wrap the whole thing (apart from the anchoring at the beginning and end) into an additional (?<foo>(...): ^(?<foo>(?<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (?<s_ip>\d{1,...
C3roe's user avatar
  • 98.1k
Advice
1 vote
0 replies
0 views

New DataTypes For Ruby

I suggest creating a gem first. What kind of data types are you thinking about, would you mind elaborating?
spickermann's user avatar
Advice
0 votes
0 replies
0 views

Remove un-numbered lines from vscode

Same file 40 lines Notepad++ and 6 in Vs Code both snapshots same physical size. Am working in a Laptop so very little screen space to start with. The comment was made "I don't like that VSCode ...
user3285799's user avatar
Advice
0 votes
0 replies
0 views

New DataTypes For Ruby

There is information about how contribute on the Ruby website.
Matt Kantor's user avatar
  • 3,451
Advice
0 votes
0 replies
0 views

Remove un-numbered lines from vscode

Haha, the questions was up for 13 hours, yet within 3 minutes you and me both decided to post a comment asking fro a screenshot.
MindSwipe's user avatar
  • 8,072
Advice
2 votes
0 replies
0 views

Remove un-numbered lines from vscode

This might be one of those rare cases where a screenshot would help.
Stefan's user avatar
  • 115k
4 votes

Rails 8.0.4 app build from scratch test ("bin/rails test") gives wrong number of arguments in line_filtering.rb

Ruby on Rails 8.0 is not compatible with Minitest 6.0 (see this bug report). You have to either downgrade Minitest to 5.1 or do update Ruby on Rails to 8.1. Both can be done be setting the desired ...
spickermann's user avatar
Advice
0 votes
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

Yes that was more or less my question. But I realize that I didn't understand correctly that there was no "module isolation" in ruby (if that terminology makes sense)
Quentin's user avatar
  • 1,173
Advice
1 vote
0 replies
0 views

Remove un-numbered lines from vscode

All lines are numbered if you choose to number them. If you see not actual lines without numbers, it can be the space used by VSCode to show some code statistics, number of references, and the like. ...
Sergey A Kryukov's user avatar
0 votes

ROR action-text. How to add text-align options to trix rich-text editor?

Text align in Trix is trix-y (🙄) Digging into this I found a solution that works well. This article by Konnor Rogers lays out the basics, but I still had trouble in the edit-after-save. In the end, ...
Palmtree's user avatar
0 votes

Rails: Why do I get "warning: already initialized constant JSON::VERSION" when running rake cucumber?

For Mr. EdgeCase, If none of the above solutions worked for you, try what worked for me by visiting the actual file those warnings are referencing. Once inside the file, find the lines referenced ...
Tony Moritz's user avatar
1 vote
Accepted

Ruby on Rails Redis connection_pool wrong number of arguments (given 1, expected 0)

If you don't want to downgrade your connection_pool gem (and sidekiq) you can do this instead, just use the pool: false: config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'], pool: false }
Bruno Casali's user avatar
  • 1,415
3 votes
Accepted

Negative Unix timestamp in Ruby

Is there any way to know when a negative unix timestamp will be too old to reliably represent? There is non reliable way. It depends on how the particular platform chooses to represent the timestamp, ...
Jörg W Mittag's user avatar
Advice
0 votes
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

Could you clarify the question? Are you asking how Jekyll is available without calling require "xxx" where xxx is wherever the Jekyll is defined and where its declarding Jekyll.logger ?
Greg's user avatar
  • 6,801
Advice
0 votes
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

require simply runs the file. That's literally all it does. People have a tendency to make it sound a lot more complicated than it needs to be. If you want isolation, you need Refinements.
Jörg W Mittag's user avatar
0 votes

How to split a string in half, into two variables, in one statement?

how about this: class String def split_at(i) return [self[0...i], self[i..-1]] end def split_by(r) return [self] unless m = r.match(self) return [ m.pre_match, m[0], m.post_match ] ...
Toni Schilling's user avatar
Advice
0 votes
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

Indeed, I think I didn't understand that there was no scope isolation between ruby files. I thought require was mandatory in each file to bring things into scope
Quentin's user avatar
  • 1,173
Advice
1 vote
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

I admit I am too lazy to look up how Jekyll does it (it's open source, so you can do that yourself if you want), but building something that does the same thing is not rocket science: #!/usr/bin/env ...
Jörg W Mittag's user avatar
Advice
1 vote
0 replies
0 views

Why are things magically available in the current scope in a ruby script in Jekyll?

It sets the value during initialization? I’m not 100% sure I understand the confusion—think of it as “not needing globals. or window., and code runs during initialization. Same thing happens in JS ...
Dave Newton's user avatar
0 votes

VScode, WSL, Ruby, Files Being Marked as Changed on Commit

I've faced this problem before. The common issue is due to the OS Terminal detecting the file permissions or the file line endings as file content changes These are the common solutions (copied from ...
Chemah's user avatar
  • 658
0 votes

Ruby aws-sdk - timeout error

Made the following changes to our AWS initializer for the aws-sdk-s3 gem: Aws.config.update( # Other configurations like `region` and `credentials`. http_idle_timeout: 60, # Seconds a persistent ...
Joshua Pinter's user avatar
0 votes

Ruby SSL_connect certificate verify failed: unable to get certificate CRL on macOS

There's OpenSSL 3.6.1 now, and building Ruby with that version worked for me.
Jum's user avatar
  • 11

Top 50 recent answers are included