actions-updater 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/actions-updater +11 -3
  4. data/lib/action.rb +2 -3
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16a4e45e4a98b20859261172e2295fbe622d89d3795c2f96f9e6cc163d4327b9
4
- data.tar.gz: 5228422533bf62977104b6f52c5d2c0555d20700fdf371cd3487d09ff5eb7199
3
+ metadata.gz: 64214041999b78573bea90ddafc7ceea07a5923c73401fd07447b847ff71d816
4
+ data.tar.gz: '06083086078b6283f1d8c77db2cf82a8906866a445f6f2f8dcd915b2120f38b5'
5
5
  SHA512:
6
- metadata.gz: e761d5a3c1c404a77554630b36de4593373a2fceec20393cdc2b9ccf7fa3fec448198371f4c0c14444f6431dc7aa081b5dff58e0e176ba2bc203ec928c9ddec9
7
- data.tar.gz: f8aedd508c5a0c44a6c4aa1642cdef3c2c1ffff59852647e96ea6155353660c3caba222fadf8ffdfb21d4b56dbc7a055ee5c247a86dbf0490093a6a94dbef0cf
6
+ metadata.gz: be10723f8ea1eca6033ad9a37122aee70eb44dec2ffc392db9c9f337aa5a7c19802b6497eba1b149d9dcf2187735be89aa2888378da13ec22adc0b546b6b551c
7
+ data.tar.gz: a5e11d19168436a71905b6fa91ae779b16434335ba3b3a02fff49173b89b93c171a3574892f17517aa61ce1482919bf8b0376b3ae67244322b5585b1f47cd48e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.11
@@ -17,16 +17,24 @@ OptionParser.new do |parser|
17
17
  end.parse!
18
18
 
19
19
  ARGV.each do |path|
20
- puts "#{'==>'.blue} #{path}".bold
20
+ puts path.magenta
21
21
  yaml = File.read(path)
22
22
  actions = Action.array_from_yaml(yaml)
23
23
  actions.each do |current_action|
24
24
  new_action = current_action.clone
25
25
  new_action.ref = current_action.latest_tag
26
+ new_ref_str = new_action.ref.bold
27
+ current_ref_str = current_action.ref.bold
28
+ current_action_str = current_action.print_without_ref.cyan.bold
26
29
 
27
- next if current_action == new_action && @newer
30
+ if current_action == new_action
31
+ next if @newer
32
+ else
33
+ new_ref_str = new_ref_str.green
34
+ current_ref_str = current_ref_str.red
35
+ end
28
36
 
29
- puts "#{current_action.print_without_ref.cyan.bold} : #{current_action.ref.red.bold} ==> #{new_action.ref.green.bold}"
37
+ puts "#{current_action_str} : #{current_ref_str} ==> #{new_ref_str}"
30
38
 
31
39
  next unless @write
32
40
 
@@ -4,7 +4,6 @@ require 'yaml'
4
4
 
5
5
  class Action
6
6
  attr_accessor :user, :repo, :dir, :ref
7
- attr_reader :url
8
7
 
9
8
  USES_REGEX = %r{^(?<user>[^/]+)[/](?<repo>[^/]+)[/]?(?<dir>.+)?[@](?<ref>.+)$}.freeze
10
9
  TAGS_REGEX = %r{refs/tags/(.*)$}.freeze
@@ -34,7 +33,6 @@ class Action
34
33
  @repo = captures['repo']
35
34
  @dir = captures['dir']
36
35
  @ref = captures['ref']
37
- @url = "#{DOMAIN}/#{@user}/#{@repo}"
38
36
  end
39
37
 
40
38
  def to_s
@@ -54,7 +52,8 @@ class Action
54
52
  end
55
53
 
56
54
  def latest_tag
57
- tags = `git ls-remote -t #{@url}`.scan(TAGS_REGEX).flatten
55
+ url = "#{DOMAIN}/#{@user}/#{@repo}"
56
+ tags = `git ls-remote -t #{url}`.scan(TAGS_REGEX).flatten
58
57
  tags.reject! do |tag|
59
58
  TAG_REJECT_REASONS.any? do |reason|
60
59
  tag.include?(reason)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actions-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dawid Dziurla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize