Class: RailsPwnerer::Scaffolds::Config
- Inherits:
-
Object
- Object
- RailsPwnerer::Scaffolds::Config
- Includes:
- Base
- Defined in:
- lib/rails_pwnerer/scaffolds/config.rb
Overview
sets up the configuration repository
Class Method Summary collapse
-
.go ⇒ Object
standalone runner.
Instance Method Summary collapse
-
#run ⇒ Object
runner.
Methods included from Base
_setup_unix, _setup_windows, all_packages, all_packages_without_caching, #atomic_erase, #atomic_read, #atomic_write, #best_package_matching, #check_rails_root, #control_boot_script, #cpu_cores, #current_user, #gem_exists?, #gid_for_username, #group_for_username, #hook_boot_script, #install_gem, #install_gems, #install_package, #install_package_impl, #install_package_matching, #install_packages, #kill_tree, #os_distro, package_info_hash, #path_to_boot_script, #path_to_boot_script_defaults, #path_to_gemdir, #process_info, #prompt_user_for_password, #remove_package, #remove_packages, #search_packages, #uid_for_username, #unroll_collection, #update_all_packages, #update_all_packages_impl, #update_gems, #update_package_metadata, #upgrade_gem, #upgrade_gems, #upgrade_package, #upgrade_package_impl, #upgrade_packages, #with_package_source, #with_temp_dir
Class Method Details
.go ⇒ Object
standalone runner
36 37 38 |
# File 'lib/rails_pwnerer/scaffolds/config.rb', line 36 def self.go self.new.run end |
Instance Method Details
#run ⇒ Object
runner
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rails_pwnerer/scaffolds/config.rb', line 7 def run # paths paths_db = RailsPwnerer::Config.create_db :paths # the directory containing the nginx config files paths_db[:nginx_configs] = '/etc/nginx/sites-enabled' # the directory containing the ddclient configuration paths_db[:ddclient_config] = '/etc/ddclient.conf' RailsPwnerer::Config.flush_db :paths # host info host_info = RailsPwnerer::Config.create_db :host # the default instance name -- DNS names have dashes, but mySQL hates that host_info[:instance] = Socket.gethostname().split('.').first.gsub('-', '_') # the computer's name (if we ever do status reports) host_info[:name] = Socket.gethostname() # username for creating / dropping databases host_info[:dbroot_name] = 'root' # password for creating / dropping databases host_info[:dbroot_pass] = '' # the user owning the /prod subtrees host_info[:pwnerer_user] = current_user RailsPwnerer::Config.flush_db :host # the free port list RailsPwnerer::Config.init_ports end |