teleport 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ module Teleport
3
3
  class Config
4
4
  include Constants
5
5
 
6
- RUBIES = ["1.9.3", "1.9.2", "REE", "1.8.7"]
6
+ RUBIES = ["2.0.0", "1.9.3", "1.9.2", "REE", "1.8.7"]
7
7
 
8
8
  attr_accessor :user, :ruby, :ssh_options, :roles, :servers, :apt, :packages, :recipes, :callbacks, :dsl, :ssh_key
9
9
 
data/lib/teleport/main.rb CHANGED
@@ -36,6 +36,9 @@ module Teleport
36
36
  o.on("-r", "--recipe [RECIPE]", "run a single recipe instead of a full install") do |f|
37
37
  @options[:recipe] = f
38
38
  end
39
+ o.on("-u", "--upgrade", "upgrade the existing ruby to the version configured") do |f|
40
+ @options[:upgrade] = true
41
+ end
39
42
  o.on_tail("-h", "--help", "print this help text") do
40
43
  puts opt
41
44
  exit(0)
@@ -92,6 +95,7 @@ module Teleport
92
95
  f.puts("CONFIG_HOST='#{@options[:host]}'")
93
96
  f.puts("CONFIG_RUBY='#{@config.ruby}'")
94
97
  f.puts("CONFIG_RUBYGEMS='#{RUBYGEMS}'")
98
+ f.puts("CONFIG_UPGRADE='#{@options[:upgrade] || false}'")
95
99
  f.puts("CONFIG_RECIPE='#{@options[:recipe]}'") if @options[:recipe]
96
100
  end
97
101
  # keys
data/lib/teleport/run.sh CHANGED
@@ -42,6 +42,7 @@ function install_ruby() {
42
42
  1.8.7 ) install_ruby_187 ;;
43
43
  1.9.2 ) install_ruby_192 ;;
44
44
  1.9.3 ) install_ruby_193 ;;
45
+ 2.0.0 ) install_ruby_200 ;;
45
46
  REE ) install_ruby_ree ;;
46
47
  * ) fatal "unknown ruby ($CONFIG_RUBY)" ;;
47
48
  esac
@@ -61,6 +62,46 @@ function install_rubygems() {
61
62
  fi
62
63
  }
63
64
 
65
+ #
66
+ # thanks to http://blog.statuspage.io/moving-to-ruby-2-on-mac-rvm-and-ubuntu-12-04/
67
+ # for suggestions
68
+ #
69
+
70
+ function install_ruby_20_requirements() {
71
+ apt-get -y install build-essential checkinstall libffi-dev libncurses5-dev libssl-dev libyaml-dev zlib1g-dev
72
+ }
73
+
74
+ function install_ruby_200() {
75
+ local patch=p0
76
+
77
+ install_ruby_20_requirements
78
+
79
+ wget http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-$patch.tar.gz
80
+ #wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-$patch.tar.gz
81
+ tar xvzf ruby-2.0.0-$patch.tar.gz
82
+
83
+ cd ruby-2.0.0-$patch
84
+ ./configure --prefix=/usr/local \
85
+ --program-suffix=200 \
86
+ --with-ruby-version=2.0.0 \
87
+ --disable-install-doc
88
+ make
89
+ checkinstall -D -y \
90
+ --nodoc \
91
+ --dpkgflags=--force-overwrite \
92
+ --pkgname="ruby2.0.0" \
93
+ --pkgversion="2.0.0-$patch" \
94
+ --provides="ruby200"
95
+ cd ..
96
+
97
+ update-alternatives --install /usr/local/bin/ruby ruby /usr/local/bin/ruby200 200 \
98
+ --slave /usr/local/bin/ri ri /usr/local/bin/ri200 \
99
+ --slave /usr/local/bin/irb irb /usr/local/bin/irb200 \
100
+ --slave /usr/local/bin/gem gem /usr/local/bin/gem200 \
101
+ --slave /usr/local/bin/erb erb /usr/local/bin/erb200 \
102
+ --slave /usr/local/bin/rdoc rdoc /usr/local/bin/rdoc200
103
+ }
104
+
64
105
  #
65
106
  # thanks to http://threebrothers.org/brendan/blog/ruby-1-9-2-on-ubuntu-11-04/
66
107
  # for suggestions
@@ -87,12 +128,13 @@ function install_ruby_192() {
87
128
  checkinstall -D -y \
88
129
  --fstrans=no \
89
130
  --nodoc \
131
+ --dpkgflags=--force-overwrite \
90
132
  --pkgname="ruby1.9.2" \
91
133
  --pkgversion="1.9.2-$patch" \
92
134
  --provides="ruby"
93
135
  cd ..
94
136
 
95
- update-alternatives --install /usr/local/bin/ruby ruby /usr/local/bin/ruby192 500 \
137
+ update-alternatives --install /usr/local/bin/ruby ruby /usr/local/bin/ruby192 192 \
96
138
  --slave /usr/local/bin/ri ri /usr/local/bin/ri192 \
97
139
  --slave /usr/local/bin/irb irb /usr/local/bin/irb192 \
98
140
  --slave /usr/local/bin/gem gem /usr/local/bin/gem192 \
@@ -116,12 +158,13 @@ function install_ruby_193_src() {
116
158
  make
117
159
  checkinstall -D -y \
118
160
  --nodoc \
161
+ --dpkgflags=--force-overwrite \
119
162
  --pkgname="ruby1.9.3" \
120
163
  --pkgversion="1.9.3-$patch" \
121
164
  --provides="ruby"
122
165
  cd ..
123
166
 
124
- update-alternatives --install /usr/local/bin/ruby ruby /usr/local/bin/ruby193 500 \
167
+ update-alternatives --install /usr/local/bin/ruby ruby /usr/local/bin/ruby193 193 \
125
168
  --slave /usr/local/bin/ri ri /usr/local/bin/ri193 \
126
169
  --slave /usr/local/bin/irb irb /usr/local/bin/irb193 \
127
170
  --slave /usr/local/bin/gem gem /usr/local/bin/gem193 \
@@ -190,8 +233,15 @@ cd /tmp/_teleported
190
233
  source ./config
191
234
 
192
235
  # do we need to install ruby?
193
- if ! which ruby > /dev/null ; then
236
+ if ! which ruby > /dev/null; then
194
237
  install_ruby
238
+ elif ! [[ `ruby -v` =~ "$CONFIG_RUBY" ]]; then
239
+ # installed ruby version does not matched the one configured
240
+ if [[ 'true' = "$CONFIG_UPGRADE" ]] ; then
241
+ install_ruby
242
+ else
243
+ banner "warning - Use the --upgrade argument to upgrade to Ruby $CONFIG_RUBY"
244
+ fi
195
245
  fi
196
246
 
197
247
  # do we need to get rid of the apt rubygems package?
@@ -1,4 +1,4 @@
1
1
  module Teleport
2
2
  # Gem version
3
- VERSION = "1.0.13"
3
+ VERSION = "1.0.14"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teleport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-24 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: amazon-ec2
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  segments:
138
138
  - 0
139
- hash: 2963280599816926644
139
+ hash: 72796242449791997
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  segments:
147
147
  - 0
148
- hash: 2963280599816926644
148
+ hash: 72796242449791997
149
149
  requirements: []
150
150
  rubyforge_project: teleport
151
151
  rubygems_version: 1.8.24