shards 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 523c7e9cab3fd380bcea554992a5c19251c84479
4
- data.tar.gz: 9e928d55218cde3343ce950d6d6f2cc256cca8de
3
+ metadata.gz: f682cd536cd85467187d078ce7ff40db026ae5fd
4
+ data.tar.gz: b8bd5870c09c0b5f8a8b1128328cacd341b62249
5
5
  SHA512:
6
- metadata.gz: f38a73a336d92cd2a610a8a0f633cf06c03b95b5ad5484a37f86b89e0481ed3fb1ede5defda6db43d4cd80705506e3649c54b8f4a0a0b0e60073bdca2dbf6d76
7
- data.tar.gz: afc4fb3664b00b44326f1eb64dde9a14579f57e815b2fff2633912c4153fd09bbc34b040b33d8f0758b5a7ec7c88f5705aa3ec2d4d7470170bdbce42a28598ff
6
+ metadata.gz: 427431a12c0e00156320910f355ce49bda25a6eed8df29f1cecc0d934d31750bf9ac0c8a0130473776b3b6b5220dc885af0e4be0a1b0c18d81c157d6011856a0
7
+ data.tar.gz: e442981b33fdb52863581d3f4c1586bfee28192e23373bcbc7d2ded01c6f9e22e1b402cdcf90bbb29e93ee3ab5c4d7f7caddfb47412d2dc49e763f0e630459e5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shards (1.0.2)
4
+ shards (1.0.3)
5
5
  aws-sdk-route53 (~> 1.9)
6
6
  dotenv (~> 2.4)
7
7
  git (~> 1.4)
@@ -85,6 +85,7 @@ terminal:
85
85
  wrong: finish
86
86
 
87
87
  clean_repo_and_exit:
88
+ wrong_message: Cuould not clean the repository.
88
89
  correct: finish
89
90
 
90
91
  finish:
@@ -97,12 +98,28 @@ terminal:
97
98
 
98
99
  fastterminal:
99
100
 
100
- create:
101
+ validate_client:
102
+ correct: validate_domain
103
+ wrong: clean_repo_and_exit
104
+ wrong_message: The client name %s.
105
+ min_size: 2
106
+
107
+ validate_domain:
108
+ correct: validate_location
109
+ wrong: clean_repo_and_exit
110
+ wrong_message: The domain %s.
111
+ min_size: 3
112
+ regex: ^[a-zA-Z0-9_]*$
113
+
114
+ validate_location:
115
+ correct: validate_stage
116
+ wrong_message: Location %s does not exist.
117
+ wrong: clean_repo_and_exit
118
+
119
+ validate_stage:
101
120
  correct: check_shard_presence_in_shards
121
+ wrong_message: Stage %s does not exist.
102
122
  wrong: clean_repo_and_exit
103
- client_min_size: 2
104
- domain_min_size: 3
105
- domain_regex: ^[a-zA-Z0-9_]*$
106
123
 
107
124
  check_shard_presence_in_shards:
108
125
  wrong_message: The shard %s exists in shards.
@@ -161,6 +178,7 @@ fastterminal:
161
178
  wrong: finish
162
179
 
163
180
  clean_repo_and_exit:
181
+ wrong_message: Cuould not clean the repository.
164
182
  correct: finish
165
183
 
166
184
  finish:
@@ -1,3 +1,3 @@
1
1
  module Shards
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -8,44 +8,35 @@ module Shards
8
8
 
9
9
  attr_accessor :client, :location, :stage, :domain, :site, :params
10
10
 
11
- def create
11
+ def validate_client
12
12
 
13
- @wrong_text=false
13
+ cli=params[:client]
14
14
 
15
- validate_client params[:client]
16
- validate_domain params[:domain]
17
- validate_location params[:location]
18
- validate_stage params[:stage]
19
-
20
- end
21
-
22
- def validate_client cli
23
-
24
- @wrong_text=false
25
-
26
- validate_min_size cli, @step['client_min_size']
15
+ validate_min_size cli, step['min_size']
27
16
 
28
17
  @client=cli.capitalize
29
18
 
30
19
  end
31
20
 
32
- def validate_location loc
33
- raise "Location %s unavailable" % loc unless config.locations.keys.include? loc
21
+ def validate_location
22
+ loc=params[:location]
23
+ raise_wrong_text loc unless config.locations.keys.include? loc
34
24
  @location=config.locations[loc]
35
25
  end
36
26
 
37
- def validate_stage st
38
- raise "Stage %s unavailable" % st unless location.stages.keys.include? st
27
+ def validate_stage
28
+ st=params[:stage]
29
+ raise_wrong_text st unless location.stages.keys.include? st
39
30
  @stage=location.stages[st]
40
31
  end
41
32
 
42
- def validate_domain domain_name
33
+ def validate_domain
43
34
 
44
- @wrong_text=false
35
+ domain_name=params[:domain]
45
36
 
46
- validate_min_size domain_name, @step['domain_min_size']
37
+ validate_min_size domain_name, step['min_size']
47
38
 
48
- validate_regex domain_name, @step['domain_regex']
39
+ validate_regex domain_name, step['regex']
49
40
 
50
41
  @domain=domain_name
51
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shards
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego PL