utsup 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +4 -0
  3. data/lib/sup.rb +18 -4
  4. metadata +2 -2
  5. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.0.5
2
+
3
+ * added sup push
4
+
1
5
  === 0.0.1 2009-09-28
2
6
 
3
7
  * 1 major enhancement:
data/lib/sup.rb CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
6
6
  require 'git'
7
7
 
8
8
  module Sup
9
- VERSION = '0.0.4'
9
+ VERSION = '0.0.5'
10
10
  GIT_HOOKS = %w(post-commit post-receive post-merge post-checkout) #TODO: post-rebase?
11
11
 
12
12
  GLOBAL_CONFIG_PATH = '~/.utsup'
@@ -47,6 +47,8 @@ by Nick Merwin (Lemur Heavy Industries)
47
47
 
48
48
  users # get list of users in company
49
49
  <user name> # get last day's worth of status updates from specified user
50
+
51
+ push # triggers a git push + update
50
52
  eos
51
53
 
52
54
  class << self
@@ -148,9 +150,13 @@ eos
148
150
  :message => git.branch.name
149
151
 
150
152
  when "push":
151
- Api::Status.add :status_type => "StatusPush",
152
- :message => git.branch.name
153
-
153
+ resp = `git push #{args[1..-1]*' '} 2>&1`
154
+ puts resp
155
+ unless resp =~ /Everything up-to-date/
156
+ Api::Status.add :status_type => "StatusPush",
157
+ :message => git.branch.name
158
+ end
159
+
154
160
  when "receive":
155
161
  Api::Status.add :status_type => "StatusReceive",
156
162
  :message => git.branch.name
@@ -225,6 +231,11 @@ eos
225
231
 
226
232
  class Status < Base
227
233
  def self.add(attributes)
234
+ unless self.project_id
235
+ puts "You're not in a project."
236
+ return
237
+ end
238
+
228
239
  create attributes.merge({:project_id => @@project_id})
229
240
  end
230
241
  end
@@ -277,8 +288,11 @@ eos
277
288
  Sup::check_out args.last
278
289
  puts "Checked out."
279
290
 
291
+ # --- Git -----------------
280
292
  when "git":
281
293
  Sup::git_update args
294
+ when "push":
295
+ Sup::git_update "push"
282
296
 
283
297
  when "nm":
284
298
  Sup::undo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utsup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Merwin
@@ -30,7 +30,7 @@ cert_chain:
30
30
  DrswbWvrKlA=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-09-29 00:00:00 -07:00
33
+ date: 2009-09-30 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file