小编Jam*_*rne的帖子

如何配置Cucumber/Aruba使用SimpleCov?

Ruby-2.0.0p247 ActiveRecord-4.0.1 Cucumber 1.3.10 Aruba-0.5.3 SimpleCove-0.8.2

我们在NON-RAILS项目中使用Cucumber和Aruba,但仍使用ActiveRecord.我们的黄瓜功能可以在进程内和进程外执行代码.使用与生产中相同的加载程序序列通过bin中的启动存根执行进程外代码:

#!/usr/bin/env ruby
require 'bundler/setup'
Bundler.require

require 'pathname'
my_dir = Pathname.new(
  File.join( File.dirname(
    __FILE__ ), '../', 'lib/' ) ).realpath.to_s + '/'

require my_dir +  File.basename( __FILE__ )

HllThForexRssFetch::Main.new( ARGV ).execute
#EOF
Run Code Online (Sandbox Code Playgroud)

我们的features/support/env.rb文件包含以下内容:

$ cat features/support/env.rb
# Must load and start simplecov before any application code
require 'simplecov'
SimpleCov.start do
  add_filter "/features/"
  add_filter "/libexec"
  add_filter "/lib/hll_active_record/"
  add_filter "/test/"
  add_filter "/tmp/"
end
SimpleCov.command_name( "Cucumber Features" )

# Do not use cucumber/rails in standalone projects
#require 'cucumber/rails' …
Run Code Online (Sandbox Code Playgroud)

ruby cucumber aruba simplecov

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

仅从 openssl pem 文件中获取证书部分

我有一个 PEM 格式证书,其中包含 ASCII/UTF-8 文本中的所有标头。我只想输出证书本身。换句话说,介于以下之间并包括在内的部分:

-----BEGIN CERTIFICATE-----
Run Code Online (Sandbox Code Playgroud)

-----END CERTIFICATE-----
Run Code Online (Sandbox Code Playgroud)

我可以通过简单地从源 pem 文件中剪切和粘贴来做到这一点。但是,我想使用 OpenSSL 来做到这一点。我已经查看了各种-text -certopt X但没有尝试过的仅提供证书部分的内容。

有没有办法使用 OpenSSL 只输出编码的证书?它是如何完成的?

openssl certificate x509 pkix

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

LibreOffice Calc 将小时和分钟转换为小数,无需翻转

我有一个格式为 HH:MM 的时间值汇总列。总和的格式为 [HH]:MM,可防止 HH > 23 时翻转。我希望将此值转换为十进制数表示。例如:

       A        B
 1   12:25
 2   11:25
 3   03:25
 4   
 5   27:15    27.25
Run Code Online (Sandbox Code Playgroud)

A5 的格式为[HH]:MM,B5 包含 '=A5' 格式为0.00. 但是,这会产生 3.25 而不是 27.25 的 mod 24 结果。我似乎找不到任何格式化单元格 B5 的方法来显示 A5 的实际十进制小时数。

libreoffice-calc

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

Rails4 ActiveRecord has_one:条件键被删除

我正在将RoR3.2应用程序转换为v4.2.在某些模型中,我们有这样的结构:

  # A correspondent can have only one currently active client role or
  # it may have none.
  has_one           :active_client,   :class_name => 'Client', 
                    :conditions => IsActiveRow
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

      Unknown key: :conditions. Valid keys are: :class_name, :class,
 :foreign_key, :validate, :autosave, :dependent, :primary_key,
 :inverse_of, :required, :as, :foreign_type
 (ActionView::Template::Error)
Run Code Online (Sandbox Code Playgroud)

这是在这里提出的:

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support
/core_ext/hash/keys.rb:75:in `block in assert_valid_keys'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support
/core_ext/hash/keys.rb:73:in `each_key'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support
/core_ext/hash/keys.rb:73:in `assert_valid_keys'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activerecord-4.2.0/lib
/active_record/associations/builder/association.rb:82:in `validate_options'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activerecord-4.2.0/lib
/active_record/associations/builder/association.rb:62:in `initialize'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activerecord-4.2.0/lib
/active_record/associations/builder/association.rb:47:in `new'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record
/associations/builder/association.rb:47:in `create_builder'

      /home/byrnejb/Projects/Software/theHeart/code/proforma/libexec
/bundle/lib/ruby/2.2.0/gems/activerecord-4.2.0/lib
/active_record/associations/builder/association.rb:35:in `build' …
Run Code Online (Sandbox Code Playgroud)

activerecord has-one ruby-on-rails-4

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