Skip to content

Commit

Permalink
Merge pull request #1 from appfolio/skRenameEzCryptoGem
Browse files Browse the repository at this point in the history
Sk rename ez crypto gem
  • Loading branch information
Sebastian Kapfer authored May 31, 2019
2 parents 4f13fdd + 3953a13 commit a7a6816
Show file tree
Hide file tree
Showing 23 changed files with 224 additions and 669 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2.1
commands:
bundle_install_and_test:
steps:
- checkout
- run: bundle install
- run: bundle exec appraisal install
- run: bundle exec appraisal rake test

jobs:
test-ruby-253:
docker:
- image: circleci/ruby:2.5.3
steps:
- bundle_install_and_test

test-ruby-263:
docker:
- image: circleci/ruby:2.6.3
steps:
- bundle_install_and_test

workflows:
rc:
jobs:
- test-ruby-253:
context: appfolio_test_context
- test-ruby-263:
context: appfolio_test_context
26 changes: 23 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
doc
# Because this is a gem, ignore Gemfile.lock:

Gemfile.lock
gemfiles/*.gemfile.lock

# And because this is Ruby, ignore the following
# (source: https://github.com/github/gitignore/blob/master/Ruby.gitignore):

*.gem
*.rbc
.bundle
.config
lib/bundler/man
pkg
*.log
.DS_Store
log
rdoc
tmp

# YARD artifacts
.yardoc
_yardoc
doc/

.idea
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.6.3
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
case(RUBY_VERSION)
when '2.5.3', '2.6.3' then
appraise "ruby-#{RUBY_VERSION}_rails521" do
gem 'rails', '5.2.1'
end
else
raise "Unsupported Ruby version #{RUBY_VERSION}"
end
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'http://rubygems.org'

gemspec

source 'https://gemini.atl.appfolio.net' do
gem 'af_gems', '~> 7.1'
end

group :development, :test do
gem 'minitest', '~> 5.8'
end
24 changes: 24 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end

require 'af_gems/gem_tasks'
require 'af_gems/appraisal'

Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end

namespace :test do
AfGems::RubyAppraisalTask.new(:all, [ 'ruby-2.5.3', 'ruby-2.6.3'])
end

task :default => :test
142 changes: 77 additions & 65 deletions ezcrypto.gemspec
Original file line number Diff line number Diff line change
@@ -1,67 +1,79 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ezcrypto/version'

Gem::Specification.new do |s|
s.name = "ezcrypto"
s.version = "0.7.2"
s.date = "2009-3-10"
s.summary = "EzCrypto - Simplified Crypto Library"
s.email = "pelle@stakeventures.com"
s.homepage = "http://ezcrypto.rubyforge.org"
s.description = "EzCrypto is an easy to use wrapper around the poorly documented OpenSSL ruby library."
s.has_rdoc = true
s.authors = ["Pelle Braendgaard", "Micah Wedemeyer"]
s.files = [ "rakefile",
"README.rdoc",
"README_ACTIVE_CRYPTO",
"README_DIGITAL_SIGNATURES",
"MIT-LICENSE",
"CHANGELOG",
"init.rb",
"lib/active_crypto.rb",
"lib/ezcrypto.rb",
"lib/ezsig.rb",
"lib/trusted.pem",
"test/active_crypto_test.rb",
"test/association_key_holder_test.rb",
"test/database.yml",
"test/digest_test.rb",
"test/dsakey.pem",
"test/dsapubkey.pem",
"test/dsig_test.rb",
"test/encrypt_test.rb",
"test/ezcrypto_test.rb",
"test/key_holder_test.rb",
"test/protectedsigner.pem",
"test/sf_intermediate.crt",
"test/store",
"test/test_helper.rb",
"test/testchild.pem",
"test/testchild.req",
"test/testpub.pem",
"test/testsigner.cert",
"test/testsigner.pem",
"test/valicert_class2_root.crt",
"test/agree2.com.cert"]
s.extra_rdoc_files = ["CHANGELOG", "README.rdoc","README_ACTIVE_CRYPTO","README_DIGITAL_SIGNATURES"]
s.test_files = ["test/active_crypto_test.rb",
"test/association_key_holder_test.rb",
"test/database.yml",
"test/digest_test.rb",
"test/dsakey.pem",
"test/dsapubkey.pem",
"test/dsig_test.rb",
"test/encrypt_test.rb",
"test/ezcrypto_test.rb",
"test/key_holder_test.rb",
"test/protectedsigner.pem",
"test/sf_intermediate.crt",
"test/store",
"test/test_helper.rb",
"test/testchild.pem",
"test/testchild.req",
"test/testpub.pem",
"test/testsigner.cert",
"test/testsigner.pem",
"test/valicert_class2_root.crt",
"test/agree2.com.cert"]

s.name = 'ezcrypto'
s.version = EzCrypto::VERSION
s.summary = 'EzCrypto - Simplified Crypto Library'
s.email = 'pelle@stakeventures.com'
s.homepage = 'http://ezcrypto.rubyforge.org'
s.description = 'EzCrypto is an easy to use wrapper around the poorly documented OpenSSL ruby library.'
s.authors = ['Pelle Braendgaard', 'Micah Wedemeyer']
s.metadata['allowed_push_host'] = 'https://gemini.atl.appfolio.net'
s.files = %w[
rakefile
README.rdoc
README_ACTIVE_CRYPTO
README_DIGITAL_SIGNATURES
MIT-LICENSE
CHANGELOG
init.rb
lib/active_crypto.rb
lib/ezcrypto.rb
lib/ezsig.rb
lib/trusted.pem
test/active_crypto_test.rb
test/association_key_holder_test.rb
test/database.yml
test/digest_test.rb
test/dsakey.pem
test/dsapubkey.pem
test/dsig_test.rb
test/encrypt_test.rb
test/ezcrypto_test.rb
test/key_holder_test.rb
test/protectedsigner.pem
test/sf_intermediate.crt
test/store
test/test_helper.rb
test/testchild.pem
test/testchild.req
test/testpub.pem
test/testsigner.cert
test/testsigner.pem
test/valicert_class2_root.crt
test/agree2.com.cert
]
s.extra_rdoc_files = %w[
CHANGELOG
README.rdoc
README_ACTIVE_CRYPTO
README_DIGITAL_SIGNATURES
]
s.test_files = %w[
test/active_crypto_test.rb
test/association_key_holder_test.rb
test/database.yml
test/digest_test.rb
test/dsakey.pem
test/dsapubkey.pem
test/dsig_test.rb
test/encrypt_test.rb
test/ezcrypto_test.rb
test/key_holder_test.rb
test/protectedsigner.pem
test/sf_intermediate.crt
test/store
test/test_helper.rb
test/testchild.pem
test/testchild.req
test/testpub.pem
test/testsigner.cert
test/testsigner.pem
test/valicert_class2_root.crt
test/agree2.com.cert
]
end

15 changes: 15 additions & 0 deletions gemfiles/ruby_2.5.3_rails521.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "rails", "5.2.1"

group :development, :test do
gem "minitest", "~> 5.8"
end

source "https://gemini.atl.appfolio.net" do
gem "af_gems", "~> 7.1"
end

gemspec path: "../"
15 changes: 15 additions & 0 deletions gemfiles/ruby_2.6.3_rails521.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "rails", "5.2.1"

group :development, :test do
gem "minitest", "~> 5.8"
end

source "https://gemini.atl.appfolio.net" do
gem "af_gems", "~> 7.1"
end

gemspec path: "../"
1 change: 0 additions & 1 deletion init.rb

This file was deleted.

6 changes: 3 additions & 3 deletions lib/active_crypto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ module ActionController # :nodoc:
=end
def self.append_features(base) #:nodoc:
super
base.send :prepend_before_filter, :load_session_keys
base.send :prepend_after_filter, :save_session_keys
base.send :prepend_before_action, :load_session_keys
base.send :prepend_after_action, :save_session_keys
end

=begin rdoc
Expand Down Expand Up @@ -320,6 +320,6 @@ class MissingKeyError < RuntimeError
end
end
ActiveRecord::Base.send :include, ActiveCrypto
require 'actionpack'
require 'action_pack'
require 'action_controller'
ActionController::Base.send :include, ActiveCrypto::ActionController
6 changes: 3 additions & 3 deletions lib/ezcrypto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def self.calculate_key_size(algorithm)
size = 16
else
size = 16
end
end
end
end
if size.nil?
Expand Down Expand Up @@ -429,7 +429,7 @@ class CipherWrapper #:nodoc:
=end
def initialize(key,target,mode,algorithm)
@cipher = OpenSSL::Cipher::Cipher.new(algorithm)
@cipher = OpenSSL::Cipher.new(algorithm)
if mode
@cipher.encrypt
else
Expand Down Expand Up @@ -605,7 +605,7 @@ def self.hexdigest(data,size=40)
def self.digest64(data,size=16)
Base64.encode64(digest(data,size))
end
end
end

end

Expand Down
3 changes: 3 additions & 0 deletions lib/ezcrypto/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module EzCrypto
VERSION = '0.7.3-appfolio.1'.freeze
end
3 changes: 1 addition & 2 deletions lib/ezsig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def self.from_pkyp(digest)
def self.load_all_from_file(filename)
file = File.read( filename )
certs=[]
count=0
file.split( %q{-----BEGIN}).each do |pem|
if pem and pem!=""
pem="-----BEGIN#{pem}\n"
Expand Down Expand Up @@ -532,4 +531,4 @@ def verify(cert)
end
end
end
end
end
Loading

0 comments on commit a7a6816

Please sign in to comment.