lolcommits 0.3.2 → 0.3.3
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.
- data/CHANGELOG +3 -0
- data/features/bugs.feature +7 -34
- data/features/step_definitions/lolcommits_steps.rb +3 -1
- data/features/support/env.rb +16 -0
- data/lib/lolcommits/git_info.rb +4 -3
- data/lib/lolcommits/runner.rb +12 -1
- data/lib/lolcommits/version.rb +1 -1
- data/lolcommits.gemspec +1 -1
- metadata +10 -4
data/CHANGELOG
CHANGED
data/features/bugs.feature
CHANGED
@@ -15,37 +15,10 @@ Feature: Bug regression testing
|
|
15
15
|
#
|
16
16
|
# issue #68, https://github.com/mroth/lolcommits/issues/68
|
17
17
|
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
# And I do a git commit
|
26
|
-
# And I successfully run `git tag 'vC'`
|
27
|
-
# And I do a git commit
|
28
|
-
# And I successfully run `git tag 'vD'`
|
29
|
-
# And I do a git commit
|
30
|
-
# And I successfully run `git tag 'vE'`
|
31
|
-
# And I do a git commit
|
32
|
-
# And I successfully run `git tag 'vF'`
|
33
|
-
# And I successfully run `git checkout vB`
|
34
|
-
# And I successfully run `git reset --soft master`
|
35
|
-
# And I successfully run `git merge --squash vD`
|
36
|
-
# When I successfully run `git rebase --onto $(cat .git/HEAD) vE vF`
|
37
|
-
# # When I successfully run `git rebase placeholder`
|
38
|
-
# Then there should be 4 commit entries in the git log
|
39
|
-
# # But there should be exactly 5 jpgs in "../.lolcommits/yuh8history"
|
40
|
-
|
41
|
-
# Given I am in a git repository named "yuh8history" with lolcommits enabled
|
42
|
-
# And I do 2 git commits
|
43
|
-
# And I successfully run `git branch middle`
|
44
|
-
# And I do 2 git commits
|
45
|
-
# And I successfully run `git branch placeholder`
|
46
|
-
# And I successfully run `git checkout middle`
|
47
|
-
# And I do 2 git commits
|
48
|
-
# When I successfully run `git rebase placeholder`
|
49
|
-
# Then there should be 6 commit entries in the git log
|
50
|
-
# But there should be exactly 6 jpgs in "../.lolcommits/yuh8history"
|
51
|
-
|
18
|
+
@fake-interactive-rebase @slow_process
|
19
|
+
Scenario: Don't trigger capture during a git rebase
|
20
|
+
Given I am in a git repository named "yuh8history" with lolcommits enabled
|
21
|
+
And I do 6 git commits
|
22
|
+
When I successfully run `git rebase -i HEAD~5`
|
23
|
+
# Then there should be 4 commit entries in the git log
|
24
|
+
Then there should be exactly 6 jpgs in "../.lolcommits/yuh8history"
|
@@ -87,10 +87,12 @@ end
|
|
87
87
|
When /^I do (\d+) git commits$/ do |n|
|
88
88
|
n.to_i.times do
|
89
89
|
step %{I do a git commit}
|
90
|
+
sleep 0.1
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
93
94
|
Then /^there should be (\d+) commit entries in the git log$/ do |n|
|
94
|
-
|
95
|
+
sleep 1 #let the file writing catch up
|
95
96
|
assert_equal n.to_i, `git shortlog | grep -E '^[ ]+\w+' | wc -l`.chomp.to_i
|
96
97
|
end
|
98
|
+
|
data/features/support/env.rb
CHANGED
@@ -35,3 +35,19 @@ After do
|
|
35
35
|
ENV['HOME'] = @original_home
|
36
36
|
ENV['LAUNCHY_DRY_RUN'] = nil
|
37
37
|
end
|
38
|
+
|
39
|
+
Before('@fake-interactive-rebase') do
|
40
|
+
# in order to fake an interactive rebase,
|
41
|
+
# we replace the editor with a script that simply squashes a few random commits
|
42
|
+
@original_git_editor = ENV['GIT_EDITOR']
|
43
|
+
# ENV['GIT_EDITOR'] = "sed -i -e 'n;s/pick/squash/g'" #every other commit
|
44
|
+
ENV['GIT_EDITOR'] = "sed -i -e '3,5 s/pick/squash/g'" #lines 3-5
|
45
|
+
end
|
46
|
+
|
47
|
+
After('@fake-interactive-rebase') do
|
48
|
+
ENV['GIT_EDITOR'] = @original_git_editor
|
49
|
+
end
|
50
|
+
|
51
|
+
Before('@slow_process') do
|
52
|
+
@aruba_io_wait_seconds = 3
|
53
|
+
end
|
data/lib/lolcommits/git_info.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module Lolcommits
|
2
2
|
class GitInfo
|
3
|
-
attr_accessor :sha, :message
|
3
|
+
attr_accessor :sha, :message, :repo_internal_path
|
4
4
|
def initialize
|
5
|
-
|
6
|
-
commit =
|
5
|
+
g = Git.open('.')
|
6
|
+
commit = g.log.first
|
7
7
|
|
8
8
|
self.message = commit.message.split("\n").first
|
9
9
|
self.sha = commit.sha[0..10]
|
10
|
+
self.repo_internal_path = g.repo.path
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
data/lib/lolcommits/runner.rb
CHANGED
@@ -4,7 +4,7 @@ module Lolcommits
|
|
4
4
|
|
5
5
|
class Runner
|
6
6
|
attr_accessor :capture_delay, :capture_device, :message, :sha,
|
7
|
-
:snapshot_loc, :main_image, :repo, :config
|
7
|
+
:snapshot_loc, :main_image, :repo, :config, :repo_internal_path
|
8
8
|
|
9
9
|
include ActiveSupport::Callbacks
|
10
10
|
define_callbacks :run
|
@@ -27,10 +27,13 @@ module Lolcommits
|
|
27
27
|
git_info = GitInfo.new
|
28
28
|
self.sha = git_info.sha if self.sha.nil?
|
29
29
|
self.message = git_info.message if self.message.nil?
|
30
|
+
self.repo_internal_path = git_info.repo_internal_path
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
34
|
def run
|
35
|
+
die_if_rebasing!
|
36
|
+
|
34
37
|
run_callbacks :run do
|
35
38
|
puts "*** Preserving this moment in history."
|
36
39
|
self.snapshot_loc = self.config.raw_image
|
@@ -47,6 +50,14 @@ module Lolcommits
|
|
47
50
|
end
|
48
51
|
|
49
52
|
protected
|
53
|
+
def die_if_rebasing!
|
54
|
+
if not self.repo_internal_path.nil?
|
55
|
+
mergeclue = File.join self.repo_internal_path, "rebase-merge"
|
56
|
+
if File.directory? mergeclue
|
57
|
+
exit 0
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
50
61
|
|
51
62
|
def resize_snapshot!
|
52
63
|
canvas = ImageList.new(self.snapshot_loc)
|
data/lib/lolcommits/version.rb
CHANGED
data/lolcommits.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
|
28
28
|
s.add_development_dependency('rdoc')
|
29
29
|
s.add_development_dependency('aruba')
|
30
|
-
s.add_development_dependency('rake','~> 0.
|
30
|
+
s.add_development_dependency('rake','~> 10.0.2')
|
31
31
|
s.add_development_dependency('fivemat')
|
32
32
|
s.add_development_dependency('faker')
|
33
33
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
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-
|
12
|
+
date: 2012-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rmagick
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ~>
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: 0.
|
149
|
+
version: 10.0.2
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ dependencies:
|
|
154
154
|
requirements:
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 0.
|
157
|
+
version: 10.0.2
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: fivemat
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,12 +316,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
316
316
|
- - ! '>='
|
317
317
|
- !ruby/object:Gem::Version
|
318
318
|
version: '0'
|
319
|
+
segments:
|
320
|
+
- 0
|
321
|
+
hash: -395206904349173535
|
319
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
320
323
|
none: false
|
321
324
|
requirements:
|
322
325
|
- - ! '>='
|
323
326
|
- !ruby/object:Gem::Version
|
324
327
|
version: '0'
|
328
|
+
segments:
|
329
|
+
- 0
|
330
|
+
hash: -395206904349173535
|
325
331
|
requirements: []
|
326
332
|
rubyforge_project: lolcommits
|
327
333
|
rubygems_version: 1.8.24
|