# certificate_authority
s.add_runtime_dependency("activemodel", ">= 3.0.6")
- s.add_runtime_dependency("activesupport", ">= 3.0.6")
end
$ruby_version = RUBY_VERSION.split('.').collect{ |i| i.to_i }.extend(Comparable)
# ensure leap_cli/lib/overrides has the highest priority
-# (these files override bad behavior in gems that overrides JSON)
$:.unshift(File.expand_path('../override',__FILE__))
require 'leap/platform'
# This trick only works if this directory is early in the
# include path.
#
-require 'json/pure'
+require 'json/pure'
\ No newline at end of file
+++ /dev/null
-#
-# activesupport/lib/core_ext/object/to_json.rb overrides to_json for
-# most core objects like so:
-#
-# [Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass].each do |klass|
-# klass.class_eval do
-# # Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
-# def to_json(options = nil)
-# ActiveSupport::JSON.encode(self, options)
-# end
-# end
-# end
-#
-# We cannot tolerate this. We need the normal to_json to be called, not
-# ActiveSupport's custom version.
-#
-# This file exists to override the behavior of ActiveSupport. This file will get included
-# instead of the normal to_json.rb.
-#
-
-require 'active_support/all'
-
module CertificateAuthority
class Certificate
include ActiveModel::Validations
self.distinguished_name = DistinguishedName.new
self.serial_number = SerialNumber.new
self.key_material = MemoryKeyMaterial.new
- self.not_before = Time.now.change(:min => 0).utc
- self.not_after = Time.now.change(:min => 0).utc + 1.year
+ self.not_before = Time.now
+ self.not_after = Time.now + 60 * 60 * 24 * 365 # One year
self.parent = self
self.extensions = load_extensions()
return obj if value.nil?
obj.critical = critical
value.split("\n").each do |v|
- if v.starts_with?("OCSP")
+ if v =~ /^OCSP/
obj.ocsp << v.split.last
end
- if v.starts_with?("CA Issuers")
+ if v =~ /^CA Issuers/
obj.ca_issuers << v.split.last
end
end