rbld 1.3.6 → 1.3.7

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: 6b6e6b6c83de186b90268b6fa03871fd6c59e69a
4
- data.tar.gz: b4523b349fb7b8fb87ab6c13b6f5c010b601c06c
3
+ metadata.gz: 59a5ab4410529f2d2b3482b9d732b08044f5f3de
4
+ data.tar.gz: ba25955d34d8888761ebd233728ada0cfcca0178
5
5
  SHA512:
6
- metadata.gz: 45a8047ed0fc8fbc2c139de6a3e27d0e5cb26da6946376614baf9563d030c9d6aea346ec7ea24ec2157f8b2b78686d1d05fadfcca81c2f313ba422cd905c258a
7
- data.tar.gz: 30a6141855472dbe47b8612457a2fe7a1bc9328e4b51d3fb856a660e2ff3807eba00114d71e8df77a7bc33e939df140e3100aa249fdf8ebd1f155919189a5c11
6
+ metadata.gz: 26cd599a7e8003b475b7a209cac0bccc61ce35e6307e735db5eaa0c6ce47d950105f21fc1ca9a02a15f300db239c12bf0fab8df956ffa1442b0b08df9bef57a2
7
+ data.tar.gz: e9d7a83df474d789a99a9498e79a44f0575899e4cc0a3246a232f763182e1239534db0f79adf1229b5f4cb018321dbb9a62fc658dd52270335bb25b98e4b1b56
@@ -20,7 +20,7 @@ module Rebuild::CLI
20
20
  end
21
21
 
22
22
  raise "New tag not specified" unless tag
23
- Environment.validate_component( 'new tag', tag )
23
+ Environment.validate_tag_name( 'new tag', tag )
24
24
  return tag, ARGV
25
25
  end
26
26
  end
@@ -1 +1 @@
1
- 1.3.6
1
+ 1.3.7
@@ -7,10 +7,13 @@ require_relative 'rbld_plugins'
7
7
  module Rebuild::CLI
8
8
  extend Rebuild::Utils::Errors
9
9
 
10
+ name_error = "Invalid %s, it may contain lowercase and uppercase letters, digits, underscores, periods and dashes"
11
+
10
12
  rebuild_errors \
11
13
  EnvironmentNameEmpty: 'Environment name not specified',
12
14
  EnvironmentNameWithoutTagExpected: 'Environment tag must not be specified',
13
- EnvironmentNameError: 'Invalid %s, it may contain a-z, A-Z, 0-9, - and _ characters only',
15
+ TagNameError: "#{name_error} and may not start with a period or a dash.",
16
+ EnvironmentNameError: "#{name_error} and may not start or end with a dash, period or underscore.",
14
17
  HandlerClassNameError: '%s'
15
18
 
16
19
  class Environment
@@ -24,9 +27,17 @@ module Rebuild::CLI
24
27
  @full = "#{@name}:#{@tag}"
25
28
  end
26
29
 
27
- def self.validate_component( name, value )
30
+ def self.validate_environment_name( name, value )
28
31
  raise EnvironmentNameError, "#{name} (#{value})" \
29
- unless value.match( /^[[:alnum:]\_\-]*$/ )
32
+ unless value.match(/^[[:alnum:]\.\-\_]*$/) and \
33
+ !value.start_with?('_','-','.') and \
34
+ !value.end_with?('_','-','.')
35
+ end
36
+
37
+ def self.validate_tag_name( name, value )
38
+ raise TagNameError, "#{name} (#{value})" \
39
+ unless value.match(/^[[:alnum:]\.\-\_]*$/) and \
40
+ !value.start_with?('-','.')
30
41
  end
31
42
 
32
43
  def to_s
@@ -59,8 +70,8 @@ module Rebuild::CLI
59
70
 
60
71
  def validate_name_tag(opts)
61
72
  raise EnvironmentNameEmpty if @name.empty? && !opts[:allow_empty]
62
- self.class.validate_component( "environment name", @name ) unless @name.empty?
63
- self.class.validate_component( "environment tag", @tag ) unless @tag.empty?
73
+ self.class.validate_environment_name( "environment name", @name ) unless @name.empty?
74
+ self.class.validate_tag_name( "environment tag", @tag ) unless @tag.empty?
64
75
  end
65
76
  end
66
77
 
@@ -33,7 +33,7 @@ module Rebuild
33
33
  end
34
34
 
35
35
  def self.raw_trace(msg)
36
- STDOUT.write( "#{msg}".light_black )
36
+ STDOUT.write( "#{msg}".cyan )
37
37
  STDOUT.flush
38
38
  end
39
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbld
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Fleytman
8
8
  autorequire:
9
9
  bindir: cli/bin
10
10
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -486,5 +486,5 @@ rubyforge_project:
486
486
  rubygems_version: 2.6.11
487
487
  signing_key:
488
488
  specification_version: 4
489
- summary: rbld-1.3.6
489
+ summary: rbld-1.3.7
490
490
  test_files: []