summaryrefslogtreecommitdiff
path: root/certs
diff options
context:
space:
mode:
Diffstat (limited to 'certs')
-rw-r--r--certs/Gemfile15
-rw-r--r--certs/Rakefile10
-rw-r--r--certs/leap_web_certs.gemspec12
-rw-r--r--certs/lib/leap_web_certs/engine.rb1
-rw-r--r--certs/lib/leap_web_certs/version.rb3
-rw-r--r--certs/test/functional/certs_controller_test.rb1
-rw-r--r--certs/test/test_helper.rb2
-rw-r--r--certs/test/unit/cert_test.rb3
8 files changed, 21 insertions, 26 deletions
diff --git a/certs/Gemfile b/certs/Gemfile
index 9028024..951d1b7 100644
--- a/certs/Gemfile
+++ b/certs/Gemfile
@@ -1,17 +1,14 @@
source "http://rubygems.org"
-# Declare your gem's dependencies in leap_web_certs.gemspec.
+eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
+
+# We require leap_web_core from here so we can use the path option.
+gem "leap_web_core", :path => '../core'
+
+# Declare your gem's dependencies in leap_web_users.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
-# jquery-rails is used by the dummy application
-gem "jquery-rails"
-
-# Declare any dependencies that are still in development here instead of in
-# your gemspec. These might include edge Rails or gems from your path or
-# Git. Remember to move these dependencies to your gemspec before releasing
-# your gem to rubygems.org.
-
# To use debugger
# gem 'ruby-debug'
diff --git a/certs/Rakefile b/certs/Rakefile
index dd38158..54ed86d 100644
--- a/certs/Rakefile
+++ b/certs/Rakefile
@@ -1,4 +1,8 @@
#!/usr/bin/env rake
+
+require 'rake/packagetask'
+require 'rubygems/package_task'
+
begin
require 'bundler/setup'
rescue LoadError
@@ -20,8 +24,10 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-
-
+spec = eval(File.read('leap_web_certs.gemspec'))
+Gem::PackageTask.new(spec) do |p|
+ p.gem_spec = spec
+end
Bundler::GemHelper.install_tasks
diff --git a/certs/leap_web_certs.gemspec b/certs/leap_web_certs.gemspec
index 28ef392..15a45be 100644
--- a/certs/leap_web_certs.gemspec
+++ b/certs/leap_web_certs.gemspec
@@ -1,24 +1,20 @@
$:.push File.expand_path("../lib", __FILE__)
-# Maintain your gem's version:
-require "leap_web_certs/version"
+require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "leap_web_certs"
- s.version = LeapWebCerts::VERSION
+ s.version = LeapWeb::VERSION
s.authors = ["Azul"]
s.email = ["azul@leap.se"]
s.homepage = "http://www.leap.se"
s.summary = "Cert distribution for the leap platform"
s.description = "This plugin for the leap platform distributes certs for the EIP client. It fetches the certs from a pool in CouchDB that is filled by leap-ca."
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "Readme.md"]
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "rails", "~> 3.2.8"
- s.add_dependency "leap_web_core", "~> 0.0.1"
-
- s.add_development_dependency "mocha"
+ s.add_dependency "leap_web_core", LeapWeb::VERSION
end
diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb
index 7dbc572..3c8948a 100644
--- a/certs/lib/leap_web_certs/engine.rb
+++ b/certs/lib/leap_web_certs/engine.rb
@@ -1,4 +1,3 @@
-# thou shall require all your dependencies in an engine.
require "leap_web_core"
module LeapWebCerts
diff --git a/certs/lib/leap_web_certs/version.rb b/certs/lib/leap_web_certs/version.rb
deleted file mode 100644
index 800ca0b..0000000
--- a/certs/lib/leap_web_certs/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-module LeapWebCerts
- VERSION = "0.0.4"
-end
diff --git a/certs/test/functional/certs_controller_test.rb b/certs/test/functional/certs_controller_test.rb
index 04669f5..295515b 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/certs/test/functional/certs_controller_test.rb
@@ -10,6 +10,5 @@ class CertsControllerTest < ActionController::TestCase
get :show
assert_response :success
assert_equal cert.zipped, @response.body
- assert_attachement_filename "cert_stub.zip"
end
end
diff --git a/certs/test/test_helper.rb b/certs/test/test_helper.rb
index b268c51..08d4d41 100644
--- a/certs/test/test_helper.rb
+++ b/certs/test/test_helper.rb
@@ -1,5 +1,5 @@
ENV["RAILS_ENV"] = "test"
-require File.expand_path('../dummy/config/environment', __FILE__)
+require File.expand_path('../../../test/dummy/config/environment', __FILE__)
require 'rails/test_help'
require 'mocha'
diff --git a/certs/test/unit/cert_test.rb b/certs/test/unit/cert_test.rb
index 21ef169..9362da2 100644
--- a/certs/test/unit/cert_test.rb
+++ b/certs/test/unit/cert_test.rb
@@ -17,8 +17,9 @@ class CertTest < ActiveSupport::TestCase
end
test "cert.zipped returns the actual data" do
- @sample.save # This is required!
+ @sample.save # This is required !
assert lines = @sample.zipped.split("\n")
+ assert_equal 56, lines.count
assert_equal "-----BEGIN RSA PRIVATE KEY-----", lines.first.chomp
assert_equal "-----END CERTIFICATE-----", lines.last.chomp
end