greenhouse 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e392ae36dc3e9abf2e9cabffc067e27418633b31
4
- data.tar.gz: 935734f05718a35a1e701c9ae7cd5c6535b80aff
3
+ metadata.gz: 46f9163d7afb19a3167ba11589fde5aa3ce2db83
4
+ data.tar.gz: b8669a7f66ffc5ccbaa4549daf7b432fc9ca3454
5
5
  SHA512:
6
- metadata.gz: 6bb6c93fcb847fa5833c39a41d6452dd33572225aaf1ae33fd0f8a79d67e8720517435eaccec8f8ec0d240f8c65e509d5c0ed9aa5ed66ac18c4298db7c08bf07
7
- data.tar.gz: 6647ec4bf8a6116c6363be50aed4890bc6f943c1659d50c13355c20c500f9bb4aeab1a4c62ec308ec146974237318849ffa0ea508783057cc0832fd8dcb82452
6
+ metadata.gz: a627df75f673da9436f78fee0f09ec6cc3d7220ef74a8a38309a058c8f49872aac1ab68dd5ffee93044bae503ce17e59a412359c5caf99fd2171a427754655f0
7
+ data.tar.gz: 719c6daafae8f253c9066d636052e942b925fa74b71ad7c59312a6b00c659acb5d98becaaa5f74993171acda3ff05400155a460a7c470e14dcaf50d1c1d664af
data/lib/greenhouse.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'bundler'
2
2
  require 'rake'
3
3
  require 'active_support/inflector'
4
+ require 'inkjet'
4
5
  require 'greenhouse/version'
5
6
  require 'greenhouse/resources'
6
7
  require 'greenhouse/projects'
@@ -13,7 +13,7 @@ module Greenhouse
13
13
  # Tasks::ProjectStatus.perform(project)
14
14
  #end
15
15
  Projects.projects.each do |project|
16
- puts " \e[36m#{project.title}\e[0m"
16
+ puts " #{project.title.cyan}"
17
17
  end
18
18
  puts
19
19
  print "Would you like to add another project? ([y]es/[N]o): "
@@ -48,7 +48,7 @@ IGNORE
48
48
 
49
49
  after_hook do
50
50
  puts
51
- puts "New ecosystem initialized in \e[36m#{Projects::path}\e[0m"
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 " \e[36m#{project.title}\e[0m"
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 "\e[31mError parsing .env file for #{app.title}.\e[0m"
67
+ puts "Error parsing .env file for #{app.title.cyan}.".red
68
68
  exit 1
69
69
  end
70
70
  else
