Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.1.0 - Automatic help for user git configuration on console start.

        Automatic ssh key configuration on console start.
        Configuration summary output on console start.
        git-bash shortcut is now added to the RailsInstaller start menu group.
  • Loading branch information...
commit bf686ef60c37bc83d062404c4e467ac73f0602cb 1 parent 48868d1
@wayneeseguin wayneeseguin authored
View
6 CHANGELOG.txt
@@ -1,3 +1,8 @@
+1.1.0 - Automatic help for user git configuration on console start.
+ Automatic ssh key configuration on console start.
+ Configuration summary output on console start.
+ git-bash shortcut is now added to the RailsInstaller start menu group.
+
1.0.5 - Ruby Updating to 1.8.7-p334 for released Security Updates.
1.0.4 - Moved Sites location back to %HOMEDRIVE%\Sites
@@ -20,7 +25,6 @@
Added sample Rails3 application in a directory for application projects.
Tweaked git config to always convert CRLF to LF.
-
0.0.1 - Initial build and package tasks functional, includes Ruby 1.8.7, Git
DevKit and Sqlite3.
View
2  VERSION.txt
@@ -1 +1 @@
-1.0.5
+1.1.0
View
10 lib/railsinstaller/methods.rb
@@ -351,15 +351,15 @@ def self.stage_rails_sample_application
# They have installation-sensitive information (installation path)
def self.stage_setup_scripts
- section Scripts
+ section Scripts
- pkg_path = File.join(RailsInstaller::Stage, "scripts")
+ scripts_path = File.join(RailsInstaller::Stage, "scripts")
- FileUtils.mkdir_p(pkg_path) unless File.exist?(pkg_path)
+ FileUtils.mkdir_p(scripts_path) unless File.exist?(scripts_path)
FileUtils.cp(
- File.join(RailsInstaller::Scripts, "setup_ssh.bat"),
- File.join(pkg_path, "setup_ssh.bat")
+ File.join(RailsInstaller::Scripts, "config_check.rb"),
+ File.join(scripts_path, "config_check.rb")
)
end
View
2  resources/railsinstaller/railsinstaller.iss
@@ -107,6 +107,7 @@ Source: {#StagePath}\Git\*; DestDir: {app}\Git; Flags: recursesubdirs createalls
Source: {#StagePath}\DevKit\*; DestDir: {app}\DevKit; Excludes: "config.yml"; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\DevKit\config.yml; DestDir: {app}\DevKit; AfterInstall: UpdateDevKitConfig('{app}\{#RubyPath}', '{app}\DevKit\config.yml')
Source: {#StagePath}\Sites\*; DestDir: {sd}\Sites; Flags: recursesubdirs createallsubdirs
+Source: {#StagePath}\scripts\*; DestDir: {app}\scripts\; Flags: recursesubdirs createallsubdirs
; TODO: Instead of running the full vcredist, simply extract and bundle the dll
; files with an associated manifest.
; Source: {#StagePath}\pkg\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
@@ -123,6 +124,7 @@ Source: setup_environment.bat; DestDir: {app}\{#RubyPath}
Name: {group}\Interactive Ruby; Filename: {app}\{#RubyPath}\bin\irb.bat; WorkingDir: {app}\{#RubyPath} ; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists
Name: {group}\RubyGems Documentation Server; Filename: {app}\{#RubyPath}\bin\gem.bat; Parameters: server; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists runminimized
Name: {group}\Command Prompt with Ruby and Rails; Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\{#RubyPath}\setup_environment.bat; WorkingDir: {sd}\Sites; IconFilename: {sys}\cmd.exe; Flags: createonlyiffileexists
+Name: {group}\Git Bash; Filename: {sys}\cmd.exe; Parameters: "/c """"{app}\Git\bin\sh.exe"" --login -i"""; WorkingDir: {sd}\Sites; IconFilename: {app}\Git\etc\git.ico; Flags: createonlyiffileexists
; {%HOMEPATH%}
Name: {group}\{cm:UninstallProgram,{#InstallerName}}; Filename: {uninstallexe}
View
21 resources/railsinstaller/setup_environment.bat
@@ -5,16 +5,14 @@ REM Environment setup file for RailsInstaller.
REM
REM
-REM First we Determine where is RUBY_DIR
-REM (which is where this script is)
+REM First we Determine where is RUBY_DIR (which is where this script is)
REM
PUSHD %~dp0.
SET RUBY_DIR=%CD%
POPD
REM
-REM Now we Determine the RailsInstaller Root directory
-REM (parent directory of Ruby)
+REM Now Determine the RailsInstaller Root directory (parent directory of Ruby)
REM
PUSHD %RUBY_DIR%\..
SET ROOT_DIR=%CD%
@@ -34,20 +32,13 @@ REM
IF NOT EXIST %HOMEDRIVE%\Sites. (md %HOMEDRIVE%\Sites.)
REM
-REM Set the HOME environment variables for Ruby & Gems to use
-REM with ENV["HOME"]
+REM Set the HOME environment variables for Ruby & Gems to use with ENV["HOME"]
REM
SET HOME=%HOMEDRIVE%%HOMEPATH%
-REM Display Git Verison
-git --version
+REM Check configurations for Git and SSH
+ruby %HOMEDRIVE%\RailsInstaller\scripts\config_check.rb
-REM Display Ruby Version
-%RUBY_DIR%\bin\ruby.exe -v
-
-REM Display Rails version
-%RUBY_DIR%\bin\rails.bat -v
-
-REM NOTE we start out in the Sites directory as that is the working dir set.
+REM NOTE that we start out in the Sites directory as the current working dir
REM cd %HOMEDRIVE%\Sites
View
76 resources/scripts/config_check.rb
@@ -0,0 +1,76 @@
+#!/usr/bin/env ruby
+
+require "fileutils"
+
+Config =
+ {
+ :banner => "# Rails Environment Configuration.\n",
+ :git_config_incomplete => "\nYour git configuration is incomplete.\nuser.name and user.email are required for properly using git and services such \nas GitHub ( http://github.com/ ).\n",
+ :git_name_prompt => " name > ",
+ :git_email_prompt => " email > ",
+ :railsinstaller_path => File.dirname(File.dirname($0)),
+ :home => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"] ),
+ :ssh_path => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"], ".ssh" ),
+ :ssh_key => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"], ".ssh", "id_rsa"),
+ :ssh_keygen => File.join( File.dirname(File.dirname($0)), "Git", "bin", "ssh-keygen.exe"),
+ :git => File.join( File.dirname(File.dirname($0)), "Git", "bin", "git.exe")
+ }
+
+#
+# Methods
+#
+def run(command)
+ $stderr.puts "Running #{command}" if Debug
+ %x{#{command}}.chomp
+end
+
+def generate_ssh_key
+ run %Q{#{Config[:ssh_keygen]} -f "#{Config[:ssh_key]}" -t rsa -b 2048 -N "" -C "#{git_config("user.name")} <#{git_config("user.email")}>"}
+end
+
+def git_config(key)
+ run %Q{#{Config[:git]} config --global #{key}}
+end
+
+#
+# Configuration
+#
+printf Config[:banner]
+
+["name","email"].each do |key|
+ while git_config("user.#{key}").empty?
+ if Config[:git_config_incomplete]
+ printf Config[:git_config_incomplete]
+ Config[:git_config_incomplete] = nil
+ end
+ printf Config["git_#{key}_prompt".to_sym]
+ value = gets.chomp
+ next if value.empty?
+ printf "Setting user.#{key} to #{value}"
+ run %Q{#{Config[:git]} config --global user.#{key} "#{value}"}
+ end
+end
+
+FileUtils.mkdir_p(Config[:ssh_path]) unless File.exist? Config[:ssh_path]
+generate_ssh_key unless File.exist? Config[:ssh_key]
+
+#
+# Emit Summary
+#
+printf "---
+git:
+ user.name: #{git_config("user.name")}
+ user.email: #{git_config("user.email")}
+ version: #{run "git --version"}
+ssh:
+ public_key: #{Config[:ssh_key]}
+ruby:
+ bin: #{File.join(Config[:railsinstaller_path], "Ruby1.8.7", "bin", "ruby.exe")}
+ version: #{run "ruby -v"}
+rails:
+ bin: #{File.join(Config[:railsinstaller_path], "Ruby1.8.7", "bin", "rails.bat")}
+ version: #{run "rails -v"}
+
+"
+
+exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.