From 00b7b36516d1d07300870029ad5190f06122a493 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 10 Oct 2012 19:56:35 +0200 Subject: first steps at reducing core --- certs/Gemfile | 12 +++--------- certs/leap_web_certs.gemspec | 3 --- certs/lib/leap_web_certs.rb | 1 + certs/lib/leap_web_certs/engine.rb | 3 --- certs/lib/leap_web_certs/version.rb | 3 --- 5 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 certs/lib/leap_web_certs/version.rb (limited to 'certs') diff --git a/certs/Gemfile b/certs/Gemfile index 9028024..ab2aa7a 100644 --- a/certs/Gemfile +++ b/certs/Gemfile @@ -1,17 +1,11 @@ source "http://rubygems.org" -# Declare your gem's dependencies in leap_web_certs.gemspec. +eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb')) + +# 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/leap_web_certs.gemspec b/certs/leap_web_certs.gemspec index 14708df..15a45be 100644 --- a/certs/leap_web_certs.gemspec +++ b/certs/leap_web_certs.gemspec @@ -15,9 +15,6 @@ Gem::Specification.new do |s| 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", LeapWeb::VERSION - - s.add_development_dependency "mocha" end diff --git a/certs/lib/leap_web_certs.rb b/certs/lib/leap_web_certs.rb index beb683d..129d1a9 100644 --- a/certs/lib/leap_web_certs.rb +++ b/certs/lib/leap_web_certs.rb @@ -1,3 +1,4 @@ +require "leap_web_core" require "leap_web_certs/engine" module LeapWebCerts diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb index 7dbc572..33a446e 100644 --- a/certs/lib/leap_web_certs/engine.rb +++ b/certs/lib/leap_web_certs/engine.rb @@ -1,6 +1,3 @@ -# thou shall require all your dependencies in an engine. -require "leap_web_core" - module LeapWebCerts class Engine < ::Rails::Engine 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 -- cgit v1.2.3 From add8d015c87a00626b739080bd75c7e7aeb9c1df Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 10:22:34 +0200 Subject: moved core dependency into */Gemfile with :path In order to get the rails generators and the like to work properly in engines we need to require all the dependencies in the engine.rb file. Since I want to keep that list of engines in a centralized place we still need core and we need to require it from the other engines. We don't want to require the core gem to be installed so I added it with :path option to the Gemfile. --- certs/Gemfile | 3 +++ certs/lib/leap_web_certs.rb | 1 - certs/lib/leap_web_certs/engine.rb | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'certs') diff --git a/certs/Gemfile b/certs/Gemfile index ab2aa7a..951d1b7 100644 --- a/certs/Gemfile +++ b/certs/Gemfile @@ -2,6 +2,9 @@ source "http://rubygems.org" 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. diff --git a/certs/lib/leap_web_certs.rb b/certs/lib/leap_web_certs.rb index 129d1a9..beb683d 100644 --- a/certs/lib/leap_web_certs.rb +++ b/certs/lib/leap_web_certs.rb @@ -1,4 +1,3 @@ -require "leap_web_core" require "leap_web_certs/engine" module LeapWebCerts diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb index 33a446e..3c8948a 100644 --- a/certs/lib/leap_web_certs/engine.rb +++ b/certs/lib/leap_web_certs/engine.rb @@ -1,3 +1,5 @@ +require "leap_web_core" + module LeapWebCerts class Engine < ::Rails::Engine -- cgit v1.2.3 From bde15d4ec416c1c6c99c7ea8bad9d8ed5aca128d Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 11:45:16 +0200 Subject: fixed cert tests - adding test data and not testing the inline cert download filename --- certs/test/functional/certs_controller_test.rb | 1 - certs/test/unit/cert_test.rb | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'certs') 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/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 -- cgit v1.2.3