yes_ship_it 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/assertions/tag.rb +13 -5
- data/assertions/yes_it_shipped.rb +1 -1
- data/lib/version.rb +1 -1
- data/lib/yes_ship_it/engine.rb +6 -1
- data/lib/yes_ship_it.rb +1 -0
- data/spec/integration/cli_spec.rb +1 -1
- data/spec/unit/assertions/tag_spec.rb +49 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ac91756b1bb840377155a902332884700512392
|
4
|
+
data.tar.gz: 8082dd501a30d1b6cc9957e2b138011b01e6e4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e1aed4610021735afbf02647af9d66c4580131b27d0da3ac2db3b686e405d56f4652688fd00d1632ae6784d97031ba9e20a0434de2e6a100fcaed5761176b71
|
7
|
+
data.tar.gz: a48fe139e07ad8d7ad333ec18f1806e84cc83c294fa7810058bbf9395ce7d91c661bb369c01d10becfbcd21afa8c99b4a746b63b565b3c24fbd52b2b8f1b6c55
|
data/CHANGELOG.md
CHANGED
data/assertions/tag.rb
CHANGED
@@ -10,14 +10,21 @@ module YSI
|
|
10
10
|
@engine.tag
|
11
11
|
end
|
12
12
|
|
13
|
+
def get_tag_date(executor)
|
14
|
+
output = executor.run_command(["git", "show", tag])
|
15
|
+
if output
|
16
|
+
output.each_line do |show_line|
|
17
|
+
if show_line =~ /Date:\s+(.*)/
|
18
|
+
@engine.tag_date = Time.parse($1)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
def check
|
14
25
|
Executor.new.run_command(["git", "tag"]).each_line do |line|
|
15
26
|
if line.chomp == tag
|
16
|
-
Executor.new
|
17
|
-
if show_line =~ /Date:\s+(.*)/
|
18
|
-
@engine.tag_date = $1
|
19
|
-
end
|
20
|
-
end
|
27
|
+
get_tag_date(YSI::Executor.new)
|
21
28
|
return tag
|
22
29
|
end
|
23
30
|
end
|
@@ -26,6 +33,7 @@ module YSI
|
|
26
33
|
|
27
34
|
def assert(executor)
|
28
35
|
executor.run_command(["git", "tag", "-a", tag, "-m", engine.version])
|
36
|
+
get_tag_date(executor)
|
29
37
|
tag
|
30
38
|
end
|
31
39
|
end
|
@@ -18,7 +18,7 @@ module YSI
|
|
18
18
|
def assert(executor)
|
19
19
|
executor.http_post("https://yes-it-shipped.herokuapp.com/releases",
|
20
20
|
project: engine.project_name, version: engine.version,
|
21
|
-
release_date_time: engine.tag_date
|
21
|
+
release_date_time: engine.tag_date, project_url: engine.project_url,
|
22
22
|
release_url: engine.release_url, ysi_config_url: engine.config_url)
|
23
23
|
"#{engine.project_name}-#{engine.version}"
|
24
24
|
end
|
data/lib/version.rb
CHANGED
data/lib/yes_ship_it/engine.rb
CHANGED
@@ -2,7 +2,8 @@ module YSI
|
|
2
2
|
class Engine
|
3
3
|
attr_reader :assertions
|
4
4
|
attr_reader :executor
|
5
|
-
|
5
|
+
attr_writer :tag_date
|
6
|
+
attr_accessor :version, :release_archive
|
6
7
|
attr_accessor :out
|
7
8
|
attr_accessor :data_dir
|
8
9
|
|
@@ -96,6 +97,10 @@ module YSI
|
|
96
97
|
"v#{version}"
|
97
98
|
end
|
98
99
|
|
100
|
+
def tag_date
|
101
|
+
@tag_date && @tag_date.utc
|
102
|
+
end
|
103
|
+
|
99
104
|
def release_archive_file_name
|
100
105
|
File.basename(release_archive)
|
101
106
|
end
|
data/lib/yes_ship_it.rb
CHANGED
@@ -67,7 +67,7 @@ Checking version number: 0.0.1
|
|
67
67
|
Checking change log: CHANGELOG.md
|
68
68
|
Checking tag: v0.0.1
|
69
69
|
|
70
|
-
red_herring 0.0.1 already shipped on
|
70
|
+
red_herring 0.0.1 already shipped on 2015-06-30 22:46:19 UTC
|
71
71
|
EOT
|
72
72
|
|
73
73
|
expect(run_command(working_directory: File.join(dir, "red_herring"))).
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative "../spec_helper"
|
2
|
+
|
3
|
+
describe YSI::Tag do
|
4
|
+
describe "#get_tag_date" do
|
5
|
+
it "gets tag date" do
|
6
|
+
engine = YSI::Engine.new
|
7
|
+
engine.version = "0.0.2"
|
8
|
+
tag = YSI::Tag.new(engine)
|
9
|
+
|
10
|
+
executor = double
|
11
|
+
expect(executor).to receive(:run_command).with(["git", "show", "v0.0.2"]).
|
12
|
+
and_return("Date: Tue Jul 14 01:13:16 2015 +0200")
|
13
|
+
|
14
|
+
tag.get_tag_date(executor)
|
15
|
+
|
16
|
+
expect(engine.tag_date).to eq(Time.parse("20150713T231316Z"))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "#check" do
|
21
|
+
it "gets an existing tag" do
|
22
|
+
expect_any_instance_of(YSI::Executor).to receive(:run_command).
|
23
|
+
with(["git", "tag"]).and_return("v0.0.1\nv0.0.2\n")
|
24
|
+
|
25
|
+
engine = YSI::Engine.new
|
26
|
+
engine.version = "0.0.2"
|
27
|
+
tag = YSI::Tag.new(engine)
|
28
|
+
|
29
|
+
expect(tag).to receive(:get_tag_date)
|
30
|
+
|
31
|
+
tag.check
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#assert" do
|
36
|
+
it "creates a tag" do
|
37
|
+
engine = YSI::Engine.new
|
38
|
+
engine.version = "0.0.2"
|
39
|
+
tag = YSI::Tag.new(engine)
|
40
|
+
|
41
|
+
executor = double
|
42
|
+
expect(executor).to receive(:run_command).
|
43
|
+
with(["git", "tag", "-a", "v0.0.2", "-m", "0.0.2"])
|
44
|
+
expect(tag).to receive(:get_tag_date)
|
45
|
+
|
46
|
+
tag.assert(executor)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yes_ship_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- spec/unit/assertions/release_archive_spec.rb
|
207
207
|
- spec/unit/assertions/release_branch_spec.rb
|
208
208
|
- spec/unit/assertions/submitted_rpm_spec.rb
|
209
|
+
- spec/unit/assertions/tag_spec.rb
|
209
210
|
- spec/unit/assertions/version_spec.rb
|
210
211
|
- spec/unit/assertions/working_directory_spec.rb
|
211
212
|
- spec/unit/assertions/yes_it_shipped_spec.rb
|