blammo 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/lib/blammo.rb +1 -0
- data/lib/blammo/alone.rb +4 -14
- data/lib/blammo/changelog.rb +4 -5
- data/lib/blammo/cli.rb +3 -3
- data/lib/blammo/version.rb +3 -0
- metadata +23 -37
- data/.gitignore +0 -5
- data/Gemfile +0 -16
- data/Rakefile +0 -55
- data/VERSION +0 -1
- data/blammo.gemspec +0 -94
- data/spec/blammo/changelog_spec.rb +0 -125
- data/spec/blammo/cli_spec.rb +0 -15
- data/spec/blammo/commit_spec.rb +0 -62
- data/spec/blammo/git_spec.rb +0 -65
- data/spec/blammo/release_spec.rb +0 -65
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +0 -12
- data/templates/changelog.html.erb +0 -21
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Josh Bassett
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/blammo.rb
CHANGED
data/lib/blammo/alone.rb
CHANGED
@@ -1,24 +1,14 @@
|
|
1
1
|
rc = "#{ENV['HOME']}/.rubyrc"
|
2
2
|
load(rc) if File.exist?(rc)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
begin
|
7
|
-
# Require the preresolved locked set of gems.
|
8
|
-
require File.expand_path('../../.bundle/environment', __FILE__)
|
9
|
-
rescue LoadError
|
10
|
-
# Fallback on doing the resolve at runtime.
|
11
|
-
require 'rubygems'
|
12
|
-
require 'bundler'
|
13
|
-
|
14
|
-
Bundler.setup
|
15
|
-
end
|
4
|
+
require 'rubygems'
|
5
|
+
require 'bundler'
|
16
6
|
|
17
7
|
envs = [:default]
|
18
8
|
envs << ENV['BLAMMO_ENV'].downcase.to_sym if ENV['BLAMMO_ENV']
|
19
|
-
Bundler.
|
9
|
+
Bundler.setup(*envs)
|
20
10
|
|
21
11
|
path = File.join(File.expand_path(File.dirname(__FILE__)), '..')
|
22
|
-
|
12
|
+
$LOAD_PATH.unshift(path)
|
23
13
|
|
24
14
|
require 'blammo'
|
data/lib/blammo/changelog.rb
CHANGED
@@ -9,11 +9,10 @@ module Blammo
|
|
9
9
|
@releases = Changelog.parse_releases(releases_hash)
|
10
10
|
end
|
11
11
|
|
12
|
-
def refresh(dir)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
since = Changelog.last_sha(@releases)
|
12
|
+
def refresh(dir, name = nil)
|
13
|
+
name ||= Time.now.strftime("%Y%m%d%H%M%S")
|
14
|
+
release = Release.new(name)
|
15
|
+
since = Changelog.last_sha(@releases)
|
17
16
|
|
18
17
|
Git.each_commit(dir, since) do |sha, message|
|
19
18
|
if message =~ Commit::COMMIT_RE
|
data/lib/blammo/cli.rb
CHANGED
@@ -9,17 +9,17 @@ module Blammo
|
|
9
9
|
end
|
10
10
|
|
11
11
|
desc "generate [PATH]", %q(Generates a changelog.yml file (short-cut alias: "g"))
|
12
|
-
method_options
|
12
|
+
method_options %w(force -f) => :boolean, %w(name -n) => :string
|
13
13
|
map "g" => :generate
|
14
14
|
def generate(path = "changelog.yml")
|
15
15
|
path = File.expand_path(path, destination_root)
|
16
16
|
changelog = Changelog.new(path)
|
17
|
-
changelog.refresh(destination_root)
|
17
|
+
changelog.refresh(destination_root, options[:name])
|
18
18
|
create_file(path, changelog.to_yaml)
|
19
19
|
end
|
20
20
|
|
21
21
|
desc "render [PATH]", %q(Renders the given changelog.yml file (short-cut alias: "r"))
|
22
|
-
method_options
|
22
|
+
method_options %w(force -f) => :boolean
|
23
23
|
map "r" => :render
|
24
24
|
def render(path = "changelog.yml")
|
25
25
|
@changelog = Changelog.new(path)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 6
|
9
|
+
version: 0.2.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Josh Bassett
|
@@ -14,8 +14,8 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
18
|
-
default_executable:
|
17
|
+
date: 2010-08-02 00:00:00 +10:00
|
18
|
+
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
version: "0"
|
64
64
|
prerelease: false
|
65
65
|
type: :development
|
66
|
-
name:
|
66
|
+
name: rake
|
67
67
|
version_requirements: *id004
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
requirement: &id005 !ruby/object:Gem::Requirement
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
version: "0"
|
76
76
|
prerelease: false
|
77
77
|
type: :development
|
78
|
-
name:
|
78
|
+
name: rcov
|
79
79
|
version_requirements: *id005
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
requirement: &id006 !ruby/object:Gem::Requirement
|
@@ -113,45 +113,34 @@ dependencies:
|
|
113
113
|
type: :development
|
114
114
|
name: timecop
|
115
115
|
version_requirements: *id008
|
116
|
-
description:
|
116
|
+
description: Changelog generator.
|
117
117
|
email: josh.bassett@gmail.com
|
118
118
|
executables:
|
119
119
|
- blam
|
120
120
|
extensions: []
|
121
121
|
|
122
|
-
extra_rdoc_files:
|
123
|
-
|
122
|
+
extra_rdoc_files: []
|
123
|
+
|
124
124
|
files:
|
125
|
-
- .gitignore
|
126
|
-
- Gemfile
|
127
|
-
- README.md
|
128
|
-
- Rakefile
|
129
|
-
- VERSION
|
130
125
|
- bin/blam
|
131
|
-
- blammo.gemspec
|
132
|
-
- lib/blammo.rb
|
133
126
|
- lib/blammo/alone.rb
|
134
127
|
- lib/blammo/changelog.rb
|
135
128
|
- lib/blammo/cli.rb
|
136
129
|
- lib/blammo/commit.rb
|
137
130
|
- lib/blammo/git.rb
|
138
131
|
- lib/blammo/release.rb
|
132
|
+
- lib/blammo/version.rb
|
133
|
+
- lib/blammo.rb
|
139
134
|
- lib/core_ext/blank.rb
|
140
|
-
-
|
141
|
-
-
|
142
|
-
- spec/blammo/commit_spec.rb
|
143
|
-
- spec/blammo/git_spec.rb
|
144
|
-
- spec/blammo/release_spec.rb
|
145
|
-
- spec/spec.opts
|
146
|
-
- spec/spec_helper.rb
|
147
|
-
- templates/changelog.html.erb
|
135
|
+
- LICENSE
|
136
|
+
- README.md
|
148
137
|
has_rdoc: true
|
149
|
-
homepage: http://github.com/
|
138
|
+
homepage: http://github.com/NZX/billing-model
|
150
139
|
licenses: []
|
151
140
|
|
152
141
|
post_install_message:
|
153
|
-
rdoc_options:
|
154
|
-
|
142
|
+
rdoc_options: []
|
143
|
+
|
155
144
|
require_paths:
|
156
145
|
- lib
|
157
146
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -166,19 +155,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
155
|
- - ">="
|
167
156
|
- !ruby/object:Gem::Version
|
168
157
|
segments:
|
169
|
-
-
|
170
|
-
|
158
|
+
- 1
|
159
|
+
- 3
|
160
|
+
- 6
|
161
|
+
version: 1.3.6
|
171
162
|
requirements: []
|
172
163
|
|
173
|
-
rubyforge_project:
|
164
|
+
rubyforge_project: blammo
|
174
165
|
rubygems_version: 1.3.6
|
175
166
|
signing_key:
|
176
167
|
specification_version: 3
|
177
168
|
summary: CHANGELOG from Blammo.
|
178
|
-
test_files:
|
179
|
-
|
180
|
-
- spec/blammo/cli_spec.rb
|
181
|
-
- spec/blammo/commit_spec.rb
|
182
|
-
- spec/blammo/git_spec.rb
|
183
|
-
- spec/blammo/release_spec.rb
|
184
|
-
- spec/spec_helper.rb
|
169
|
+
test_files: []
|
170
|
+
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), 'lib', 'blammo', 'alone')
|
5
|
-
|
6
|
-
begin
|
7
|
-
require 'jeweler'
|
8
|
-
Jeweler::Tasks.new do |gem|
|
9
|
-
gem.name = "blammo"
|
10
|
-
gem.summary = "CHANGELOG from Blammo."
|
11
|
-
gem.description = <<-EOS
|
12
|
-
Changelog generator.
|
13
|
-
EOS
|
14
|
-
gem.email = "josh.bassett@gmail.com"
|
15
|
-
gem.homepage = "http://github.com/nullobject/blammo"
|
16
|
-
gem.authors = ["Josh Bassett"]
|
17
|
-
|
18
|
-
unless defined?(Bundler::Definition)
|
19
|
-
require 'bundler'
|
20
|
-
end
|
21
|
-
|
22
|
-
bundle = Bundler::Definition.from_gemfile("Gemfile")
|
23
|
-
bundle.dependencies.each do |dep|
|
24
|
-
if dep.groups.include?(:runtime) || dep.groups.include?(:default) || dep.groups.include?(:production)
|
25
|
-
gem.add_dependency(dep.name, dep.requirement.to_s)
|
26
|
-
elsif dep.groups.include?(:development) || dep.groups.include?(:test)
|
27
|
-
gem.add_development_dependency(dep.name, dep.requirement.to_s)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
Jeweler::GemcutterTasks.new
|
32
|
-
rescue LoadError
|
33
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
34
|
-
end
|
35
|
-
|
36
|
-
desc "Launch an IRB session with the environment loaded"
|
37
|
-
task :console do
|
38
|
-
exec("irb -I lib -r blammo/alone")
|
39
|
-
end
|
40
|
-
|
41
|
-
require 'spec/rake/spectask'
|
42
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
43
|
-
spec.libs << 'lib' << 'spec'
|
44
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
45
|
-
end
|
46
|
-
|
47
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
48
|
-
spec.libs << 'lib' << 'spec'
|
49
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
50
|
-
spec.rcov = true
|
51
|
-
end
|
52
|
-
|
53
|
-
task :spec => :check_dependencies
|
54
|
-
|
55
|
-
task :default => :spec
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.5
|
data/blammo.gemspec
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{blammo}
|
8
|
-
s.version = "0.2.5"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Josh Bassett"]
|
12
|
-
s.date = %q{2010-06-30}
|
13
|
-
s.default_executable = %q{blam}
|
14
|
-
s.description = %q{ Changelog generator.
|
15
|
-
}
|
16
|
-
s.email = %q{josh.bassett@gmail.com}
|
17
|
-
s.executables = ["blam"]
|
18
|
-
s.extra_rdoc_files = [
|
19
|
-
"README.md"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".gitignore",
|
23
|
-
"Gemfile",
|
24
|
-
"README.md",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"bin/blam",
|
28
|
-
"blammo.gemspec",
|
29
|
-
"lib/blammo.rb",
|
30
|
-
"lib/blammo/alone.rb",
|
31
|
-
"lib/blammo/changelog.rb",
|
32
|
-
"lib/blammo/cli.rb",
|
33
|
-
"lib/blammo/commit.rb",
|
34
|
-
"lib/blammo/git.rb",
|
35
|
-
"lib/blammo/release.rb",
|
36
|
-
"lib/core_ext/blank.rb",
|
37
|
-
"spec/blammo/changelog_spec.rb",
|
38
|
-
"spec/blammo/cli_spec.rb",
|
39
|
-
"spec/blammo/commit_spec.rb",
|
40
|
-
"spec/blammo/git_spec.rb",
|
41
|
-
"spec/blammo/release_spec.rb",
|
42
|
-
"spec/spec.opts",
|
43
|
-
"spec/spec_helper.rb",
|
44
|
-
"templates/changelog.html.erb"
|
45
|
-
]
|
46
|
-
s.homepage = %q{http://github.com/nullobject/blammo}
|
47
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
48
|
-
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version = %q{1.3.6}
|
50
|
-
s.summary = %q{CHANGELOG from Blammo.}
|
51
|
-
s.test_files = [
|
52
|
-
"spec/blammo/changelog_spec.rb",
|
53
|
-
"spec/blammo/cli_spec.rb",
|
54
|
-
"spec/blammo/commit_spec.rb",
|
55
|
-
"spec/blammo/git_spec.rb",
|
56
|
-
"spec/blammo/release_spec.rb",
|
57
|
-
"spec/spec_helper.rb"
|
58
|
-
]
|
59
|
-
|
60
|
-
if s.respond_to? :specification_version then
|
61
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
62
|
-
s.specification_version = 3
|
63
|
-
|
64
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
65
|
-
s.add_runtime_dependency(%q<git>, [">= 0"])
|
66
|
-
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
67
|
-
s.add_development_dependency(%q<hirb>, [">= 0"])
|
68
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
69
|
-
s.add_development_dependency(%q<rake>, [">= 0"])
|
70
|
-
s.add_development_dependency(%q<rr>, [">= 0"])
|
71
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
72
|
-
s.add_development_dependency(%q<timecop>, [">= 0"])
|
73
|
-
else
|
74
|
-
s.add_dependency(%q<git>, [">= 0"])
|
75
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
76
|
-
s.add_dependency(%q<hirb>, [">= 0"])
|
77
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
78
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
79
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
80
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
81
|
-
s.add_dependency(%q<timecop>, [">= 0"])
|
82
|
-
end
|
83
|
-
else
|
84
|
-
s.add_dependency(%q<git>, [">= 0"])
|
85
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
86
|
-
s.add_dependency(%q<hirb>, [">= 0"])
|
87
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
88
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
89
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
90
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
91
|
-
s.add_dependency(%q<timecop>, [">= 0"])
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
@@ -1,125 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Blammo::Changelog do
|
4
|
-
before(:all) do
|
5
|
-
@releases_hash = [
|
6
|
-
{"1.1" => [
|
7
|
-
"[ADDED] commit one",
|
8
|
-
]},
|
9
|
-
{"1.0" => [
|
10
|
-
{"867b20e695e2b3770e150b0e844cdb6addd48ba4" => nil},
|
11
|
-
{"3b183d9d1ec270fc63ef54695db1cd2df5d597cf" => "[FIXED] commit three"},
|
12
|
-
]}
|
13
|
-
]
|
14
|
-
|
15
|
-
@releases = [
|
16
|
-
Blammo::Release.new("1.1", [
|
17
|
-
Blammo::Commit.new(nil, "[ADDED] commit one"),
|
18
|
-
]),
|
19
|
-
Blammo::Release.new("1.0", [
|
20
|
-
Blammo::Commit.new("867b20e695e2b3770e150b0e844cdb6addd48ba4", nil),
|
21
|
-
Blammo::Commit.new("3b183d9d1ec270fc63ef54695db1cd2df5d597cf", "[FIXED] commit three"),
|
22
|
-
])
|
23
|
-
]
|
24
|
-
|
25
|
-
@tagged_commits = [
|
26
|
-
Blammo::Commit.new("867b20e695e2b3770e150b0e844cdb6addd48ba4", "[ADDED] Lorem ipsum dolor sit amet, consectetur adipiscing elit."),
|
27
|
-
Blammo::Commit.new("3b183d9d1ec270fc63ef54695db1cd2df5d597cf", "[CHANGED] Fusce accumsan laoreet semper."),
|
28
|
-
Blammo::Commit.new("a7324e86b19ec68249ca0f9752a3277b0ad8c0c2", "[FIXED] Nunc ut magna eget libero porttitor mattis."),
|
29
|
-
]
|
30
|
-
|
31
|
-
@non_tagged_commits = [
|
32
|
-
Blammo::Commit.new("5fd6e8dea3d8c79700fccb324ba4a9b00918afa3", "Donec rhoncus lorem sed lorem vestibulum ultricies.")
|
33
|
-
]
|
34
|
-
end
|
35
|
-
|
36
|
-
describe "#initialize" do
|
37
|
-
before do
|
38
|
-
@path = "changelog.yml"
|
39
|
-
|
40
|
-
stub(Blammo::Changelog).parse_releases {[]}
|
41
|
-
stub(File).exists? {true}
|
42
|
-
stub(YAML).load_file {[]}
|
43
|
-
|
44
|
-
Blammo::Changelog.new(@path)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should load the given YAML file and parse it" do
|
48
|
-
YAML.should have_received.load_file(@path)
|
49
|
-
Blammo::Changelog.should have_received.parse_releases(anything)
|
50
|
-
end
|
51
|
-
|
52
|
-
context "with an invalid YAML file" do
|
53
|
-
it "should warn the user" do
|
54
|
-
pending
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "#refresh" do
|
60
|
-
before do
|
61
|
-
@dir = "foo/bar"
|
62
|
-
@last_sha = "867b20e695e2b3770e150b0e844cdb6addd48ba4"
|
63
|
-
@changelog = Blammo::Changelog.new("changelog.yml")
|
64
|
-
@time_str = "20100501155804"
|
65
|
-
@time = Time.parse(@time_str)
|
66
|
-
|
67
|
-
stub(Blammo::Changelog).last_sha {@last_sha}
|
68
|
-
stub(Blammo::Git).each_commit
|
69
|
-
|
70
|
-
Timecop.freeze(@time) do
|
71
|
-
@changelog.refresh(@dir)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
it "should process commits since the last SHA" do
|
76
|
-
Blammo::Git.should have_received.each_commit(@dir, @last_sha)
|
77
|
-
end
|
78
|
-
|
79
|
-
it "should name the release with the current timestamp" do
|
80
|
-
pending
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
describe "#to_yaml" do
|
85
|
-
before do
|
86
|
-
stub(Blammo::Changelog).parse_releases {@releases}
|
87
|
-
stub(@releases).to_yaml
|
88
|
-
|
89
|
-
@changelog = Blammo::Changelog.new("changelog.yml")
|
90
|
-
@changelog.to_yaml
|
91
|
-
end
|
92
|
-
|
93
|
-
it "should return the releases YAML" do
|
94
|
-
@releases.should have_received.to_yaml({})
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
describe ".last_sha" do
|
99
|
-
context "with no releases" do
|
100
|
-
it "should return nil" do
|
101
|
-
Blammo::Changelog.last_sha([]).should be_nil
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
context "with a release" do
|
106
|
-
it "should return the SHA of the last commit" do
|
107
|
-
Blammo::Changelog.last_sha(@releases).should == "867b20e695e2b3770e150b0e844cdb6addd48ba4"
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
describe ".parse_releases" do
|
113
|
-
context "with no releases" do
|
114
|
-
it "should return an empty array" do
|
115
|
-
Blammo::Changelog.parse_releases([]).should be_empty
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
context "with a release" do
|
120
|
-
it "should should parse the releases hash" do
|
121
|
-
pending
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
data/spec/blammo/cli_spec.rb
DELETED
data/spec/blammo/commit_spec.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Blammo::Commit do
|
4
|
-
before do
|
5
|
-
@sha = "foo"
|
6
|
-
@message = "[ADDED] bar"
|
7
|
-
@commit = Blammo::Commit.new(@sha, @message)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "#initialize" do
|
11
|
-
subject {@commit}
|
12
|
-
|
13
|
-
its(:sha) {should == @sha}
|
14
|
-
its(:message) {should == "bar"}
|
15
|
-
its(:tag) {should == :added}
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "#to_s" do
|
19
|
-
subject {@commit.to_s}
|
20
|
-
it {should == "bar"}
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "#to_yaml" do
|
24
|
-
context "with a SHA" do
|
25
|
-
subject {@commit.to_yaml}
|
26
|
-
it {should == {@sha => @message}.to_yaml}
|
27
|
-
end
|
28
|
-
|
29
|
-
context "without a SHA" do
|
30
|
-
subject {Blammo::Commit.new(nil, @message).to_yaml}
|
31
|
-
it {should == @message.to_yaml}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe ".parse_tag" do
|
36
|
-
context "with an 'added' tag" do
|
37
|
-
%w(added new).each do |tag|
|
38
|
-
subject {Blammo::Commit.parse_tag(tag.to_s.upcase)}
|
39
|
-
it {should == :added}
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "with a 'changed' tag" do
|
44
|
-
%w(changed).each do |tag|
|
45
|
-
subject {Blammo::Commit.parse_tag(tag.to_s.upcase)}
|
46
|
-
it {should == :changed}
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
context "with a 'fixed' tag" do
|
51
|
-
%w(fixed).each do |tag|
|
52
|
-
subject {Blammo::Commit.parse_tag(tag.to_s.upcase)}
|
53
|
-
it {should == :fixed}
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
context "with an unknown tag" do
|
58
|
-
subject {Blammo::Commit.parse_tag("FOO")}
|
59
|
-
it {should be_nil}
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
data/spec/blammo/git_spec.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Blammo::Git do
|
4
|
-
before do
|
5
|
-
@git = Git.init
|
6
|
-
@log = Git::Log.new(@git)
|
7
|
-
|
8
|
-
stub(Git).open(anything) {@git}
|
9
|
-
stub(Git::Log).new(anything, numeric) {@log}
|
10
|
-
end
|
11
|
-
|
12
|
-
describe ".commits" do
|
13
|
-
before do
|
14
|
-
@path = "foo/bar"
|
15
|
-
|
16
|
-
stub(@log).between.with_any_args
|
17
|
-
|
18
|
-
Blammo::Git.each_commit(@path) do
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should open the repo at the given path" do
|
23
|
-
Git.should have_received.open(@path)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should open the log" do
|
27
|
-
Git::Log.should have_received.new(@git, 10)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should not scope the log" do
|
31
|
-
@log.should_not have_received.between.with_any_args
|
32
|
-
end
|
33
|
-
|
34
|
-
context "with a SHA" do
|
35
|
-
before do
|
36
|
-
@since = "abcd"
|
37
|
-
|
38
|
-
Blammo::Git.each_commit(@path, @since) do
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should scope the log" do
|
43
|
-
@log.should have_received.between(@since, "head")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
context "with commits" do
|
48
|
-
before do
|
49
|
-
@commit = Object.new
|
50
|
-
|
51
|
-
stub(@commit).sha {"foo"}
|
52
|
-
stub(@commit).message {" bar "}
|
53
|
-
|
54
|
-
stub(@log).each.yields(@commit)
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should yield each commit" do
|
58
|
-
Blammo::Git.each_commit(@log) do |sha, message|
|
59
|
-
sha.should == "foo"
|
60
|
-
message.should == "bar"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
data/spec/blammo/release_spec.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Blammo::Release do
|
4
|
-
before do
|
5
|
-
@name = "foo"
|
6
|
-
@commits = []
|
7
|
-
@release = Blammo::Release.new(@name, @commits)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "#initialize" do
|
11
|
-
subject {@release}
|
12
|
-
|
13
|
-
its(:name) {should == @name}
|
14
|
-
its(:commits) {should == @commits}
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "#add_commit" do
|
18
|
-
it "should add the given commit" do
|
19
|
-
commit = Object.new
|
20
|
-
@release.commits.should_not include(commit)
|
21
|
-
@release.add_commit(commit)
|
22
|
-
@release.commits.should include(commit)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#to_s" do
|
27
|
-
subject {@release.to_s}
|
28
|
-
it {should == @name}
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#to_yaml" do
|
32
|
-
subject {@release.to_yaml}
|
33
|
-
it {should == {@name => @commits}.to_yaml}
|
34
|
-
end
|
35
|
-
|
36
|
-
describe "#each_commit" do
|
37
|
-
before do
|
38
|
-
stub(@tagged_commit = Object.new).tag {:foo}
|
39
|
-
stub(@untagged_commit = Object.new).tag
|
40
|
-
|
41
|
-
@commits = [@tagged_commit, @untagged_commit]
|
42
|
-
@release = Blammo::Release.new("bar", @commits)
|
43
|
-
end
|
44
|
-
|
45
|
-
context "with a tag" do
|
46
|
-
it "should yield each commit which has the given tag" do
|
47
|
-
commits = []
|
48
|
-
@release.each_commit(:foo) do |commit|
|
49
|
-
commits << commit
|
50
|
-
end
|
51
|
-
commits.should == [@tagged_commit]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
context "without a tag" do
|
56
|
-
it "should yield each commit" do
|
57
|
-
commits = []
|
58
|
-
@release.each_commit do |commit|
|
59
|
-
commits << commit
|
60
|
-
end
|
61
|
-
commits.should == @commits
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/spec/spec_helper.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
ENV['BLAMMO_ENV'] ||= 'test'
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
4
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
|
-
|
6
|
-
require 'blammo/alone'
|
7
|
-
require 'rr'
|
8
|
-
require 'spec'
|
9
|
-
|
10
|
-
Spec::Runner.configure do |config|
|
11
|
-
config.mock_with RR::Adapters::Rspec
|
12
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html dir="ltr" lang="en-US">
|
3
|
-
<body>
|
4
|
-
<h1>Changelog</h1>
|
5
|
-
|
6
|
-
<%- @changelog.releases.each do |release| -%>
|
7
|
-
<h2>Release <%= release %></h2>
|
8
|
-
|
9
|
-
<ul>
|
10
|
-
<%- %w(added changed fixed).each do |tag| -%>
|
11
|
-
<%- release.each_commit(tag) do |commit| -%>
|
12
|
-
<li>
|
13
|
-
<span class="<%= tag %>"><%= tag.to_s.upcase %></span>
|
14
|
-
<%= commit %>
|
15
|
-
</li>
|
16
|
-
<%- end -%>
|
17
|
-
<%- end -%>
|
18
|
-
</ul>
|
19
|
-
<%- end -%>
|
20
|
-
</body>
|
21
|
-
</html>
|