appli 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/applify +47 -0
  2. metadata +4 -2
data/bin/applify ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'highline/import'
4
+
5
+ ## Get the repository which we want to deploy from
6
+ repository = nil
7
+ if File.directory?('.git') && remotes = `git remote -v`
8
+ repository = remotes.split("\n").first.split(/\s+/)[1]
9
+ else
10
+ repository = ARGV.first
11
+ end
12
+
13
+ if repository.nil?
14
+ puts "usage: appli [repository url]"
15
+ end
16
+
17
+ puts
18
+ puts " Creating Capistrano configuration for #{repository}"
19
+
20
+ template = File.read(File.expand_path("../../doc/Capfile", __FILE__))
21
+
22
+ puts
23
+ dbhost = ask(" Database Hostname...........: ")
24
+ dbuser = ask(" Database Username...........: ")
25
+ dbname = ask(" Database Name...............: ")
26
+ puts
27
+ ip = ask(" Enter your server address...: ")
28
+
29
+
30
+ template.gsub!("{{dbhost}}", dbhost)
31
+ template.gsub!("{{dbuser}}", dbuser)
32
+ template.gsub!("{{dbname}}", dbname)
33
+ template.gsub!("{{repourl}}", repository)
34
+ template.gsub!("{{ip}}", ip)
35
+
36
+ if File.exist?("Capfile")
37
+ puts
38
+ puts " \e[31mCapfile already exists.\e[0m"
39
+ ow = ask(" Do you wish to overwrite....? ")
40
+ if ow[0] != 'y'
41
+ Process.exit(1)
42
+ end
43
+ end
44
+
45
+ File.open("Capfile", 'w') { |f| f.write(template)}
46
+ puts
47
+ puts " \e[0mCapfile created successfully!\e[0m"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,10 +13,12 @@ date: 2011-12-10 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: adam@atechmedia.com
16
- executables: []
16
+ executables:
17
+ - applify
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/applify
20
22
  - lib/appli/deploy.rb
21
23
  homepage: http://www.applihq.com
22
24
  licenses: []