Class: RubyPackager::Tasks
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RubyPackager::Tasks
- Defined in:
- lib/ruby_packager.rb
Instance Attribute Summary collapse
-
#after_install_script ⇒ Object
Returns the value of attribute after_install_script.
-
#application_name ⇒ Object
readonly
Returns the value of attribute application_name.
-
#architecture ⇒ Object
Returns the value of attribute architecture.
-
#autoreq ⇒ Object
Returns the value of attribute autoreq.
-
#before_install_script ⇒ Object
Returns the value of attribute before_install_script.
-
#bundle_standalone ⇒ Object
Returns the value of attribute bundle_standalone.
-
#bundle_with_binstubs ⇒ Object
Returns the value of attribute bundle_with_binstubs.
-
#bundle_without ⇒ Object
Returns the value of attribute bundle_without.
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#description ⇒ Object
Returns the value of attribute description.
-
#epoch ⇒ Object
Returns the value of attribute epoch.
-
#install_path ⇒ Object
Returns the value of attribute install_path.
-
#iteration ⇒ Object
Returns the value of attribute iteration.
-
#links ⇒ Object
Returns the value of attribute links.
-
#package_name ⇒ Object
Returns the value of attribute package_name.
-
#rpm_group ⇒ Object
Returns the value of attribute rpm_group.
-
#rpm_os ⇒ Object
Returns the value of attribute rpm_os.
-
#rpm_user ⇒ Object
Returns the value of attribute rpm_user.
-
#staged_files ⇒ Object
readonly
Returns the value of attribute staged_files.
-
#vendorize ⇒ Object
Returns the value of attribute vendorize.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #default_links ⇒ Object
- #define_tasks ⇒ Object
- #filename ⇒ Object
- #generate(filename, &block) ⇒ Object
-
#initialize(application_name, prefix) ⇒ Tasks
constructor
A new instance of Tasks.
- #install(file_list, options = {}) ⇒ Object
- #install_link(src, target) ⇒ Object
- #install_rails_app_links ⇒ Object
- #install_rails_app_log_link ⇒ Object
- #install_rails_app_tmp_link ⇒ Object
Constructor Details
#initialize(application_name, prefix) ⇒ Tasks
Returns a new instance of Tasks.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_packager.rb', line 5 def initialize(application_name, prefix) @application_name = application_name @prefix = prefix @package_name = "#{@prefix}-#{application_name}" @version = '1.0' @dependencies = [] @autoreq = true @install_path = "opt/#{@prefix}/apps/#{application_name}" @links = {} @bundle_standalone = false @bundle_with_binstubs = false @bundle_without = ["development", "test"] @vendorize = true install(FileList["Gemfile*"]) if block_given? yield self define_tasks end end |
Instance Attribute Details
#after_install_script ⇒ Object
Returns the value of attribute after_install_script.
37 38 39 |
# File 'lib/ruby_packager.rb', line 37 def after_install_script @after_install_script end |
#application_name ⇒ Object (readonly)
Returns the value of attribute application_name.
25 26 27 |
# File 'lib/ruby_packager.rb', line 25 def application_name @application_name end |
#architecture ⇒ Object
Returns the value of attribute architecture.
38 39 40 |
# File 'lib/ruby_packager.rb', line 38 def architecture @architecture end |
#autoreq ⇒ Object
Returns the value of attribute autoreq.
33 34 35 |
# File 'lib/ruby_packager.rb', line 33 def autoreq @autoreq end |
#before_install_script ⇒ Object
Returns the value of attribute before_install_script.
36 37 38 |
# File 'lib/ruby_packager.rb', line 36 def before_install_script @before_install_script end |
#bundle_standalone ⇒ Object
Returns the value of attribute bundle_standalone.
39 40 41 |
# File 'lib/ruby_packager.rb', line 39 def bundle_standalone @bundle_standalone end |
#bundle_with_binstubs ⇒ Object
Returns the value of attribute bundle_with_binstubs.
40 41 42 |
# File 'lib/ruby_packager.rb', line 40 def bundle_with_binstubs @bundle_with_binstubs end |
#bundle_without ⇒ Object
Returns the value of attribute bundle_without.
41 42 43 |
# File 'lib/ruby_packager.rb', line 41 def bundle_without @bundle_without end |
#dependencies ⇒ Object
Returns the value of attribute dependencies.
32 33 34 |
# File 'lib/ruby_packager.rb', line 32 def dependencies @dependencies end |
#description ⇒ Object
Returns the value of attribute description.
42 43 44 |
# File 'lib/ruby_packager.rb', line 42 def description @description end |
#epoch ⇒ Object
Returns the value of attribute epoch.
31 32 33 |
# File 'lib/ruby_packager.rb', line 31 def epoch @epoch end |
#install_path ⇒ Object
Returns the value of attribute install_path.
34 35 36 |
# File 'lib/ruby_packager.rb', line 34 def install_path @install_path end |
#iteration ⇒ Object
Returns the value of attribute iteration.
30 31 32 |
# File 'lib/ruby_packager.rb', line 30 def iteration @iteration end |
#links ⇒ Object
Returns the value of attribute links.
35 36 37 |
# File 'lib/ruby_packager.rb', line 35 def links @links end |
#package_name ⇒ Object
Returns the value of attribute package_name.
28 29 30 |
# File 'lib/ruby_packager.rb', line 28 def package_name @package_name end |
#rpm_group ⇒ Object
Returns the value of attribute rpm_group.
46 47 48 |
# File 'lib/ruby_packager.rb', line 46 def rpm_group @rpm_group end |
#rpm_os ⇒ Object
Returns the value of attribute rpm_os.
43 44 45 |
# File 'lib/ruby_packager.rb', line 43 def rpm_os @rpm_os end |
#rpm_user ⇒ Object
Returns the value of attribute rpm_user.
45 46 47 |
# File 'lib/ruby_packager.rb', line 45 def rpm_user @rpm_user end |
#staged_files ⇒ Object (readonly)
Returns the value of attribute staged_files.
26 27 28 |
# File 'lib/ruby_packager.rb', line 26 def staged_files @staged_files end |
#vendorize ⇒ Object
Returns the value of attribute vendorize.
44 45 46 |
# File 'lib/ruby_packager.rb', line 44 def vendorize @vendorize end |
#version ⇒ Object
Returns the value of attribute version.
29 30 31 |
# File 'lib/ruby_packager.rb', line 29 def version @version end |
Instance Method Details
#default_links ⇒ Object
95 96 97 98 99 100 |
# File 'lib/ruby_packager.rb', line 95 def default_links { "log" => "/var/log/#{@prefix}/#{application_name}", "tmp" => "/var/tmp/#{application_name}" } end |
#define_tasks ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/ruby_packager.rb', line 71 def define_tasks define_show_config_task define_show_staging_list_task define_bundle_file_task define_stage_task define_rpm_task define_install_rpm_task define_clean_task end |
#filename ⇒ Object
81 82 83 84 85 |
# File 'lib/ruby_packager.rb', line 81 def filename full_version = "#{version}" full_version += "-#{iteration}" if iteration "pkg/#{package_name}-#{full_version}.x86_64.rpm" end |
#generate(filename, &block) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/ruby_packager.rb', line 87 def generate(filename, &block) target_file = staged_app(filename) file(target_file) do block.call(target_file) end @staged_files << target_file end |
#install(file_list, options = {}) ⇒ Object
48 49 50 51 52 |
# File 'lib/ruby_packager.rb', line 48 def install(file_list, = {}) @staged_files ||= [] prefix = [:prefix] ? staged_file_path([:prefix]) : staged_app @staged_files += map(file_list => prefix) end |
#install_link(src, target) ⇒ Object
67 68 69 |
# File 'lib/ruby_packager.rb', line 67 def install_link(src, target) @links[src] = target end |
#install_rails_app_links ⇒ Object
54 55 56 57 |
# File 'lib/ruby_packager.rb', line 54 def install_rails_app_links install_rails_app_log_link install_rails_app_tmp_link end |
#install_rails_app_log_link ⇒ Object
59 60 61 |
# File 'lib/ruby_packager.rb', line 59 def install_rails_app_log_link install_link("log", "/var/log/#{@prefix}/#{application_name}") end |
#install_rails_app_tmp_link ⇒ Object
63 64 65 |
# File 'lib/ruby_packager.rb', line 63 def install_rails_app_tmp_link install_link("tmp", "/var/tmp/#{application_name}") end |