space 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,55 @@
1
1
  # Space [![Build Status](https://secure.travis-ci.org/svenfuchs/space.png?branch=master)](http://travis-ci.org/svenfuchs/space)
2
2
 
3
- # TODO
3
+ Here's a screenshot of my setup (iterm, tmux, vim, space) for working on
4
+ [travis](http://github.com/travis-ci).
5
+
6
+ ![tmux based travis workspace](http://img.skitch.com/20120410-d4qk8ce75h6x7i7g7i2cbtjnn8.png)
7
+
8
+ The thing on the right side is an iterm split pane running space. The main
9
+ screen is take by a tmux session that has a vim and a zsh pane. (I use an iterm
10
+ pane for space so that I can switch between tmux windows but keep the space
11
+ view.)
12
+
13
+ The space view gives an overview of:
14
+
15
+ * current branch
16
+ * current commit
17
+ * bundler local flag
18
+ * git status (clean, dirty, ahead)
19
+ * bundle status (`bundle check`)
20
+ * dependencies
21
+
22
+ One can easily see that:
23
+
24
+ * repos 1-5 are using the bundler local flag, while 6-7 are using remote
25
+ references
26
+ * repos 4, 6, 7 have dirty working directories
27
+ * repo 6 is 1 commit ahead of origin
28
+ * the bundle in repo 7 is not installed
29
+
30
+ Space checks for each dependency listed in a repo's Gemfile if the bundle is
31
+ locked to the hash that is currently checked out locally and display that
32
+ status information.
33
+
34
+ Also note that the repo numbers are referring to the tmux windows where
35
+ possible.
36
+
37
+ This screencast is from a very early version but still mostly valid. It also
38
+ demonstrates how screen can be used to run commands on multiple repositories at
39
+ once:
40
+
41
+ [![screencast](http://img.skitch.com/20120410-gyiprdiy8jyhwwp3pd4gafk3tu.png)](www.youtube.com/watch?v=NfYZysobsYo)
42
+
43
+ This is what the `~/.space/travis.yml` file for this setup looks like:
44
+
45
+ base_dir: ~/Development/projects/travis
46
+ repositories:
47
+ - travis-ci
48
+ - travis-hub
49
+ - travis-listener
50
+ - travis-core
51
+ - travis-support
52
+ - travis-worker
53
+ - travis-build
54
+
4
55
 
5
- * warn if some but not all repos are set to local
data/TODO ADDED
@@ -0,0 +1 @@
1
+ * warn if some but not all repos are set to local
@@ -5,4 +5,3 @@ module Enumerable
5
5
  result
6
6
  end unless method_defined?(:map_slice)
7
7
  end
8
-
@@ -2,6 +2,6 @@ require 'ansi/core'
2
2
 
3
3
  class String
4
4
  def deansi
5
- gsub(ANSI::Code::PATTERN, '')
5
+ gsub(/\e\[[\d]+(?:;[\d]+)?m/, '')
6
6
  end
7
7
  end
@@ -1,6 +1,5 @@
1
1
  class String
2
2
  def wrap(width)
3
- gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n")
3
+ gsub(/(.{1,#{width}})( +|$\n?)|(.{1,#{width}})/, "\\1\\3\n").chomp
4
4
  end unless method_defined?(:wrap)
5
5
  end
6
-
@@ -6,7 +6,9 @@ module Space
6
6
  ALIASES = {
7
7
  '' => 'scope',
8
8
  '-' => 'unscope',
9
- 'r' => 'refresh'
9
+ '!' => 'refresh',
10
+ 'r' => 'remote',
11
+ 'l' => 'local'
10
12
  }
11
13
  attr_reader :project
12
14
 
@@ -17,6 +17,14 @@ module Space
17
17
  super(repo.path)
18
18
  end
19
19
 
20
+ def branch
21
+ result(:branch) =~ /^\* (.+)/ && $1.strip
22
+ end
23
+
24
+ def commit
25
+ result(:commit) =~ /^commit (\S{7})/ && $1
26
+ end
27
+
20
28
  def status
21
29
  dirty? ? :dirty : (ahead? ? :ahead : :clean)
22
30
  end
@@ -25,25 +33,17 @@ module Space
25
33
  !clean?
26
34
  end
27
35
 
28
- def ahead?
29
- ahead > 0
36
+ def clean?
37
+ result(:status) =~ /working directory clean/m
30
38
  end
31
39
 
32
- def clean?
33
- result(:status) =~ /nothing to commit (working directory clean)/
40
+ def ahead?
41
+ ahead > 0
34
42
  end
35
43
 
36
44
  def ahead
37
45
  result(:status) =~ /Your branch is ahead of .* by (\d+) commits?\./ ? $1.to_i : 0
38
46
  end
39
-
40
- def branch
41
- result(:branch) =~ /^\* (.+)/ && $1.strip
42
- end
43
-
44
- def commit
45
- result(:commit) =~ /^commit (\S{7})/ && $1
46
- end
47
47
  end
48
48
  end
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module Space
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: space
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-09 00:00:00.000000000 Z
12
+ date: 2012-04-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: space.
15
15
  email:
@@ -64,6 +64,7 @@ files:
64
64
  - LICENSE
65
65
  - Rakefile
66
66
  - README.md
67
+ - TODO
67
68
  - !binary |-
68
69
  YmluL3NwYWNl
69
70
  homepage: https://github.com/svenfuchs/space