capistrano-fiesta 1.5.2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32a9c08327b9dcc1480bb8f271eb2389b58ac9f3
4
- data.tar.gz: '0692c911f0a61575ee9696bbed03e2782c63b7de'
3
+ metadata.gz: 713f3f018e034e340711b332992b14bc2efa27ad
4
+ data.tar.gz: 4f0db3184951ec2294ac8937937059251c738390
5
5
  SHA512:
6
- metadata.gz: '0589d29a44f9a8adcb618217656d54c8e0f292a9d82c85ef472b23ec241dd261f59dceacd12ae5d410ad58866e9dd039dd947f0c7f44edbd658ada0645aaf3df'
7
- data.tar.gz: c6364563ccfba1b12eac4d415870afddea0b501df6bdcc8031c6864e4a23c102a4a7e2a4f4de82a07daaf0ff6f5732e138a2f1f1461a052c1eca0b82e5dc7e9d
6
+ metadata.gz: '0180b58dd41a92cb6a4e501605edc861d7c13abac0fb801ec9082dc212210cae9ded6d3b3e395f5603b7d760c5cde904f420f389694485bde0597aa88decca0e'
7
+ data.tar.gz: 2b6c334ca55fe53a0da861aa9aa98b3325f2c902d1ae8829bf04f6efe6bc4d3926c4e0bd5e33c08244bea01b73f2d3b2bf41bfed09e4444b44ce4cd6f9653234
@@ -1,5 +1,7 @@
1
1
  notifications:
2
2
  email: false
3
3
  rvm:
4
- - 2.2.2
4
+ - 2.3.7
5
+ - 2.4.4
6
+ - 2.5.1
5
7
  sudo: false
@@ -1,3 +1,4 @@
1
+ require "capistrano/fiesta/repo_url_parser"
1
2
  require "capistrano/fiesta/report"
2
3
 
3
4
  load File.expand_path("../tasks/fiesta.rake", __FILE__)
@@ -4,6 +4,9 @@ require "yaml"
4
4
  module Capistrano
5
5
  module Fiesta
6
6
  class Github
7
+ class << self
8
+ attr_accessor :config
9
+ end
7
10
 
8
11
  def self.client
9
12
  new.client
@@ -16,6 +19,10 @@ module Capistrano
16
19
  private
17
20
 
18
21
  def config
22
+ self.class.config || default_config
23
+ end
24
+
25
+ def default_config
19
26
  { access_token: hub_config["oauth_token"] }
20
27
  end
21
28
 
@@ -0,0 +1,14 @@
1
+ require "attr_extras/explicit"
2
+
3
+ module Capistrano
4
+ module Fiesta
5
+ class RepoUrlParser
6
+ extend AttrExtras.mixin
7
+ pattr_initialize :repo_url
8
+
9
+ def repo
10
+ repo_url.slice(/github.com[:\/](\S+\/\S+)\.git/, 1)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -9,12 +9,13 @@ require "capistrano/fiesta/logger"
9
9
  require "capistrano/fiesta/story"
10
10
  require "capistrano/fiesta/auto_composed_story"
11
11
  require "capistrano/fiesta/release"
12
+ require "capistrano/fiesta/timestamp_normalizer"
12
13
 
13
14
  module Capistrano
14
15
  module Fiesta
15
16
  class Report
16
17
  extend AttrExtras.mixin
17
- pattr_initialize :github_url, [:last_release, :comment, :auto_compose]
18
+ pattr_initialize :repo, [:last_released_at, :comment, :auto_compose]
18
19
  attr_query :auto_compose?
19
20
 
20
21
  def announce(config = {})
@@ -76,13 +77,9 @@ module Capistrano
76
77
  []
77
78
  end
78
79
 
79
- def repo
80
- github_url.match(/github.com[:\/](\S+\/\S+)\.git/)[1]
81
- end
82
-
83
80
  def last_released_at
84
- if last_release
85
- Time.parse(last_release + "Z00:00").iso8601
81
+ if @last_released_at
82
+ TimestampNormalizer.new(@last_released_at).run.iso8601
86
83
  end
87
84
  end
88
85
 
@@ -0,0 +1,18 @@
1
+ require "attr_extras/explicit"
2
+
3
+ module Capistrano
4
+ module Fiesta
5
+ class TimestampNormalizer
6
+ extend AttrExtras.mixin
7
+ pattr_initialize :timestamp
8
+
9
+ def run
10
+ if timestamp.is_a?(Time)
11
+ timestamp
12
+ else
13
+ Time.parse(timestamp.to_s + "Z")
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Fiesta
3
- VERSION = "1.5.2"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -18,13 +18,16 @@ namespace :fiesta do
18
18
  task :announce do
19
19
  run_locally do
20
20
  report.announce(slack_params)
21
- report.create_release(timestamp)
22
21
  Capistrano::Fiesta::Logger.logs.each { |log| warn log }
23
22
  end
24
23
  end
25
24
 
26
25
  def build_report
27
- Capistrano::Fiesta::Report.new(repo_url, report_options)
26
+ Capistrano::Fiesta::Report.new(repo, report_options)
27
+ end
28
+
29
+ def repo
30
+ Capistrano::Fiesta::RepoUrlParser.new(repo_url).repo
28
31
  end
29
32
 
30
33
  def report
@@ -33,7 +36,7 @@ namespace :fiesta do
33
36
 
34
37
  def report_options
35
38
  {
36
- last_release: last_release,
39
+ last_released_at: last_release,
37
40
  comment: fetch(:fiesta_comment),
38
41
  auto_compose: fetch(:fiesta_auto_compose)
39
42
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-fiesta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-21 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_extras
@@ -189,10 +189,12 @@ files:
189
189
  - lib/capistrano/fiesta/github.rb
190
190
  - lib/capistrano/fiesta/logger.rb
191
191
  - lib/capistrano/fiesta/release.rb
192
+ - lib/capistrano/fiesta/repo_url_parser.rb
192
193
  - lib/capistrano/fiesta/report.rb
193
194
  - lib/capistrano/fiesta/slack_dummy.rb
194
195
  - lib/capistrano/fiesta/story.rb
195
196
  - lib/capistrano/fiesta/template.rb
197
+ - lib/capistrano/fiesta/timestamp_normalizer.rb
196
198
  - lib/capistrano/fiesta/version.rb
197
199
  - lib/capistrano/tasks/fiesta.rake
198
200
  - lib/capistrano/templates/draft.erb
@@ -216,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
218
  version: '0'
217
219
  requirements: []
218
220
  rubyforge_project:
219
- rubygems_version: 2.5.2
221
+ rubygems_version: 2.6.13
220
222
  signing_key:
221
223
  specification_version: 4
222
224
  summary: Celebrate your releases!