71
- puts "\e[33mWarning: No .env file found in #{app.title}!\e[0m"
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 "\e[31mNo Procfile found for #{app.title}\e[0m"
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 \e[36m#{project.title}\e[0m does not exist. Try initializing it with `greenhouse init`"
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 "\e[33mDone\e[0m"
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 \e[36m#{project.title}\e[0m does not exist. Try initializing it with `greenhouse init`"
32
+ puts "Project #{project.title.cyan} does not exist. Try initializing it with `greenhouse init`"
33
33
  return
34
34
  end
35
35
 
@@ -46,7 +46,6 @@ USAGE
46
46
  end
47
47
 
48
48
  Projects::send(project_type).each do |project|
49
- puts
50
49
  Tasks::ProjectStatus.perform(project, with_git?)
51
50
  end
52
51
  end
@@ -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
- rcommit = git.object("#{remote.name}/#{branch.name}").log.first
89
- next if lcommit.sha == rcommit.sha
90
- branches << [branch, remote]
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
- rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
106
- lcommit = lbranch.log.first
107
- rcommit = rbranch.log.first
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
- !rbranch.log.map(&:sha).include?(lcommit.sha) && lbranch.log.map(&:sha).include?(rcommit.sha)
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
- rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
125
- lcommit = lbranch.log.first
126
- rcommit = rbranch.log.first
127
-
128
- rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)
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
- rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
142
- lcommit = lbranch.log.first
143
- rcommit = rbranch.log.first
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
- !rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)
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
- rbranch = git.object("#{branch[1].name}/#{branch[0].name}")
161
- lcommit = lbranch.log.first
162
- rcommit = rbranch.log.first
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
- (rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha)) ||
165
- (!rbranch.log.map(&:sha).include?(lcommit.sha) && !lbranch.log.map(&:sha).include?(rcommit.sha))
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 "\e[31mCannot add project. Another project with the same name already exists.\e[0m"
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 \e[36m#{project.title}\e[0m to the ecosystem."
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
- puts " \e[36m#{@project.title}\e[0m (#{@project.type.capitalize})"
13
- puts " #{@project.repository.remote}"
14
- puts " #{@project.exists? ? "\e[32mInitialized" : "\e[33mNot Initialized"}\e[0m"
15
- puts " #{@project.configured? ? "\e[32mConfigured" : "\e[33mNot Configured"}\e[0m" if @project.exists? && @project.is_a?(::Greenhouse::Projects::Application)
16
-
17
- if @project.exists?
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 !@project.repository.changes? && !@project.repository.ahead? && @project.repository.up_to_date?
26
- puts " \e[32mUp-to-date\e[0m"
27
- elsif verbose
28
- print_local_changes(4) if @project.repository.changes?
29
- print_unpushed_branches(4) if @project.repository.ahead?
30
- print_out_of_sync_branches(4) if @project.repository.out_of_sync?
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 \e[36m#{@project.title}\e[0m..."
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 "\e[31mError running Bundler for #{@project.title}\e[0m"
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 \e[36m#{@project.title}\e[0m (#{@project.repository.remote}) into #{@project.path}..."
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 "\e[31mCould not clone #{@project.title}\e[0m"
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 \e[36m#{@project.title}\e[0m git remotes for upstream commits... "
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 "\e[33mYou have uncommitted local changes in #{@project.path} on branch #{@project.repository.git.branch.name}\e[0m"
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
- rescue
127
- puts "\e[33mThere was a problem pushing local branches for #{@project.title}\e[0m"
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 "\e[33mSkipping #{@project.title}...\e[0m"
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 \e[36m#{@project.title}\e[0m."
140
+ puts "Nothing to push for #{@project.title.cyan}"
137
141
  end
138
142
  end
139
143
 
140
- # TODO move this to a logger class
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.repository.changes.each do |name,file|
150
- print "#{indent_spaces indent}#{file.untracked ? "U" : file.type}"
151
- puts " #{@project.path}/#{name}"
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(indent=0)
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.repository.ahead.each do |branch|
160
- puts "#{indent_spaces indent} branch #{branch[0].name} is ahead of #{branch[1].name}/#{branch[0].name}"
161
- end
162
- @project.repository.diverged.each do |branch|
163
- puts "#{indent_spaces indent} branch #{branch[0].name} and #{branch[1].name}/#{branch[0].name} have diverged"
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(indent=0)
169
- puts "#{indent_spaces indent}\e[33mYou have out of sync branches in #{@project.title}\e[0m"
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
- @project.repository.behind.each do |branch|
172
- puts "#{indent_spaces indent} \e[37mbranch\e[0m #{branch[0].name} \e[37mis behind\e[0m #{branch[1].name}/#{branch[0].name}"
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
- @project.repository.diverged.each do |branch|
176
- puts "#{indent_spaces indent} \e[37mbranch\e[0m #{branch[0].name} \e[37mand\e[0m #{branch[1].name}/#{branch[0].name} \e[37mhave diverged\e[0m"
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
- print "Attempting to merge #{branch[1].name}/#{branch[0].name} into #{branch[0].name} before pushing..."
275
- @project.repository.git.checkout(branch[0].name)
276
- @project.repository.git.merge("#{branch[1].name}/#{branch[0].name}")
277
- puts "\e[32mSuccess.\e[0m"
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 "\e[32mSuccess.\e[0m"
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 "\e[33mSkipping #{@project.title}...\e[0m"
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 "\e[33mThere was a problem committing local changes to #{@project.title}\e[0m"
318
- puts "\e[33mSkipping #{@project.title}...\e[0m"
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 "\e[33mSkipping #{@project.title}...\e[0m"
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 "\e[33mThere was a problem pushing local branches for #{@project.title}\e[0m"
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 "\e[33mSkipping #{@project.title}...\e[0m"
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 "\e[33mRemoving #{@project.title} project directory...\e[0m"
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 "\e[33mRemoving default config file...\e[0m"
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 "\e[33mRemoving .projects file...\e[0m"
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 "\e[33mRemoving .ignore file...\e[0m"
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 "\e[33mRemoving Procfile...\e[0m"
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 "\e[33mRemoving #{@project.title} from your .projects file...\e[0m"
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
@@ -1,8 +1,14 @@
1
1
  module Greenhouse
2
- VERSION = "0.0.7"
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.7
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-06 00:00:00.000000000 Z
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