hangover 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Norman Timmler
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ Hangover
2
+ ========
3
+
4
+ Hangover is **time travel** (except the future) **for your source code** directory. Some call it the unlimited undo. It tracks every single file change in a git repository (`.hangover`). Hangover runs in the background. The file changes get committed to the next parent hangover repository. You can restore any state of your files from the moment on you started hangover.
5
+
6
+
7
+ Usage
8
+ -----
9
+
10
+ Start hangover in the directory from witch you want to track all changes by running
11
+
12
+ `hangover start`
13
+
14
+ Create a hangover repository in the same directory with
15
+
16
+ `hangover create`
17
+
18
+ All changes within this directory and it's subdirectory go into this repository.
19
+
20
+
21
+ Commands
22
+ --------
23
+
24
+ hangover <command> [options]
25
+
26
+ Commands:
27
+
28
+ start - Tracks all file changes within current directory and it's subdirectories.
29
+ stop - Stops hangover.
30
+ status - Shows if hangover is running and wich directory is tracked.
31
+ create - Creates a hangover repository in current directory.
32
+ git - Tunnels git commands on the hangover repository.
33
+ gitk - Starts gitk for the hangover repository.
34
+
35
+
36
+ Restoring files
37
+ ---------------
38
+
39
+ Given you want to restore your project directory like it was half an hour ago. Open gitk by running `hangover gitk` and find the wanted commit. Then checkout the commit by running `hangover git checkout <commit_hash>`. If you are done run `hangover git reset --hard HEAD` to get back to your latest files.
40
+
41
+
42
+ Multiple hangover repositories
43
+ ------------------------------
44
+
45
+ The hangover repositories are stored in a `.hangover` directory. You can create multiple repositories in different places to separate projects.
46
+
47
+ projects
48
+ \_ .hangover
49
+ homepage
50
+ customer_website
51
+ \_ .hangover
52
+ images
53
+ stylesheets
54
+
55
+ In this example all changes in the `homepage` directory got to the `.hangover` repository hanging directly under `projects`. All changes in `customer_website` and it's subdirectories get tracked in it's own repository.
data/bin/hangover CHANGED
@@ -3,19 +3,34 @@ require 'fileutils'
3
3
  require 'optparse'
4
4
 
5
5
  command = ARGV.shift
6
- ARGV.unshift('-h') if command == '-h'
6
+ ARGV.unshift('-h') if command == '-h' || command.nil?
7
7
  options = {}
8
8
 
9
9
  if command == 'git'
10
10
  options[:args] = ARGV.join(' ')
11
11
  else
12
12
  OptionParser.new do |opts|
13
- opts.banner = "Usage: hangover <command> [options]"
13
+ opts.banner = <<-EOS
14
+ Usage: hangover <command> [options]
15
+
16
+ Commands:
17
+
18
+ start - Tracks all file changes within current directory and it's subdirectories.
19
+ stop - Stops hangover.
20
+ status - Shows if hangover is running and wich directory is tracked.
21
+ create - Creates a hangover repository in current directory.
22
+ git - Tunnels git commands on the hangover repository.
23
+ gitk - Starts gitk for the hangover repository.
24
+
25
+ Options:
26
+
27
+ EOS
14
28
  opts.on("-d", "--debug", "Generate debug output on $stderr") do |d|
15
29
  $HANGOVER_DEBUG = true
16
30
  end
17
31
  opts.on("-h", "--help", "Display this help screen") do
18
32
  puts opts
33
+ puts "\nCopyright (c) Norman Timmler at tmp8 in 2011. Licensed under MIT."
19
34
  exit
20
35
  end
21
36
  end.parse!
data/hangover.gemspec CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
7
7
  s.version = Hangover::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Norman Timmler"]
10
- s.email = ["norma.timmler@gmail.com"]
11
- s.homepage = ""
12
- s.summary = %q{Unlimited undo.}
13
- s.description = %q{Saves every change in a repositiory.}
10
+ s.email = ["norman.timmler@gmail.com"]
11
+ s.homepage = "http://github.com/unnu/hangover"
12
+ s.summary = %q{Hangover is time travel for your source code directory.}
13
+ s.description = %q{Some call it the unlimited undo. It tracks every single file change in a git repository. Hangover runs in the background. The file changes get committed to the next parent hangover repository. You can restore any state of your files from the moment on you started hangover.}
14
14
 
15
15
  s.rubyforge_project = "hangover"
16
16
 
@@ -18,4 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
+ s.add_dependency "rb-fsevent", ">=0.4.0"
22
+ s.add_dependency "i18n", ">=0.5.0"
23
+ s.add_dependency "activesupport", ">=3.0.3"
21
24
  end
data/lib/hangover.rb CHANGED
@@ -32,8 +32,8 @@ class Hangover
32
32
  next if diff.blank?
33
33
 
34
34
  tokenizer = DiffTokenizer.new(diff)
35
-
36
35
  message = CommitMessageBuilder.new(tokenizer.top_adds, tokenizer.top_subs).message
36
+
37
37
  repository.add_all
38
38
  repository.commit_all(message)
39
39
  end
@@ -100,7 +100,7 @@ class Hangover
100
100
  Process.kill(0, pid) == 1 if pid
101
101
  rescue Errno::ESRCH
102
102
  if File.exist?(pid_file)
103
- logger.info "Removing stale pid file."
103
+ logger.warn "Removing stale pid file."
104
104
  remove_pid
105
105
  end
106
106
  false
@@ -1,3 +1,3 @@
1
1
  module Hangover
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Norman Timmler
@@ -14,13 +14,57 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-28 00:00:00 +02:00
17
+ date: 2011-04-08 00:00:00 +02:00
18
18
  default_executable:
19
- dependencies: []
20
-
21
- description: Saves every change in a repositiory.
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rb-fsevent
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 4
31
+ - 0
32
+ version: 0.4.0
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: i18n
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ - 5
46
+ - 0
47
+ version: 0.5.0
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: activesupport
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 3
60
+ - 0
61
+ - 3
62
+ version: 3.0.3
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ description: Some call it the unlimited undo. It tracks every single file change in a git repository. Hangover runs in the background. The file changes get committed to the next parent hangover repository. You can restore any state of your files from the moment on you started hangover.
22
66
  email:
23
- - norma.timmler@gmail.com
67
+ - norman.timmler@gmail.com
24
68
  executables:
25
69
  - hangover
26
70
  extensions: []
@@ -32,6 +76,8 @@ files:
32
76
  - .rvmrc
33
77
  - Gemfile
34
78
  - Gemfile.lock
79
+ - LICENSE
80
+ - README.md
35
81
  - Rakefile
36
82
  - bin/hangover
37
83
  - foo
@@ -50,7 +96,7 @@ files:
50
96
  - test/hangover_test.rb
51
97
  - test/test_helper.rb
52
98
  has_rdoc: true
53
- homepage: ""
99
+ homepage: http://github.com/unnu/hangover
54
100
  licenses: []
55
101
 
56
102
  post_install_message:
@@ -80,7 +126,7 @@ rubyforge_project: hangover
80
126
  rubygems_version: 1.3.7
81
127
  signing_key:
82
128
  specification_version: 3
83
- summary: Unlimited undo.
129
+ summary: Hangover is time travel for your source code directory.
84
130
  test_files:
85
131
  - test/commit_message_builder_test.rb
86
132
  - test/diff_tokenizer_test.rb