小编Jai*_*ari的帖子

Rails:Watir中的代理身份验证(Chrome驱动程序)

我试图在chrome运行在watir上的webdriver中添加代理身份验证,如下所示:

require 'watir'
proxies = ['--proxy-server=185.264.167.184:63109', '--proxy-auth=username:password']
browser = Watir::Browser.new :chrome, :switches => proxies
browser.goto(url)
Run Code Online (Sandbox Code Playgroud)

当浏览器运行时,仍然要求我输入用户名和密码,如下所示: 在此处输入图片说明

问题是如何在运行的chrome驱动程序中设置用户名和密码watir

selenium google-chrome ruby-on-rails watir selenium-chromedriver

5
推荐指数
1
解决办法
582
查看次数

Rails:使用 Gmail API 发送电子邮件,附件只返回编码文件,不返回

我正在尝试使用 gmail API 发送电子邮件。正如您在下面看到的,我的 Ruby 代码在没有附件的情况下运行良好:

client = google_client user_id
token = Token.find_by_user_id(user_id)
access_token = token.access_token
gmail = Google::Apis::GmailV1::GmailService.new
gmail.authorization = client
message              = Mail.new
message.date         = Time.now
message.subject      = 'Supertram p'
message.body         = "<p>Hi Alex, how's life?</p>"
message.content_type = 'text/html'
message.from         = self.email
message.to           = 'email_name@gmail.com'

msg = message.encoded
message_object = Google::Apis::GmailV1::Message.new(raw:message.to_s)
gmail.send_user_message('me', message_object)
Run Code Online (Sandbox Code Playgroud)

我能够以 html 格式成功发送电子邮件。我的问题是如何将文件附加到此消息?

client = google_client user_id
token = Token.find_by_user_id(user_id)
access_token = token.access_token
gmail = Google::Apis::GmailV1::GmailService.new
gmail.authorization = client
message              = Mail.new
message.date         = Time.now …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails google-api google-api-ruby-client gmail-api

5
推荐指数
1
解决办法
1197
查看次数

在 Docker 中使用私有 gitlab 模块构建 Go 应用程序

我正在尝试在 docker 文件上构建我的 go 应用程序。在我的 go.mod 中有一个需要身份验证/ssh 的私有包。这个问题类似于在 Docker 中使用私有模块构建 Go 应用程序,但就我而言,我必须从而gitlab不是从 中提取包github。这是我的 dockerfile:

# builder image
FROM golang:1.14.11-alpine AS builder

# specific directory for build process
WORKDIR /usr/src/build

# copying the source code 
# to the current working directory
COPY . .
RUN apk add --no-cache openssh-client
RUN apk add --no-cache git

# create ssh directory
RUN mkdir ~/.ssh
RUN touch ~/.ssh/known_hosts
RUN ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts

# allow private repo …
Run Code Online (Sandbox Code Playgroud)

git ssh go gitlab docker

5
推荐指数
2
解决办法
6891
查看次数

无法在sidekiq中添加新队列

嗨伙计们,我不能在sidekiq中添加新队列,有几个命令喜欢bundle exec sidekiq -q queue_name或通过rails控制台Sidekiq::Queue.new("queue_name")这两个命令仍然无法在redis中创建新队列.这里是sidekiq web UI sidekiq web ui图像,queue_name那些web ui中没有这样的队列,它的确意味着queue_name没有创建对吗?

我真的很喜欢sidekiq,任何人都可以帮助我错过哪些步骤?,注意:我没有使用文件配置来创建新队列sidekiq而只是命令.多谢你们

ruby ruby-on-rails redis sidekiq sidekiq-monitor

1
推荐指数
1
解决办法
1037
查看次数

如何使用 elixir 测量磁盘大小?

我新成elixirphoenix。我在erlang, 中找到了使用--diskup检查磁盘空间的方法。我在 elixir 中找到了另一个函数/语句来检查总内存使用情况:

> :erlang.memory(:total)
Run Code Online (Sandbox Code Playgroud)

我的问题是如何检查当前系统的磁盘大小/空间?

elixir erlang-otp

1
推荐指数
1
解决办法
290
查看次数