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