cinderella 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,9 +34,13 @@ optparse = OptionParser.new do |opts|
34
34
  config[:action] = 'version'
35
35
  end
36
36
 
37
- opts.on( '-u', '--unstable', 'Build from homebrew master branch instead of a stable sha1' ) do
37
+ opts.on( '-x', '--unstable', 'Build from homebrew master branch instead of a stable sha1' ) do
38
38
  config[:unstable] = true
39
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
40
44
  end
41
45
 
42
46
  optparse.parse!
@@ -44,6 +48,8 @@ optparse.parse!
44
48
  case config[:action]
45
49
  when 'uninstall'
46
50
  Cinderella::Runner.uninstall
51
+ when 'binary_install'
52
+ Cinderella::Runner.binary_install
47
53
  when 'version'
48
54
  Cinderella::Runner.version
49
55
  else
@@ -23,6 +23,10 @@ module Cinderella
23
23
  new.uninstall
24
24
  end
25
25
 
26
+ def self.binary_install
27
+ new.binary_installer
28
+ end
29
+
26
30
  def self.version
27
31
  puts "Cinderella Version: #{Cinderella::VERSION}"
28
32
  end
@@ -37,10 +41,9 @@ module Cinderella
37
41
  end
38
42
 
39
43
  def uninstall
40
- print "Stopping Service: "
41
44
  services = %w/memcached mysql redis mongodb postgresql/
42
45
  services.each do |service|
43
- print "#{service} "
46
+ puts "Stopping Server: #{service} "
44
47
  sleep 0.5
45
48
  system("lunchy stop #{service}")
46
49
  end
@@ -50,6 +53,43 @@ module Cinderella
50
53
  puts "Cinderella successfully uninstalled"
51
54
  end
52
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
+ puts "Cinderella successfully installed"
75
+ puts "Open up a new shell and run the following command"
76
+ puts "\nsource /opt/Developer/cinderella.profile\n"
77
+ puts "\nThen run the 'cinderella' command."
78
+ exit 0
79
+ else
80
+ puts "Something went wrong installing cinderella, logs at #{log_file}"
81
+ exit 1
82
+ end
83
+ else
84
+ puts "Had issues downloading the binary installer. Sorry, bro."
85
+ exit 1
86
+ end
87
+ end
88
+
89
+ def binary_url
90
+ "http://cinderella.s3.amazonaws.com/cinderella-0.3.2.tar.bz2"
91
+ end
92
+
53
93
  def run
54
94
  if root?
55
95
  warn "#{$0} should not be run as root, try again as a normal user"
@@ -1,3 +1,3 @@
1
1
  module Cinderella
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,68 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cinderella
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 2
9
+ version: 0.3.2
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Corey Donohoe
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-12-05 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2011-12-05 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: lunchy
16
- requirement: &70122731985580 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
19
25
  - - ~>
20
- - !ruby/object:Gem::Version
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 4
30
+ - 0
21
31
  version: 0.4.0
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70122731985580
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: chef
27
- requirement: &70122731985020 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - =
31
- - !ruby/object:Gem::Version
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 10
44
+ - 4
32
45
  version: 0.10.4
33
46
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70122731985020
36
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
37
49
  name: json
38
- requirement: &70122731984180 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - =
42
- - !ruby/object:Gem::Version
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 5
58
+ - 2
43
59
  version: 1.5.2
44
60
  type: :runtime
45
- prerelease: false
46
- version_requirements: *70122731984180
47
- - !ruby/object:Gem::Dependency
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
48
63
  name: rest-client
49
- requirement: &70122731980460 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirements:
52
67
  - - ~>
53
- - !ruby/object:Gem::Version
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 1
71
+ - 6
72
+ - 1
54
73
  version: 1.6.1
55
74
  type: :runtime
56
- prerelease: false
57
- version_requirements: *70122731980460
75
+ version_requirements: *id004
58
76
  description: The development environment you never wanted to manage alone
59
- email:
77
+ email:
60
78
  - atmos@atmos.org
61
- executables:
79
+ executables:
62
80
  - cinderella
63
81
  extensions: []
82
+
64
83
  extra_rdoc_files: []
65
- files:
84
+
85
+ files:
66
86
  - .gitignore
67
87
  - Gemfile
68
88
  - LICENSE
@@ -73,28 +93,35 @@ files:
73
93
  - cinderella.gemspec
74
94
  - lib/cinderella.rb
75
95
  - lib/cinderella/version.rb
96
+ has_rdoc: true
76
97
  homepage: https://github.com/atmos/cinderella
77
98
  licenses: []
99
+
78
100
  post_install_message:
79
101
  rdoc_options: []
80
- require_paths:
102
+
103
+ require_paths:
81
104
  - lib
82
- required_ruby_version: !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- required_rubygems_version: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ segments:
117
+ - 0
118
+ version: "0"
94
119
  requirements: []
120
+
95
121
  rubyforge_project: cinderella
96
- rubygems_version: 1.8.11
122
+ rubygems_version: 1.3.6
97
123
  signing_key:
98
124
  specification_version: 3
99
125
  summary: The development environment you never wanted to manage alone
100
126
  test_files: []
127
+