From efcf0e5927055d2b86804c84b00c614b38191964 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 8 Oct 2012 10:45:27 +0200 Subject: enabling rake gem in engines, using LeapWeb::Version all over the place --- lib/leap_web/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/leap_web/version.rb b/lib/leap_web/version.rb index ef81e43..bac8655 100644 --- a/lib/leap_web/version.rb +++ b/lib/leap_web/version.rb @@ -1,3 +1,3 @@ module LeapWeb - VERSION = "0.0.1" + VERSION = "0.1.0" end -- cgit v1.2.3 From 7eb16bf58d4a2cc7e7fae2b9ffe015de8ee199e8 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 8 Oct 2012 10:46:04 +0200 Subject: rake tasks for building all gems in one go --- lib/tasks/gems.rake | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/tasks/gems.rake (limited to 'lib') diff --git a/lib/tasks/gems.rake b/lib/tasks/gems.rake new file mode 100644 index 0000000..e185d1b --- /dev/null +++ b/lib/tasks/gems.rake @@ -0,0 +1,40 @@ +namespace :gem do + + engines = %w(core users certs help) + version = File.read(File.expand_path("../../../version", __FILE__)).strip + + desc "run rake gem for all gems" + task :build do + engines.each do |gem_name| + puts "########################### #{gem_name} #########################" + cmd = "rm -rf #{gem_name}/pkg"; puts cmd; system cmd + cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd + end + cmd = "rm -rf pkg"; puts cmd; system cmd + cmd = "bundle exec rake gem"; puts cmd; system cmd + end + + desc "run gem install for all gems" + task :install do + + engines.each do |gem_name| + puts "########################### #{gem_name} #########################" + cmd = "rm #{gem_name}/pkg"; puts cmd; system cmd + cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd + cmd = "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd + end + cmd = "rm -rf pkg"; puts cmd; system cmd + cmd = "bundle exec rake gem"; puts cmd; system cmd + cmd = "gem install pkg/leap_web-#{version}.gem"; puts cmd; system cmd + end + + desc "Release all gems to gemcutter. Package leap web components, then push" + task :release do + + engines.each do |gem_name| + puts "########################### #{gem_name} #########################" + cmd = "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd + end + cmd = "gem push pkg/leap_web-#{version}.gem"; puts cmd; system cmd + end +end -- cgit v1.2.3 From 51bc4cf65133982e9cf197bcf07aed3efce3d6dc Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 8 Oct 2012 11:27:19 +0200 Subject: cleaned up the gemspecs a bit - now all build --- lib/tasks/gems.rake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/tasks/gems.rake b/lib/tasks/gems.rake index e185d1b..cfeca1f 100644 --- a/lib/tasks/gems.rake +++ b/lib/tasks/gems.rake @@ -1,7 +1,8 @@ +require File.expand_path('../../../lib/leap_web/version', __FILE__) + namespace :gem do engines = %w(core users certs help) - version = File.read(File.expand_path("../../../version", __FILE__)).strip desc "run rake gem for all gems" task :build do @@ -19,13 +20,13 @@ namespace :gem do engines.each do |gem_name| puts "########################### #{gem_name} #########################" - cmd = "rm #{gem_name}/pkg"; puts cmd; system cmd + cmd = "rm -rf #{gem_name}/pkg"; puts cmd; system cmd cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd - cmd = "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd + cmd = "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd end cmd = "rm -rf pkg"; puts cmd; system cmd cmd = "bundle exec rake gem"; puts cmd; system cmd - cmd = "gem install pkg/leap_web-#{version}.gem"; puts cmd; system cmd + cmd = "gem install pkg/leap_web-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd end desc "Release all gems to gemcutter. Package leap web components, then push" @@ -33,8 +34,8 @@ namespace :gem do engines.each do |gem_name| puts "########################### #{gem_name} #########################" - cmd = "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{version}.gem"; puts cmd; system cmd + cmd = "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd end - cmd = "gem push pkg/leap_web-#{version}.gem"; puts cmd; system cmd + cmd = "gem push pkg/leap_web-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd end end -- cgit v1.2.3 From a00a0475515fc1576d88e2c9bcc99e844726d37d Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 8 Oct 2012 12:58:55 +0200 Subject: refactoring gem task --- lib/tasks/gems.rake | 45 ++++++++++++++++++++++----------------------- lib/tasks/task_helper.rb | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 lib/tasks/task_helper.rb (limited to 'lib') diff --git a/lib/tasks/gems.rake b/lib/tasks/gems.rake index cfeca1f..27eb04c 100644 --- a/lib/tasks/gems.rake +++ b/lib/tasks/gems.rake @@ -1,41 +1,40 @@ -require File.expand_path('../../../lib/leap_web/version', __FILE__) +require File.expand_path('../task_helper', __FILE__) +include TaskHelper -namespace :gem do - engines = %w(core users certs help) +namespace :gem do desc "run rake gem for all gems" - task :build do - engines.each do |gem_name| - puts "########################### #{gem_name} #########################" - cmd = "rm -rf #{gem_name}/pkg"; puts cmd; system cmd - cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd + task :build => :clear do + each_gem do |gem_name| + putsys "cd #{gem_name} && bundle exec rake gem" + end + putsys "bundle exec rake gem" + end + + desc "run rake gem for all gems" + task :clear do + each_gem do |gem_name| + putsys "rm -rf #{gem_name}/pkg" end - cmd = "rm -rf pkg"; puts cmd; system cmd - cmd = "bundle exec rake gem"; puts cmd; system cmd + putsys "rm -rf pkg" end desc "run gem install for all gems" - task :install do + task :install => :build do - engines.each do |gem_name| - puts "########################### #{gem_name} #########################" - cmd = "rm -rf #{gem_name}/pkg"; puts cmd; system cmd - cmd = "cd #{gem_name} && bundle exec rake gem"; puts cmd; system cmd - cmd = "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd + each_gem do |gem_name| + putsys "cd #{gem_name}/pkg && gem install leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem" end - cmd = "rm -rf pkg"; puts cmd; system cmd - cmd = "bundle exec rake gem"; puts cmd; system cmd - cmd = "gem install pkg/leap_web-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd + putsys "gem install pkg/leap_web-#{LeapWeb::VERSION}.gem" end desc "Release all gems to gemcutter. Package leap web components, then push" task :release do - engines.each do |gem_name| - puts "########################### #{gem_name} #########################" - cmd = "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd + each_gem do |gem_name| + putsys "cd #{gem_name}/pkg && gem push leap_web_#{gem_name}-#{LeapWeb::VERSION}.gem" end - cmd = "gem push pkg/leap_web-#{LeapWeb::VERSION}.gem"; puts cmd; system cmd + putsys "gem push pkg/leap_web-#{LeapWeb::VERSION}.gem" end end diff --git a/lib/tasks/task_helper.rb b/lib/tasks/task_helper.rb new file mode 100644 index 0000000..aa37698 --- /dev/null +++ b/lib/tasks/task_helper.rb @@ -0,0 +1,19 @@ +require File.expand_path('../../../lib/leap_web/version', __FILE__) + +module TaskHelper + + ENGINES = %w(core users certs help) + + def putsys(cmd) + puts cmd + system cmd + end + + def each_gem + ENGINES.each do |gem_name| + puts "########################### #{gem_name} #########################" + yield gem_name + end + end +end + -- cgit v1.2.3 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 --- lib/tasks/task_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tasks/task_helper.rb b/lib/tasks/task_helper.rb index aa37698..26e60bc 100644 --- a/lib/tasks/task_helper.rb +++ b/lib/tasks/task_helper.rb @@ -2,7 +2,7 @@ require File.expand_path('../../../lib/leap_web/version', __FILE__) module TaskHelper - ENGINES = %w(core users certs help) + ENGINES = %w(users certs help) def putsys(cmd) puts cmd -- cgit v1.2.3 From 74fae0787ff98c16fe60f89aa9f789e4e699143f Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 12:42:56 +0200 Subject: proper description for clear task --- lib/tasks/gems.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tasks/gems.rake b/lib/tasks/gems.rake index 27eb04c..8120235 100644 --- a/lib/tasks/gems.rake +++ b/lib/tasks/gems.rake @@ -12,7 +12,7 @@ namespace :gem do putsys "bundle exec rake gem" end - desc "run rake gem for all gems" + desc "clear pkg directory for all gems" task :clear do each_gem do |gem_name| putsys "rm -rf #{gem_name}/pkg" -- cgit v1.2.3 From 69d92d0f4577ccacadce6e8f4b8dc80b5f696777 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 12:43:30 +0200 Subject: test tasks for all engines replacing rails standard tests --- lib/tasks/test.rake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/tasks/test.rake (limited to 'lib') diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake new file mode 100644 index 0000000..3c87b45 --- /dev/null +++ b/lib/tasks/test.rake @@ -0,0 +1,18 @@ +namespace :test do + + Rails::SubTestTask.new(:units => "test:prepare") do |t| + t.libs << "test" + t.pattern = '*/test/unit/**/*_test.rb' + end + + Rails::SubTestTask.new(:functionals => "test:prepare") do |t| + t.libs << "test" + t.pattern = '*/test/functional/**/*_test.rb' + end + + Rails::SubTestTask.new(:integration => "test:prepare") do |t| + t.libs << "test" + t.pattern = '*/test/integration/**/*_test.rb' + end + +end -- cgit v1.2.3 From 689c2831680ece3ec8e1cceb45933f9b501b5734 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 12:43:55 +0200 Subject: get rid of already defined VERSION warnings --- lib/leap_web/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/leap_web/version.rb b/lib/leap_web/version.rb index bac8655..6a74082 100644 --- a/lib/leap_web/version.rb +++ b/lib/leap_web/version.rb @@ -1,3 +1,3 @@ module LeapWeb - VERSION = "0.1.0" + VERSION = "0.1.0" unless defined?(LeapWeb::VERSION) end -- cgit v1.2.3