rspec-formatter-git_auto_commit 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 59df8e3d5d5e6acff1e6f3eae5c355ad9e73fb10
|
4
|
+
data.tar.gz: 12c757cc6e6b21f42a72797b0d496b4f04977b9d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 96b80c4ab6a48fefa1c22a5667f50fbcce393d5bc4c2fc784910ab7e495cbc6b203dfdf367240d41db0994e43d3afa9ee6dc58d212a51604360984e88f09a3a5
|
7
|
+
data.tar.gz: 928c91414ce71246ef90e0a3a9d79c8091b149332b771f40026d02cbc94308cc85eb486040a1cd33304959d2fa4da786ce3a9d9d199430a8d50dae368347061d
|
@@ -1,52 +1,12 @@
|
|
1
|
-
require "rspec/core/formatters/base_text_formatter"
|
2
|
-
|
3
1
|
module RSpec
|
4
2
|
module Formatter
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def dump_pending
|
15
|
-
end
|
16
|
-
|
17
|
-
def seed(number)
|
18
|
-
end
|
19
|
-
|
20
|
-
def dump_summary(duration, example_count, failure_count, pending_count)
|
21
|
-
state = failure_count == 0 ? "[green]" : "[red]"
|
22
|
-
summary = summary_line(example_count, failure_count, pending_count)
|
23
|
-
duration = "in #{format_duration(duration)}"
|
24
|
-
commit_message = [state, summary, duration].join(" ")
|
25
|
-
|
26
|
-
unless failed_examples.empty?
|
27
|
-
commit_message << "\n\nFailed Examples:\n\n"
|
28
|
-
failed_examples.each_with_index do |example, index|
|
29
|
-
commit_message << "#{short_padding}#{index.next}) #{example.full_description}\n\n"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
system("#{GIT_PROG} add -u")
|
34
|
-
commit_message << "\n\n"
|
35
|
-
commit_message << `#{GIT_PROG} diff --cached`
|
36
|
-
|
37
|
-
commit_message << "\n\n"
|
38
|
-
commit_message << "File Status:\n"
|
39
|
-
commit_message << `#{GIT_PROG} status -s`
|
40
|
-
|
41
|
-
File.popen("#{GIT_PROG} commit -F -", "r+") do |fd|
|
42
|
-
fd.write commit_message
|
43
|
-
fd.close
|
44
|
-
end
|
45
|
-
|
46
|
-
log = `#{GIT_PROG} log --oneline -n 1`
|
47
|
-
output.puts "\nAuto committed.\n"
|
48
|
-
output.puts colorise_summary(log)
|
49
|
-
end
|
3
|
+
begin
|
4
|
+
require "rspec/core/formatters/legacy_formatter"
|
5
|
+
require "rspec/formatter/git_auto_commit_rspec3"
|
6
|
+
GitAutoCommit = GitAutoCommitRSpec3
|
7
|
+
rescue LoadError
|
8
|
+
require "rspec/formatter/git_auto_commit_rspec2"
|
9
|
+
GitAutoCommit = GitAutoCommitRSpec2
|
50
10
|
end
|
51
11
|
end
|
52
12
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "rspec/core/formatters/base_text_formatter"
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Formatter
|
5
|
+
class GitAutoCommitRSpec2 < RSpec::Core::Formatters::BaseTextFormatter
|
6
|
+
GIT_PROG = ENV["GIT_BIN"] || "git"
|
7
|
+
|
8
|
+
def message(message)
|
9
|
+
end
|
10
|
+
|
11
|
+
def dump_failures
|
12
|
+
end
|
13
|
+
|
14
|
+
def dump_pending
|
15
|
+
end
|
16
|
+
|
17
|
+
def seed(number)
|
18
|
+
end
|
19
|
+
|
20
|
+
def dump_summary(duration, example_count, failure_count, pending_count)
|
21
|
+
state = failure_count == 0 ? "[green]" : "[red]"
|
22
|
+
summary = summary_line(example_count, failure_count, pending_count)
|
23
|
+
duration = "in #{format_duration(duration)}"
|
24
|
+
commit_message = [state, summary, duration].join(" ")
|
25
|
+
|
26
|
+
unless failed_examples.empty?
|
27
|
+
commit_message << "\n\nFailed Examples:\n\n"
|
28
|
+
failed_examples.each_with_index do |example, index|
|
29
|
+
commit_message << "#{short_padding}#{index.next}) #{example.full_description}\n\n"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
system("#{GIT_PROG} add -u")
|
34
|
+
commit_message << "\n\n"
|
35
|
+
commit_message << `#{GIT_PROG} diff --cached`
|
36
|
+
|
37
|
+
commit_message << "\n\n"
|
38
|
+
commit_message << "File Status:\n"
|
39
|
+
commit_message << `#{GIT_PROG} status -s`
|
40
|
+
|
41
|
+
File.popen("#{GIT_PROG} commit -F -", "r+") do |fd|
|
42
|
+
fd.write commit_message
|
43
|
+
fd.close
|
44
|
+
end
|
45
|
+
|
46
|
+
log = `#{GIT_PROG} log --oneline -n 1`
|
47
|
+
output.puts "\nAuto committed.\n"
|
48
|
+
output.puts colorise_summary(log)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "rspec/core/formatters/base_text_formatter"
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Formatter
|
5
|
+
class GitAutoCommitRSpec3 < RSpec::Core::Formatters::BaseTextFormatter
|
6
|
+
RSpec::Core::Formatters.register self, :dump_summary
|
7
|
+
|
8
|
+
GIT_PROG = ENV["GIT_BIN"] || "git"
|
9
|
+
|
10
|
+
def seed(notification)
|
11
|
+
end
|
12
|
+
|
13
|
+
def dump_summary(summary)
|
14
|
+
state = summary.failure_count == 0 ? "[green]" : "[red]"
|
15
|
+
duration = "in #{format_duration(summary.duration)}"
|
16
|
+
commit_message = [state, summary.summary_line, duration].join(" ")
|
17
|
+
|
18
|
+
unless failed_examples.empty?
|
19
|
+
commit_message << "\n\nFailed Examples:\n\n"
|
20
|
+
failed_examples.each_with_index do |example, index|
|
21
|
+
commit_message << "#{short_padding}#{index.next}) #{example.full_description}\n\n"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
system("#{GIT_PROG} add -u")
|
26
|
+
commit_message << "\n\n"
|
27
|
+
commit_message << `#{GIT_PROG} diff --cached`
|
28
|
+
|
29
|
+
commit_message << "\n\n"
|
30
|
+
commit_message << "File Status:\n"
|
31
|
+
commit_message << `#{GIT_PROG} status -s`
|
32
|
+
|
33
|
+
File.popen("#{GIT_PROG} commit -F -", "r+") do |fd|
|
34
|
+
fd.write commit_message
|
35
|
+
fd.close
|
36
|
+
end
|
37
|
+
|
38
|
+
log = `#{GIT_PROG} log --oneline -n 1`
|
39
|
+
output.puts "\nAuto committed.\n"
|
40
|
+
|
41
|
+
if summary.failure_count > 0
|
42
|
+
color_config = RSpec.configuration.failure_color
|
43
|
+
elsif summary.pending_count > 0
|
44
|
+
color_config = RSpec.configuration.pending_color
|
45
|
+
else
|
46
|
+
color_config = RSpec.configuration.success_color
|
47
|
+
end
|
48
|
+
output.puts color(log, color_config)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.summary = %q{RSpec git auto commit formatter}
|
8
8
|
gem.homepage = "https://github.com/joker1007/rspec-formatter-git_auto_commit"
|
9
9
|
|
10
|
-
gem.add_dependency('rspec', '
|
10
|
+
gem.add_dependency('rspec', '>= 2.11', '< 4')
|
11
11
|
gem.add_development_dependency('rake')
|
12
12
|
|
13
13
|
gem.files = `git ls-files`.split($\)
|
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.name = "rspec-formatter-git_auto_commit"
|
17
17
|
gem.require_paths = ["lib"]
|
18
|
-
gem.version = "0.0.
|
18
|
+
gem.version = "0.0.7"
|
19
19
|
end
|
metadata
CHANGED
@@ -1,46 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-formatter-git_auto_commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.7
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- joker1007
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '2.11'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '2.11'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4'
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: rake
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
36
|
requirements:
|
35
|
-
- -
|
37
|
+
- - ">="
|
36
38
|
- !ruby/object:Gem::Version
|
37
39
|
version: '0'
|
38
40
|
type: :development
|
39
41
|
prerelease: false
|
40
42
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
43
|
requirements:
|
43
|
-
- -
|
44
|
+
- - ">="
|
44
45
|
- !ruby/object:Gem::Version
|
45
46
|
version: '0'
|
46
47
|
description: RSpec git auto commit formatter
|
@@ -50,42 +51,37 @@ executables: []
|
|
50
51
|
extensions: []
|
51
52
|
extra_rdoc_files: []
|
52
53
|
files:
|
53
|
-
- .gitignore
|
54
|
+
- ".gitignore"
|
54
55
|
- Gemfile
|
55
56
|
- LICENSE
|
56
57
|
- README.md
|
57
58
|
- Rakefile
|
58
59
|
- lib/rspec-formatter-git_auto_commit.rb
|
59
60
|
- lib/rspec/formatter/git_auto_commit.rb
|
61
|
+
- lib/rspec/formatter/git_auto_commit_rspec2.rb
|
62
|
+
- lib/rspec/formatter/git_auto_commit_rspec3.rb
|
60
63
|
- rspec-formatter-git_auto_commit.gemspec
|
61
64
|
homepage: https://github.com/joker1007/rspec-formatter-git_auto_commit
|
62
65
|
licenses: []
|
66
|
+
metadata: {}
|
63
67
|
post_install_message:
|
64
68
|
rdoc_options: []
|
65
69
|
require_paths:
|
66
70
|
- lib
|
67
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
72
|
requirements:
|
70
|
-
- -
|
73
|
+
- - ">="
|
71
74
|
- !ruby/object:Gem::Version
|
72
75
|
version: '0'
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
hash: 581178031132771261
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
77
|
requirements:
|
79
|
-
- -
|
78
|
+
- - ">="
|
80
79
|
- !ruby/object:Gem::Version
|
81
80
|
version: '0'
|
82
|
-
segments:
|
83
|
-
- 0
|
84
|
-
hash: 581178031132771261
|
85
81
|
requirements: []
|
86
82
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
83
|
+
rubygems_version: 2.2.2
|
88
84
|
signing_key:
|
89
|
-
specification_version:
|
85
|
+
specification_version: 4
|
90
86
|
summary: RSpec git auto commit formatter
|
91
87
|
test_files: []
|