cinderella 0.3.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/bin/cinderella +2 -62
- data/cinderella.gemspec +1 -4
- data/lib/cinderella.rb +0 -165
- data/lib/cinderella/version.rb +1 -1
- metadata +31 -99
data/README.md
CHANGED
@@ -7,7 +7,7 @@ OSX. Checkout the link below for more info.
|
|
7
7
|
Installing
|
8
8
|
==========
|
9
9
|
|
10
|
-
|
10
|
+
Visit http://www.atmos.org/cinderella and follow the instructions!
|
11
11
|
|
12
12
|
You should be in great shape for contributing to open source on a mac after that.
|
13
13
|
|
data/bin/cinderella
CHANGED
@@ -1,63 +1,3 @@
|
|
1
|
-
#!/
|
2
|
-
require "rubygems"
|
3
|
-
require "cinderella"
|
4
|
-
require "optparse"
|
1
|
+
#!/bin/sh
|
5
2
|
|
6
|
-
|
7
|
-
ENV['USER'] ||= 'bofh'
|
8
|
-
ENV['EMAIL'] ||= 'noreply@gmail.com'
|
9
|
-
ENV['EDITOR'] ||= 'vim'
|
10
|
-
ENV['FULLNAME'] ||= 'Marlon Brando'
|
11
|
-
|
12
|
-
config = {
|
13
|
-
:action => 'install',
|
14
|
-
:unstable => false
|
15
|
-
}
|
16
|
-
|
17
|
-
optparse = OptionParser.new do |opts|
|
18
|
-
opts.banner = "Usage: cinderella [options]"
|
19
|
-
|
20
|
-
opts.on( '-h', '--help', 'Display this screen' ) do
|
21
|
-
puts opts
|
22
|
-
exit
|
23
|
-
end
|
24
|
-
|
25
|
-
opts.on( '-u', '--uninstall', 'Uninstall cinderella' ) do
|
26
|
-
config[:action] = 'uninstall'
|
27
|
-
end
|
28
|
-
|
29
|
-
opts.on( '-i', '--install', 'Install cinderella [Default]' ) do
|
30
|
-
config[:action] = 'install'
|
31
|
-
end
|
32
|
-
|
33
|
-
opts.on( '-v', '--version', 'Display the cinderella version' ) do
|
34
|
-
config[:action] = 'version'
|
35
|
-
end
|
36
|
-
|
37
|
-
opts.on( '-x', '--unstable', 'Build from homebrew master branch instead of a stable sha1' ) do
|
38
|
-
config[:unstable] = true
|
39
|
-
end
|
40
|
-
|
41
|
-
opts.on( '-b', '--binary-installer', 'Build from homebrew master branch instead of a stable sha1' ) do
|
42
|
-
config[:action] = 'binary_install'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
optparse.parse!
|
47
|
-
|
48
|
-
case config[:action]
|
49
|
-
when 'uninstall'
|
50
|
-
Cinderella::Runner.uninstall
|
51
|
-
when 'binary_install'
|
52
|
-
Cinderella::Runner.binary_install
|
53
|
-
when 'version'
|
54
|
-
Cinderella::Runner.version
|
55
|
-
else
|
56
|
-
if config[:unstable]
|
57
|
-
Cinderella::Runner.run_unstable
|
58
|
-
else
|
59
|
-
Cinderella::Runner.run
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# vim:ft=ruby
|
3
|
+
exec boxen
|
data/cinderella.gemspec
CHANGED
@@ -13,10 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
|
14
14
|
s.rubyforge_project = "cinderella"
|
15
15
|
|
16
|
-
s.add_dependency "
|
17
|
-
s.add_dependency "chef", "=0.10.4"
|
18
|
-
s.add_dependency "json", "=1.5.2"
|
19
|
-
s.add_dependency "rest-client", "~>1.6.1"
|
16
|
+
s.add_dependency "boxen", "~>1.0.1"
|
20
17
|
|
21
18
|
s.files = `git ls-files`.split("\n")
|
22
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/cinderella.rb
CHANGED
@@ -1,165 +0,0 @@
|
|
1
|
-
require "etc"
|
2
|
-
require "json"
|
3
|
-
require "tmpdir"
|
4
|
-
require "rest_client"
|
5
|
-
require "cinderella/version"
|
6
|
-
|
7
|
-
module Cinderella
|
8
|
-
class Runner
|
9
|
-
RECOMMENDED_LLVM = 2206
|
10
|
-
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
|
11
|
-
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f
|
12
|
-
|
13
|
-
def self.run
|
14
|
-
new.run
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.run_unstable
|
18
|
-
ENV['CINDERELLA_RELEASE'] = 'origin/master'
|
19
|
-
run
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.uninstall
|
23
|
-
new.uninstall
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.binary_install
|
27
|
-
new.binary_installer
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.version
|
31
|
-
puts "Cinderella Version: #{Cinderella::VERSION}"
|
32
|
-
end
|
33
|
-
|
34
|
-
def root_dir
|
35
|
-
@root_dir ||=
|
36
|
-
if ENV['SMEAGOL_ROOT_DIR']
|
37
|
-
"#{ENV['SMEAGOL_ROOT_DIR']}/Developer"
|
38
|
-
else
|
39
|
-
"~/Developer"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def uninstall
|
44
|
-
services = %w/memcached mysql redis mongodb postgresql/
|
45
|
-
services.each do |service|
|
46
|
-
puts "Stopping Server: #{service} "
|
47
|
-
sleep 0.5
|
48
|
-
system("lunchy stop #{service}")
|
49
|
-
end
|
50
|
-
puts ""
|
51
|
-
puts "Removing #{root_dir}/Developer"
|
52
|
-
system("rm -rf ~/.cinderella.profile #{root_dir}/Developer")
|
53
|
-
puts "Cinderella successfully uninstalled"
|
54
|
-
end
|
55
|
-
|
56
|
-
def binary_installer
|
57
|
-
log_file = "#{Dir.tmpdir}/cinderella.binary.output.txt"
|
58
|
-
local_file = "#{Dir.tmpdir}/cinderella-0.3.2.tar.gz"
|
59
|
-
local_user = `whoami`.chomp
|
60
|
-
|
61
|
-
unless File.exists?("/opt")
|
62
|
-
puts "You don't have an /opt directory, we need sudo access for this."
|
63
|
-
puts "You'll only be prompted for your password once."
|
64
|
-
`sudo mkdir -p /opt`
|
65
|
-
`sudo chown #{local_user}:staff /opt`
|
66
|
-
end
|
67
|
-
unless File.exists?(local_file)
|
68
|
-
puts `curl -o #{local_file} #{binary_url}`
|
69
|
-
end
|
70
|
-
if File.exists?(local_file)
|
71
|
-
puts "Extracting #{local_file} to /opt"
|
72
|
-
`tar zxvf #{local_file} -C /opt > #{log_file} 2>&1`
|
73
|
-
if $?.success?
|
74
|
-
post_install
|
75
|
-
puts "\n\nCinderella successfully installed"
|
76
|
-
puts "Open up a new terminal and you're ready to go!"
|
77
|
-
else
|
78
|
-
puts "Something went wrong installing cinderella, logs at #{log_file}"
|
79
|
-
exit 1
|
80
|
-
end
|
81
|
-
else
|
82
|
-
puts "Had issues downloading the binary installer. Sorry, bro."
|
83
|
-
exit 1
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def post_install
|
88
|
-
script_file = "#{Dir.tmpdir}/cinderella.post_install.sh"
|
89
|
-
|
90
|
-
File.open(script_file, "w") do |fp|
|
91
|
-
fp.puts "#!/bin/bash"
|
92
|
-
fp.puts "source /opt/Developer/cinderella.profile"
|
93
|
-
fp.puts "cinderella"
|
94
|
-
end
|
95
|
-
`bash #{script_file}`
|
96
|
-
end
|
97
|
-
|
98
|
-
def binary_url
|
99
|
-
"http://cinderella.s3.amazonaws.com/cinderella-0.3.2.tar.bz2"
|
100
|
-
end
|
101
|
-
|
102
|
-
def run
|
103
|
-
if root?
|
104
|
-
warn "#{$0} should not be run as root, try again as a normal user"
|
105
|
-
exit 1
|
106
|
-
end
|
107
|
-
|
108
|
-
unless sane_os_version?
|
109
|
-
warn "You should really upgrade to snow leopard"
|
110
|
-
warn "Make sure you have xcode installed and cross your fingers"
|
111
|
-
warn "I've seen it work on leopard though..."
|
112
|
-
end
|
113
|
-
|
114
|
-
if sketchy_ruby?
|
115
|
-
warn "You have a pre-existing ruby install that might mess with installation"
|
116
|
-
warn "I'm going to continue anyway, *fingers crossed* ;)"
|
117
|
-
end
|
118
|
-
|
119
|
-
system("rm -rf ~/.cinderella")
|
120
|
-
system("chef-solo -c #{config}")
|
121
|
-
exit($?.to_i)
|
122
|
-
end
|
123
|
-
|
124
|
-
def config
|
125
|
-
download_solo_rb
|
126
|
-
filename
|
127
|
-
end
|
128
|
-
|
129
|
-
private
|
130
|
-
|
131
|
-
def sketchy_ruby?
|
132
|
-
case `which ruby`.chomp
|
133
|
-
when '/usr/bin/ruby', /#{root_dir}/
|
134
|
-
false
|
135
|
-
else
|
136
|
-
true
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
def root?
|
141
|
-
Etc.getpwuid.uid == 0
|
142
|
-
end
|
143
|
-
|
144
|
-
def sane_os_version?
|
145
|
-
MACOS_VERSION >= 10.6
|
146
|
-
end
|
147
|
-
|
148
|
-
def warn(msg)
|
149
|
-
$stderr.puts msg
|
150
|
-
end
|
151
|
-
|
152
|
-
def download_solo_rb
|
153
|
-
response = RestClient.get("http://ciderapp.org/solo.rb")
|
154
|
-
if response.code == 200
|
155
|
-
File.open(filename, "w") do |fp|
|
156
|
-
fp.write(response.body)
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
def filename
|
162
|
-
@filename ||= File.expand_path(File.join(Dir.tmpdir, "cinderella.rb"))
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
data/lib/cinderella/version.rb
CHANGED
metadata
CHANGED
@@ -1,97 +1,40 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinderella
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 5
|
10
|
-
version: 0.3.5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Corey Donohoe
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
name: lunchy
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2013-03-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: boxen
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 4
|
33
|
-
- 0
|
34
|
-
version: 0.4.0
|
35
|
-
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: chef
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - "="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 63
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 10
|
49
|
-
- 4
|
50
|
-
version: 0.10.4
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.1
|
51
22
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: json
|
55
23
|
prerelease: false
|
56
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
25
|
none: false
|
58
|
-
requirements:
|
59
|
-
- - "="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 7
|
62
|
-
segments:
|
63
|
-
- 1
|
64
|
-
- 5
|
65
|
-
- 2
|
66
|
-
version: 1.5.2
|
67
|
-
type: :runtime
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rest-client
|
71
|
-
prerelease: false
|
72
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
26
|
+
requirements:
|
75
27
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 6
|
81
|
-
- 1
|
82
|
-
version: 1.6.1
|
83
|
-
type: :runtime
|
84
|
-
version_requirements: *id004
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.0.1
|
85
30
|
description: The development environment you never wanted to manage alone
|
86
|
-
email:
|
31
|
+
email:
|
87
32
|
- atmos@atmos.org
|
88
|
-
executables:
|
33
|
+
executables:
|
89
34
|
- cinderella
|
90
35
|
extensions: []
|
91
|
-
|
92
36
|
extra_rdoc_files: []
|
93
|
-
|
94
|
-
files:
|
37
|
+
files:
|
95
38
|
- .gitignore
|
96
39
|
- Gemfile
|
97
40
|
- LICENSE
|
@@ -101,39 +44,28 @@ files:
|
|
101
44
|
- cinderella.gemspec
|
102
45
|
- lib/cinderella.rb
|
103
46
|
- lib/cinderella/version.rb
|
104
|
-
has_rdoc: true
|
105
47
|
homepage: https://github.com/atmos/cinderella
|
106
48
|
licenses: []
|
107
|
-
|
108
49
|
post_install_message:
|
109
50
|
rdoc_options: []
|
110
|
-
|
111
|
-
require_paths:
|
51
|
+
require_paths:
|
112
52
|
- lib
|
113
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
54
|
none: false
|
115
|
-
requirements:
|
116
|
-
- -
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
|
119
|
-
|
120
|
-
- 0
|
121
|
-
version: "0"
|
122
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
60
|
none: false
|
124
|
-
requirements:
|
125
|
-
- -
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
|
128
|
-
segments:
|
129
|
-
- 0
|
130
|
-
version: "0"
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
131
65
|
requirements: []
|
132
|
-
|
133
66
|
rubyforge_project: cinderella
|
134
|
-
rubygems_version: 1.
|
67
|
+
rubygems_version: 1.8.23
|
135
68
|
signing_key:
|
136
69
|
specification_version: 3
|
137
70
|
summary: The development environment you never wanted to manage alone
|
138
71
|
test_files: []
|
139
|
-
|