greenhouse 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/greenhouse.rb +1 -0
- data/lib/greenhouse/commands/add.rb +1 -1
- data/lib/greenhouse/commands/init.rb +2 -2
- data/lib/greenhouse/commands/launch.rb +3 -3
- data/lib/greenhouse/commands/pull.rb +1 -1
- data/lib/greenhouse/commands/purge.rb +1 -25
- data/lib/greenhouse/commands/push.rb +1 -1
- data/lib/greenhouse/commands/status.rb +0 -1
- data/lib/greenhouse/projects/repository.rb +52 -21
- data/lib/greenhouse/tasks/add_project.rb +2 -2
- data/lib/greenhouse/tasks/project_status.rb +25 -18
- data/lib/greenhouse/tasks/project_task.rb +77 -50
- data/lib/greenhouse/tasks/remove_greenhouse_files.rb +4 -4
- data/lib/greenhouse/tasks/remove_project.rb +1 -1
- data/lib/greenhouse/version.rb +7 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46f9163d7afb19a3167ba11589fde5aa3ce2db83
|
4
|
+
data.tar.gz: b8669a7f66ffc5ccbaa4549daf7b432fc9ca3454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a627df75f673da9436f78fee0f09ec6cc3d7220ef74a8a38309a058c8f49872aac1ab68dd5ffee93044bae503ce17e59a412359c5caf99fd2171a427754655f0
|
7
|
+
data.tar.gz: 719c6daafae8f253c9066d636052e942b925fa74b71ad7c59312a6b00c659acb5d98becaaa5f74993171acda3ff05400155a460a7c470e14dcaf50d1c1d664af
|
data/lib/greenhouse.rb
CHANGED
@@ -48,7 +48,7 @@ IGNORE
|
|
48
48
|
|
49
49
|
after_hook do
|
50
50
|
puts
|
51
|
-
puts "New ecosystem initialized in
|
51
|
+
puts "New ecosystem initialized in #{Projects::path.magenta}"
|
52
52
|
end
|
53
53
|
|
54
54
|
class << self
|
@@ -62,7 +62,7 @@ IGNORE
|
|
62
62
|
while !['', 'n','no'].include?(another) do
|
63
63
|
puts "The following projects will be initialized in your ecosystem:"
|
64
64
|
Projects.projects.each do |project|
|
65
|
-
puts "
|
65
|
+
puts " #{project.title.cyan}"
|
66
66
|
end
|
67
67
|
puts
|
68
68
|
print "Would you like to add another project before initializing? ([y]es/[N]o): "
|
@@ -64,16 +64,16 @@ USAGE
|
|
64
64
|
require 'dotenv'
|
65
65
|
Dotenv.load!
|
66
66
|
rescue
|
67
|
-
puts "
|
67
|
+
puts "Error parsing .env file for #{app.title.cyan}.".red
|
68
68
|
exit 1
|
69
69
|
end
|
70
70
|
else
|
71
|
-
puts "
|
71
|
+
puts "Warning: No .env file found in #{app.title.cyan}!".yellow
|
72
72
|
puts "Your application may not behave as expected without a .env file."
|
73
73
|
end
|
74
74
|
|
75
75
|
unless app.procfile.exists?
|
76
|
-
puts "
|
76
|
+
puts "No Procfile found for #{app.title.cyan}".red
|
77
77
|
exit 1
|
78
78
|
end
|
79
79
|
|
@@ -29,7 +29,7 @@ USAGE
|
|
29
29
|
|
30
30
|
def pull_project(project)
|
31
31
|
unless project.exists?
|
32
|
-
puts "Project
|
32
|
+
puts "Project #{project.title.cyan} does not exist. Try initializing it with `greenhouse init`"
|
33
33
|
return
|
34
34
|
end
|
35
35
|
|
@@ -44,14 +44,13 @@ USAGE
|
|
44
44
|
puts "Nothing to do."
|
45
45
|
return
|
46
46
|
end
|
47
|
-
#return unless force? || prompt
|
48
47
|
|
49
48
|
purge
|
50
49
|
else
|
51
50
|
Tasks::PurgeProject.perform(app, force?)
|
52
51
|
end
|
53
52
|
|
54
|
-
puts "
|
53
|
+
puts "Done".yellow
|
55
54
|
return
|
56
55
|
end
|
57
56
|
|
@@ -62,29 +61,6 @@ USAGE
|
|
62
61
|
|
63
62
|
Tasks::RemoveGreenhouseFiles.perform(force?) if purge_all?
|
64
63
|
end
|
65
|
-
|
66
|
-
def prompt
|
67
|
-
puts <<PUTS
|
68
|
-
\e[31mThis will completely clean out the ecosystem, removing all projects and
|
69
|
-
optionally dropping the database and wiping configuration files.\e[0m
|
70
|
-
|
71
|
-
PUTS
|
72
|
-
puts <<PUTS
|
73
|
-
You will be prompted if you have any uncommitted local changes or unpushed branches
|
74
|
-
in any of your projects and may choose to either take action or skip that project
|
75
|
-
to avoid losing any work.
|
76
|
-
|
77
|
-
PUTS
|
78
|
-
puts <<PUTS
|
79
|
-
You will be prompted separately to confirm whether you'd like to drop or keep your
|
80
|
-
databases.
|
81
|
-
PUTS
|
82
|
-
|
83
|
-
puts
|
84
|
-
print "Are you sure you want to continue? ([y]es/[N]o): "
|
85
|
-
continue = STDIN.gets.chomp.downcase
|
86
|
-
["y","yes"].include?(continue)
|
87
|
-
end
|
88
64
|
|
89
65
|
end
|
90
66
|
end
|
@@ -29,7 +29,7 @@ USAGE
|
|
29
29
|
|
30
30
|
def push_project(project)
|
31
31
|
unless project.exists?
|
32
|
-
puts "Project
|
32
|
+
puts "Project #{project.title.cyan} does not exist. Try initializing it with `greenhouse init`"
|
33
33
|
return
|
34
34
|
end
|
35
35
|
|
@@ -74,6 +74,17 @@ module Greenhouse
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
def not_checked_out?
|
78
|
+
!not_checked_out.empty?
|
79
|
+
end
|
80
|
+
|
81
|
+
# Remote branches that aren't checked out locally
|
82
|
+
def not_checked_out
|
83
|
+
git.branches.remote.select do |branch|
|
84
|
+
!branch.full.match(/HEAD/) && !git.branches.local.map(&:name).include?(branch.full.split("/").last)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
77
88
|
# Check whether local branches are synced with the remotes
|
78
89
|
def synced?
|
79
90
|
unsynced.empty?
|
@@ -85,9 +96,13 @@ module Greenhouse
|
|
85
96
|
git.branches.local.each do |branch|
|
86
97
|
git.remotes.each do |remote|
|
87
98
|
lcommit = git.object(branch.name).log.first
|
88
|
-
|
89
|
-
|
90
|
-
|
99
|
+
begin
|
100
|
+
rcommit = git.object("#{remote.name}/#{branch.name}").log.first
|
101
|
+
next if lcommit.sha == rcommit.sha
|
102
|
+
branches << [branch, remote]
|
103
|
+
rescue # can this just be an ensure? will the next still work without ensuring?
|
104
|
+
branches << [branch, remote]
|
105
|
+
end
|
91
106
|
end
|
92
107
|
end
|
93
108
|
branches
|
@@ -102,11 +117,15 @@ module Greenhouse
|
|
102
117
|
def ahead
|
103
118
|
unsynced.select do |branch|
|
104
119
|
lbranch = git.object(branch[0].name)
|
105
|
-
|
106
|
-
|
107
|
-
|
120
|
+
begin
|
121
|
+
rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
|
122
|
+
lcommit = lbranch.log.first
|
123
|
+
rcommit = rbranch.log.first
|
108
124
|
|
109
|
-
|
125
|
+
!rbranch.log.map(&:sha).include?(lcommit.sha) && lbranch.log.map(&:sha).include?(rcommit.sha)
|
126
|
+
rescue
|
127
|
+
true
|
128
|
+
end
|
110
129
|
|
111
130
|
#lcommit.date <= rcommit.date
|
112
131
|
end
|
@@ -121,11 +140,15 @@ module Greenhouse
|
|
121
140
|
def behind
|
122
141
|
unsynced.select do |branch|
|
123
142
|
lbranch = git.object(branch[0].name)
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
143
|
+
begin
|
144
|
+
rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
|
145
|
+
lcommit = lbranch.log.first
|
146
|
+
rcommit = rbranch.log.first
|
147
|
+
|
148
|
+
rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)
|
149
|
+
rescue
|
150
|
+
false
|
151
|
+
end
|
129
152
|
|
130
153
|
#lcommit.date >= rcommit.date
|
131
154
|
end
|
@@ -138,11 +161,15 @@ module Greenhouse
|
|
138
161
|
def diverged
|
139
162
|
unsynced.select do |branch|
|
140
163
|
lbranch = git.object(branch[0].name)
|
141
|
-
|
142
|
-
|
143
|
-
|
164
|
+
begin
|
165
|
+
rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
|
166
|
+
lcommit = lbranch.log.first
|
167
|
+
rcommit = rbranch.log.first
|
144
168
|
|
145
|
-
|
169
|
+
!rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)
|
170
|
+
rescue
|
171
|
+
false
|
172
|
+
end
|
146
173
|
end
|
147
174
|
end
|
148
175
|
|
@@ -157,12 +184,16 @@ module Greenhouse
|
|
157
184
|
def out_of_sync
|
158
185
|
unsynced.select do |branch|
|
159
186
|
lbranch = git.object(branch[0].name)
|
160
|
-
|
161
|
-
|
162
|
-
|
187
|
+
begin
|
188
|
+
rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
|
189
|
+
lcommit = lbranch.log.first
|
190
|
+
rcommit = rbranch.log.first
|
163
191
|
|
164
|
-
|
165
|
-
|
192
|
+
(rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)) ||
|
193
|
+
(!rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha))
|
194
|
+
rescue
|
195
|
+
true
|
196
|
+
end
|
166
197
|
end
|
167
198
|
end
|
168
199
|
|
@@ -11,7 +11,7 @@ module Greenhouse
|
|
11
11
|
project = Projects::Project.new(remote.match(/([^\/]*)\.git/)[1], {remote: remote})
|
12
12
|
|
13
13
|
if Projects::projects_file.projects.keys.include?(project.name) || Projects::projects_file.projects.values.map { |p| p['git'].downcase }.include?(project.repository.remote.downcase)
|
14
|
-
puts "
|
14
|
+
puts "Cannot add project. Another project with the same name already exists.".red
|
15
15
|
# TODO prompt to replace it?
|
16
16
|
# would need to probably remove the project, remove procs from procfile, resync project, reconfig, etc.
|
17
17
|
return
|
@@ -42,7 +42,7 @@ module Greenhouse
|
|
42
42
|
|
43
43
|
Projects::projects_file.write
|
44
44
|
|
45
|
-
puts "Added
|
45
|
+
puts "Added #{project.title.cyan} to the ecosystem."
|
46
46
|
project
|
47
47
|
end
|
48
48
|
|
@@ -6,28 +6,35 @@ module Greenhouse
|
|
6
6
|
|
7
7
|
def perform(project, verbose=false)
|
8
8
|
@project = project
|
9
|
-
|
10
9
|
@project.repository.fetch if verbose && @project.exists?
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
if !verbose
|
19
|
-
puts " \e[33mUncommitted Changes\e[0m" if @project.repository.changes?
|
20
|
-
puts " \e[33mUnpushed Branches\e[0m" if @project.repository.ahead?
|
21
|
-
puts " \e[33mUnpulled Branches\e[0m" if @project.repository.behind?
|
22
|
-
puts " \e[33mDiverged Branches\e[0m" if @project.repository.diverged?
|
11
|
+
Inkjet.indent do
|
12
|
+
print "#{@project.title.cyan} (#{@project.type.capitalize})"
|
13
|
+
undent do
|
14
|
+
#puts "#{@project.repository.remote}"
|
15
|
+
print " #{@project.exists? ? "Initialized".green : "Not Initialized".yellow}"
|
16
|
+
print ", #{@project.configured? ? "Configured".green : "Not Configured".yellow}" if @project.exists? && @project.is_a?(::Greenhouse::Projects::Application)
|
23
17
|
end
|
24
18
|
|
25
|
-
if
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
if @project.exists?
|
20
|
+
undent do
|
21
|
+
print ", "+"Uncommitted Changes".red if @project.repository.changes?
|
22
|
+
print ", "+"Unpushed Branches".blue if @project.repository.ahead?
|
23
|
+
print ", "+"Unpulled Branches".yellow if @project.repository.behind?
|
24
|
+
print ", "+"Diverged Branches".magenta if @project.repository.diverged?
|
25
|
+
print ", "+"Up-to-date".green if !@project.repository.changes? && !@project.repository.ahead? && @project.repository.up_to_date?
|
26
|
+
end
|
27
|
+
|
28
|
+
puts
|
29
|
+
|
30
|
+
if verbose
|
31
|
+
Inkjet.indent do
|
32
|
+
print_local_changes if @project.repository.changes?
|
33
|
+
print_unpushed_branches if @project.repository.ahead?
|
34
|
+
print_out_of_sync_branches if @project.repository.out_of_sync?
|
35
|
+
print_not_checked_out_branches if @project.repository.not_checked_out?
|
36
|
+
end
|
37
|
+
end
|
31
38
|
end
|
32
39
|
end
|
33
40
|
|
@@ -15,11 +15,12 @@ module Greenhouse
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def bundle(cmd='install')
|
18
|
-
puts "Running Bundler for
|
18
|
+
puts "Running Bundler for #{@project.title.cyan}..."
|
19
|
+
raise "hi"
|
19
20
|
@project.bundle(cmd)
|
20
21
|
true
|
21
22
|
rescue Exception => e
|
22
|
-
puts "
|
23
|
+
puts "Error running Bundler for #{@project.title.cyan}".red
|
23
24
|
puts "#{e.class.name}: #{e.message}"
|
24
25
|
puts e.backtrace
|
25
26
|
# TODO? prompt to continue?
|
@@ -27,7 +28,7 @@ module Greenhouse
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def clone
|
30
|
-
puts "Cloning
|
31
|
+
puts "Cloning #{@project.title.cyan} (#{@project.repository.remote}) into #{@project.path}..."
|
31
32
|
@project.repository.clone
|
32
33
|
|
33
34
|
# Ignore the project's ignored files
|
@@ -38,7 +39,7 @@ module Greenhouse
|
|
38
39
|
end
|
39
40
|
true
|
40
41
|
rescue Exception => e
|
41
|
-
puts "
|
42
|
+
puts "Could not clone #{@project.title.cyan}".red
|
42
43
|
puts "#{e.class.name}: #{e.message}"
|
43
44
|
puts e.backtrace
|
44
45
|
# TODO? prompt to continue?
|
@@ -46,7 +47,7 @@ module Greenhouse
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def pull
|
49
|
-
print "Checking
|
50
|
+
print "Checking #{@project.title.cyan} git remotes for upstream commits... "
|
50
51
|
|
51
52
|
@project.repository.fetch # fetch the latest from remotes
|
52
53
|
if @project.repository.out_of_sync?
|
@@ -63,7 +64,7 @@ module Greenhouse
|
|
63
64
|
merge = nil
|
64
65
|
stashed = false
|
65
66
|
if @project.repository.changes?(false)
|
66
|
-
puts "
|
67
|
+
puts "You have uncommitted local changes in #{@project.path.cyan} on branch #{@project.repository.git.branch.name.white}".yellow
|
67
68
|
while !['y','yes','n','no'].include?(merge) do
|
68
69
|
print "Would you like to stash your changes and merge the latest commits from upstream? ([y]es/[n]o): "
|
69
70
|
merge = STDIN.gets.chomp.downcase
|
@@ -122,58 +123,78 @@ module Greenhouse
|
|
122
123
|
return
|
123
124
|
else
|
124
125
|
begin
|
125
|
-
raise "Cound not push local branches" unless push_branches
|
126
|
-
|
127
|
-
|
126
|
+
#raise "Cound not push local branches" unless push_branches
|
127
|
+
push_branches
|
128
|
+
rescue Exception => e
|
129
|
+
puts e.message
|
130
|
+
puts e.backtrace
|
131
|
+
puts "There was a problem pushing local branches for #{@project.title.cyan}".yellow
|
128
132
|
puts "You may manually resolve conflicts in #{@project.path} and try again."
|
129
|
-
puts "
|
133
|
+
puts "Skipping #{@project.title.cyan}...".yellow
|
130
134
|
return
|
131
135
|
end
|
132
136
|
end
|
133
137
|
|
134
138
|
return true
|
135
139
|
else
|
136
|
-
puts "Nothing to push for
|
140
|
+
puts "Nothing to push for #{@project.title.cyan}"
|
137
141
|
end
|
138
142
|
end
|
139
143
|
|
140
|
-
|
141
|
-
def indent_spaces(indent=0)
|
142
|
-
indent.times.map {" "}.join
|
143
|
-
end
|
144
|
-
|
145
|
-
def print_local_changes(indent=0)
|
146
|
-
puts "#{indent_spaces indent}\e[33mYou have uncommitted changes in #{@project.title}!\e[0m"
|
147
|
-
puts "#{indent_spaces indent}The following files have uncommitted local modifications:"
|
144
|
+
def print_local_changes
|
148
145
|
puts
|
149
|
-
@project.
|
150
|
-
|
151
|
-
|
146
|
+
puts "You have uncommitted changes in #{@project.title.cyan}!".red
|
147
|
+
puts
|
148
|
+
Inkjet.indent do
|
149
|
+
@project.repository.changes.each do |name,file|
|
150
|
+
puts "#{file.untracked ? "U" : file.type} #{@project.path}/#{name}"
|
151
|
+
end
|
152
152
|
end
|
153
153
|
puts
|
154
154
|
end
|
155
155
|
|
156
|
-
def print_unpushed_branches
|
157
|
-
puts "#{indent_spaces indent}\e[33mYou have branches in #{@project.title} that haven't been pushed!\e[0m"
|
156
|
+
def print_unpushed_branches
|
158
157
|
puts
|
159
|
-
@project.
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
158
|
+
puts "You have branches in #{@project.title.cyan} that haven't been pushed!".blue
|
159
|
+
puts
|
160
|
+
Inkjet.indent do
|
161
|
+
@project.repository.ahead.each do |branch|
|
162
|
+
begin
|
163
|
+
rbranch = @project.repository.git.object("#{branch[1].name}/#{branch[0].name}")
|
164
|
+
puts "branch #{branch[0].name.bold} is #{"ahead".cyan} of #{branch[1].name.bold}/#{rbranch.name.bold}"
|
165
|
+
rescue Exception => e
|
166
|
+
puts "branch #{branch[0].name.bold} #{"does not exist".blue} on remote #{branch[1].name.bold}"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
@project.repository.diverged.each do |branch|
|
170
|
+
puts "branch #{branch[0].name.bold} and #{branch[1].name.bold}/#{branch[0].name.bold} have #{"diverged".magenta}"
|
171
|
+
end
|
164
172
|
end
|
165
173
|
puts
|
166
174
|
end
|
167
175
|
|
168
|
-
def print_out_of_sync_branches
|
169
|
-
puts
|
176
|
+
def print_out_of_sync_branches
|
177
|
+
puts
|
178
|
+
puts "You have out of sync branches in #{@project.title.cyan}".yellow
|
170
179
|
puts
|
171
|
-
|
172
|
-
|
180
|
+
Inkjet.indent do
|
181
|
+
@project.repository.behind.each do |branch|
|
182
|
+
puts "branch #{branch[0].name.bold} is #{"behind".yellow} #{branch[1].name.bold}/#{branch[0].name.bold}"
|
183
|
+
end
|
184
|
+
|
185
|
+
@project.repository.diverged.each do |branch|
|
186
|
+
puts "branch #{branch[0].name.bold} and #{branch[1].name}/#{branch[0].name.bold} have #{"diverged".magenta}"
|
187
|
+
end
|
173
188
|
end
|
189
|
+
puts
|
190
|
+
end
|
174
191
|
|
175
|
-
|
176
|
-
|
192
|
+
def print_not_checked_out_branches
|
193
|
+
puts
|
194
|
+
puts "The following branches are available to be checked out locally:".green
|
195
|
+
puts
|
196
|
+
@project.repository.not_checked_out.each do |branch|
|
197
|
+
puts "branch #{branch.full.split("/").last.bold} is #{"available".green} from #{branch.full.split("/")[1].bold}".indent
|
177
198
|
end
|
178
199
|
puts
|
179
200
|
end
|
@@ -271,14 +292,20 @@ module Greenhouse
|
|
271
292
|
def push_branches
|
272
293
|
@project.repository.out_of_sync.each do |branch|
|
273
294
|
begin
|
274
|
-
|
275
|
-
|
276
|
-
@project.repository.git.
|
277
|
-
|
295
|
+
# skip the merge if there's no remote branch
|
296
|
+
# TODO maybe check remote branches instead, or even better check for remote branch changes
|
297
|
+
rbranch = @project.repository.git.object("#{branch[1].name}/#{branch[0].name}")
|
298
|
+
begin
|
299
|
+
print "Attempting to merge #{branch[1].name}/#{branch[0].name} into #{branch[0].name} before pushing..."
|
300
|
+
@project.repository.git.checkout(branch[0].name)
|
301
|
+
@project.repository.git.merge("#{branch[1].name}/#{branch[0].name}")
|
302
|
+
puts "Success.".green
|
303
|
+
rescue
|
304
|
+
# TODO detect unmerged files, allow to resolve inline?
|
305
|
+
puts "Failed! Unresolved conflicts.".red
|
306
|
+
return false
|
307
|
+
end
|
278
308
|
rescue
|
279
|
-
# TODO detect unmerged files, allow to resolve inline?
|
280
|
-
puts "\e[31mFailed! Unresolved conflicts.\e[0m"
|
281
|
-
return false
|
282
309
|
end
|
283
310
|
end
|
284
311
|
|
@@ -286,7 +313,7 @@ module Greenhouse
|
|
286
313
|
@project.repository.branches.local.each do |branch|
|
287
314
|
@project.repository.push('origin', branch.name)
|
288
315
|
end
|
289
|
-
puts "
|
316
|
+
puts "Success.".green
|
290
317
|
return true
|
291
318
|
end
|
292
319
|
|
@@ -308,14 +335,14 @@ module Greenhouse
|
|
308
335
|
end
|
309
336
|
|
310
337
|
if %w(s skip).include?(commit)
|
311
|
-
puts "
|
338
|
+
puts "Skipping #{@project.title.cyan}...".yellow
|
312
339
|
return
|
313
340
|
elsif %w(c commit).include?(commit)
|
314
341
|
begin
|
315
342
|
raise "Could not commit local changes" unless commit_changes
|
316
343
|
rescue
|
317
|
-
puts "
|
318
|
-
puts "
|
344
|
+
puts "There was a problem committing local changes to #{@project.title.cyan}".red
|
345
|
+
puts "Skipping #{@project.title.cyan}...".yellow
|
319
346
|
return
|
320
347
|
end
|
321
348
|
end
|
@@ -333,15 +360,15 @@ module Greenhouse
|
|
333
360
|
end
|
334
361
|
|
335
362
|
if %w(s skip).include?(push)
|
336
|
-
puts "
|
363
|
+
puts "Skipping #{@project.title.cyan}...".yellow
|
337
364
|
return
|
338
365
|
elsif %w(p push).include?(push)
|
339
366
|
begin
|
340
367
|
raise "Cound not push local branches" unless push_branches
|
341
368
|
rescue
|
342
|
-
puts "
|
369
|
+
puts "There was a problem pushing local branches for #{@project.title.cyan}".yellow
|
343
370
|
puts "You may manually resolve conflicts in #{@project.path} and try again."
|
344
|
-
puts "
|
371
|
+
puts "Skipping #{@project.title.cyan}...".yellow
|
345
372
|
return
|
346
373
|
end
|
347
374
|
end
|
@@ -349,7 +376,7 @@ module Greenhouse
|
|
349
376
|
|
350
377
|
end
|
351
378
|
|
352
|
-
puts "
|
379
|
+
puts "Removing #{@project.title.cyan} project directory...".yellow
|
353
380
|
|
354
381
|
Projects::procfile.processes.delete_if do |key,process|
|
355
382
|
# this is sort of generic, just checks for the project name in the key/cmd
|
@@ -12,7 +12,7 @@ module Greenhouse
|
|
12
12
|
end
|
13
13
|
|
14
14
|
if ['r','remove'].include?(remove) || force
|
15
|
-
puts "
|
15
|
+
puts "Removing default config file...".yellow
|
16
16
|
Projects::dotenv.unlink
|
17
17
|
end
|
18
18
|
end
|
@@ -24,7 +24,7 @@ module Greenhouse
|
|
24
24
|
end
|
25
25
|
|
26
26
|
if ['r','remove'].include?(remove) || force
|
27
|
-
puts "
|
27
|
+
puts "Removing .projects file...".yellow
|
28
28
|
Projects::projects_file.unlink
|
29
29
|
end
|
30
30
|
end
|
@@ -36,7 +36,7 @@ module Greenhouse
|
|
36
36
|
end
|
37
37
|
|
38
38
|
if ['r','remove'].include?(remove) || force
|
39
|
-
puts "
|
39
|
+
puts "Removing .ignore file...".yellow
|
40
40
|
Projects::ignore_file.unlink
|
41
41
|
end
|
42
42
|
end
|
@@ -48,7 +48,7 @@ module Greenhouse
|
|
48
48
|
end
|
49
49
|
|
50
50
|
if ['r','remove'].include?(remove) || force
|
51
|
-
puts "
|
51
|
+
puts "Removing Procfile...".yellow
|
52
52
|
Projects::procfile.unlink
|
53
53
|
end
|
54
54
|
end
|
@@ -6,7 +6,7 @@ module Greenhouse
|
|
6
6
|
|
7
7
|
def perform(project)
|
8
8
|
@project = project
|
9
|
-
puts "
|
9
|
+
puts "Removing #{@project.title} from your .projects file...".yellow
|
10
10
|
Projects::projects_file.projects.delete_if { |name,project| name == @project.name }
|
11
11
|
Projects::projects_file.write
|
12
12
|
end
|
data/lib/greenhouse/version.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
module Greenhouse
|
2
|
-
VERSION = "0.0.
|
2
|
+
VERSION = "0.0.8"
|
3
3
|
end
|
4
4
|
|
5
5
|
__END__
|
6
|
+
0.0.8:
|
7
|
+
* Fix for git failures when remote branches don't yet exist
|
8
|
+
* Printing untracked remote branches in status
|
9
|
+
* Cleaned up the status command printouts overall to make them more compact and easier to read
|
10
|
+
* Utilizing inkjet gem for formatting, colors and indentation
|
11
|
+
|
6
12
|
0.0.7:
|
7
13
|
* Simple bundler command to run install/update for a single or all projects
|
8
14
|
* Refactor `status` command, renamed --verbose flag to --git, only fetching git remotes with --git flag
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greenhouse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: inkjet
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|