gtt 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bfa383a361a4e7d9f6abcd570f1cd083f0871f55
4
+ data.tar.gz: f43cbd41a41c6d0d98711b9b6fe83b0b244cfe49
5
+ SHA512:
6
+ metadata.gz: d2eb9e31fbcbe224bd7b2c3a0b71b50137917ce2bbbe4b69e29f6c17cb08e8d7035056a93e150ed49ca2388201d215862bb61e8da92fb6e7e32b801c3954b93f
7
+ data.tar.gz: dd9641c5f355b02dff8ae3742a90d58908d8820538eec2221c263a5e315de5564fb414f7aa7d187889bd3ddc7e8e8a0f1f6b363b00db18378d11cc363e5131a6
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1 @@
1
+ gtt
@@ -0,0 +1 @@
1
+ 2.1.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gtt.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Lucas Videla
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # gtt. git time-traveler
2
+
3
+ A tool that makes it easier to travel through time inside git repos
4
+
5
+ ## Installation
6
+
7
+ $ gem install gtt
8
+
9
+ ## Usage
10
+
11
+ > **Note:** this gem should be used inside a repo. No commits should be done while traveling through time, unless you really know what you are doing.
12
+
13
+ * Set the repo for time-traveling
14
+
15
+ $ gtt --init
16
+ Initialized gtt-tags. Now you can traverse
17
+
18
+ When you execute `gtt --init` you get two tags in your repo: one at the very top, and other one at the bottom. Those are your marks to travel through the commits.
19
+
20
+ * Travel back in time
21
+
22
+ $ gtt --prev
23
+ Previous HEAD position was 6fc9bb5... #6
24
+ HEAD is now at 82c2874... #5
25
+ Traveled back in time!
26
+
27
+ This command moves you one step back in time.
28
+
29
+ * Travel into the future
30
+
31
+ $ gtt --next
32
+ Previous HEAD position was 82c2874... #5
33
+ HEAD is now at 6fc9bb5... #6
34
+ Moved on
35
+
36
+ This command moves you one step ahead in time.
37
+
38
+ * Cleanup all the mess before continue working with your repo
39
+
40
+ $ gtt --clean
41
+ HEAD is now at 6fc9bb5... #6
42
+ Deleted tag 'gtt-first' (was 2083bac)
43
+ Deleted tag 'gtt-last' (was 6fc9bb5)
44
+ Removed gtt-tags. Now your repo is clean
45
+
46
+ Cleaning a repo will set you in the present time of the repo, and remove extra tags. In short, it will leave the repo exactly as before using `gtt`.
47
+
48
+ ## Contributing
49
+
50
+ 1. Fork it
51
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
52
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
53
+ 4. Push to the branch (`git push origin my-new-feature`)
54
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/gtt ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'getoptlong'
4
+
5
+ status = true
6
+
7
+ opts = GetoptLong.new(
8
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
9
+ [ '--init', '-i', GetoptLong::NO_ARGUMENT ],
10
+ [ '--prev', '-p', GetoptLong::NO_ARGUMENT ],
11
+ [ '--next', '-n', GetoptLong::NO_ARGUMENT ],
12
+ [ '--clean', '-c', GetoptLong::NO_ARGUMENT ]
13
+ )
14
+
15
+ opts.each do |opt, arg|
16
+ case opt
17
+ when '--help'
18
+ puts <<-EOF
19
+ gtt [OPTION]
20
+
21
+ -h, --help:
22
+ show help
23
+
24
+ -i, --init:
25
+ creates gtt-tags for traverse
26
+
27
+ -c, --clean:
28
+ removes gtt-tags
29
+
30
+ -p, --prev:
31
+ travels back one commit
32
+
33
+ -n, --next:
34
+ travels forth one commit
35
+
36
+ EOF
37
+ when '--init'
38
+ # check NOT initialized
39
+ status &= system 'git tag gtt-first `git rev-list --topo-order HEAD | tail -1`'
40
+ status &= system 'git tag gtt-last'
41
+ puts 'Initialized gtt-tags. Now you can traverse' if status
42
+ when '--clean'
43
+ # check if initialized
44
+ status &= system 'git checkout gtt-last'
45
+ status &= system 'git tag -d gtt-first'
46
+ status &= system 'git tag -d gtt-last'
47
+ puts 'Removed gtt-tags. Now your repo is clean' if status
48
+ when '--prev'
49
+ # check if initialized
50
+ status &= system 'git checkout HEAD~'
51
+ puts 'Traveled back in time!' if status
52
+ puts 'You are already at the beginning of the time' if !status
53
+ when '--next'
54
+ # check if initialized
55
+ status &= system 'git checkout `git rev-list --topo-order HEAD..gtt-last | tail -1`'
56
+ puts 'Moved on' if status
57
+ end
58
+ end
59
+
60
+ if ARGV.length != 0
61
+ puts "Command does not take any argument (try --help)"
62
+ exit 0
63
+ end
64
+
65
+ exit status ? 0 : 1
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gtt/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gtt"
8
+ spec.version = Gtt::VERSION
9
+ spec.authors = ["Lucas Videla"]
10
+ spec.email = ["videla.lucas@gmail.com"]
11
+ spec.summary = %q{A tool that makes it easier to travel through time inside git repos}
12
+ spec.homepage = ""
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "minitest", "~> 5.2.0"
23
+ end
@@ -0,0 +1,5 @@
1
+ require "gtt/version"
2
+
3
+ module Gtt
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module Gtt
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gtt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Lucas Videla
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 5.2.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 5.2.0
55
+ description:
56
+ email:
57
+ - videla.lucas@gmail.com
58
+ executables:
59
+ - gtt
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".ruby-gemset"
65
+ - ".ruby-version"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/gtt
71
+ - gtt.gemspec
72
+ - lib/gtt.rb
73
+ - lib/gtt/version.rb
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: A tool that makes it easier to travel through time inside git repos
98
+ test_files: []