env_setup 0.1.0 → 0.1.3

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
  SHA256:
3
- metadata.gz: a240cc9e78f87a6c91ad9fc36d47ee3505dee43963dffd78c2683881c5fe072f
4
- data.tar.gz: 890c36f37359a7148789a7b17db747f9d10a5fa8188d1958912736e8add80984
3
+ metadata.gz: 78f518974541de10a07ab4ed5f9fe126ae435859d30d2de063cbd903cfa3c99b
4
+ data.tar.gz: 52f4e06dc2db21cb4bcdc048e61a687ef0bc80a4a6ddf2c9eca14a95142be495
5
5
  SHA512:
6
- metadata.gz: ba6f0b467ccbb05a95e1106f43e820550ef265d9aabd8c93e2ead5a218f50583656b7747579b472e8fb253488bf5e654614944e9edbb1e258133df7e7814ae73
7
- data.tar.gz: 84c3e6f5cc6f516e34d11973e1c9cf6b6e04c7570576ed824e9d7e7f892bb52a933150227734a07e92279a3516425efe75445e31bc38d403fafdaf1c38c0da62
6
+ metadata.gz: ecfb474839b17b793687e44ad35a4b8a74d8977eafa8f4a8c73b2fc7dfe394d19aa21c54a4255046686e0c2972281b50393776defcc69541dc3718575593662d
7
+ data.tar.gz: dcb26f5c5894812693f575e9dfbaaf1c4b3317d9cf94f9b5a3fff202e4ff4850913b82341f847ff4058ebef7c04d0acba034e40cab231f703fcd5895812a0a45
data/bin/env_setup CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'env_setup/env_builder'
3
+ # require 'env_setup/env_builder'
4
4
  require 'json'
5
5
 
6
6
  inputs = Hash[ARGV.flat_map { |s| s.scan(/--?([^=\s]+)(?:=(\S+))?/) }]
7
7
  template_file = inputs.delete('TEMPLATE')
8
+ puts "template #{template_file}"
8
9
  template = JSON.parse(File.read(template_file))
9
10
  env_file = inputs.delete('ENV_FILE') || '.env'
10
11
  aws_access_key = inputs.delete('AWS_ACCESS_KEY')
@@ -27,7 +27,7 @@ module EnvSetup
27
27
  def build_var(var_template)
28
28
  return var_template unless var_template.is_a?(Hash)
29
29
 
30
- var_builder(var_template).call
30
+ var_builder(var_template.transform_keys!(&:to_s)).call
31
31
  end
32
32
 
33
33
  private
@@ -40,6 +40,8 @@ module EnvSetup
40
40
  { builder: EnvSetup::Builder::Generator, if: -> { var_template['generator'] } }
41
41
  ].find { |option| option[:if].call }
42
42
 
43
+ raise "Invalid var builder: #{var_template.inspect}" unless builder
44
+
43
45
  builder[:builder].new(var_template, vars.merge(inputs))
44
46
  end
45
47
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnvSetup
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.3'
5
5
  end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+ require 'env_setup/builder/generator'
3
+
4
+ RSpec.describe EnvSetup::Builder::Generator do
5
+ let(:builder) { described_class.new(value, params) }
6
+ let(:params) { {} }
7
+
8
+ describe 'salt generator' do
9
+ let(:salt) { 'abc123' }
10
+ let(:value) { { 'generator' => 'salt'} }
11
+
12
+ before do
13
+ allow(builder).to receive(:salt).and_return(salt)
14
+ end
15
+
16
+ it 'returns generated salt value' do
17
+ expect(builder.call).to eq salt
18
+ end
19
+ end
20
+
21
+ describe 'secret generator' do
22
+ let(:secret) { 'abc1234567' }
23
+ let(:value) { { 'generator' => 'secret'} }
24
+
25
+ before do
26
+ allow(builder).to receive(:secret).and_return(secret)
27
+ end
28
+
29
+ it 'returns generated secret value' do
30
+ expect(builder.call).to eq secret
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ require 'env_setup/builder/input'
3
+
4
+ RSpec.describe EnvSetup::Builder::Input do
5
+ let(:builder) { described_class.new(value, params) }
6
+
7
+ context 'with existing input' do
8
+ let(:params) { { 'INPUT1' => 'John' } }
9
+ let(:value) { { 'input' => 'INPUT1' } }
10
+
11
+ it 'builds var with input value' do
12
+ expect(builder.call).to eq 'John'
13
+ end
14
+ end
15
+
16
+ context 'without existing input' do
17
+ let(:params) { { 'INPUT2' => 'John' } }
18
+ let(:value) { { 'input' => 'INPUT1' } }
19
+
20
+ it 'raises invalid input error' do
21
+ expect { builder.call }.to raise_error(EnvSetup::InvalidInput)
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ require 'env_setup/builder/pattern'
3
+
4
+ RSpec.describe EnvSetup::Builder::Pattern do
5
+ let(:builder) { described_class.new(value, params) }
6
+
7
+ context 'with one replacement' do
8
+ let(:params) { { 'MY_VAR' => 'Hey!' } }
9
+ let(:value) { { 'pattern' => 'somethig{{MY_VAR}}' } }
10
+
11
+ it 'generates var with embbeded params' do
12
+ expect(builder.call).to eq 'somethigHey!'
13
+ end
14
+ end
15
+
16
+ context 'with multiple replacements' do
17
+ let(:params) { { 'MY_VAR' => 'Hey!', 'FOO' => 'bar' } }
18
+ let(:value) { { 'pattern' => 'somethig{{MY_VAR}}.{{FOO}}' } }
19
+
20
+ it 'generates var with embbeded params' do
21
+ expect(builder.call).to eq 'somethigHey!.bar'
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,202 @@
1
+ require 'json'
2
+ require 'spec_helper'
3
+ require 'env_setup/env_builder'
4
+
5
+ RSpec.describe EnvSetup::EnvBuilder do
6
+ describe '.build_json' do
7
+ let(:env_name) { 'PR-12345' }
8
+ let(:secret) { SecureRandom.hex }
9
+ let(:salt) { SecureRandom.hex(2) }
10
+ let(:template) do
11
+ {
12
+ 'APP_NAME' => 'pr-123',
13
+ 'DOMAIN' => {
14
+ 'value' => 'foobar.com'
15
+ },
16
+ 'APP_HOST' => {
17
+ 'pattern' => 'https://{{APP_NAME}}.{{DOMAIN}}'
18
+ },
19
+ 'APP_SECRET' => {
20
+ 'generator' => 'secret'
21
+ },
22
+ 'APP_PASSWORD' => {
23
+ 'generator' => 'salt'
24
+ },
25
+ 'INTEGRATION_APP_HOST' => {
26
+ 'input' => 'INTEGRATION_APP_HOST'
27
+ },
28
+ 'INTEGRATION_APP_URL' => {
29
+ 'pattern' => '{{INTEGRATION_APP_HOST}}/api/integrate'
30
+ }
31
+ }
32
+ end
33
+
34
+ context 'with aws secrets manager' do
35
+ let(:inputs) do
36
+ { 'INTEGRATION_APP_HOST' => 'https://integrate.foobar2.com' }
37
+ end
38
+ let(:expected_json) do
39
+ {
40
+ 'LANG' => 'en_US.UTF-8',
41
+ 'DOMAIN' => 'foobar.com',
42
+ 'APP_NAME' => 'pr-123',
43
+ 'HOST' => 'wss://pr-123-community2-cable.foobar.com/cable',
44
+ 'APP_HOST' => 'https://pr-123.foobar.com',
45
+ 'APP_SECRET' => secret,
46
+ 'APP_PASSWORD' => salt,
47
+ 'INTEGRATION_APP_HOST' => inputs['INTEGRATION_APP_HOST'],
48
+ 'INTEGRATION_APP_URL' => "#{inputs['INTEGRATION_APP_HOST']}/api/integrate"
49
+ }
50
+ end
51
+
52
+ before do
53
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:secret).and_return(secret)
54
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:salt).and_return(salt)
55
+
56
+ allow(EnvSetup).to receive(:configuration).and_return(
57
+ EnvSetup::Configuration.new.tap do |config|
58
+ config.env_name = env_name
59
+ config.template = template
60
+ config.aws_access_key = 'aws_access_key'
61
+ config.aws_secret_access_key = 'aws_secret_access_key'
62
+ config.aws_region = 'aws_region'
63
+ config.aws_secret_name = 'aws_secret_name'
64
+ end
65
+ )
66
+ allow_any_instance_of(EnvSetup::EnvBuilder).to receive(:aws_secrets).and_return(
67
+ {
68
+ 'LANG' => 'en_US.UTF-8',
69
+ 'HOST' => {"pattern" => "wss://{{APP_NAME}}-community2-cable.{{DOMAIN}}/cable"},
70
+ }
71
+ )
72
+ end
73
+
74
+ it 'generates env vars json' do
75
+ expect(described_class.new(inputs).build_json).to eq expected_json
76
+ end
77
+ end
78
+
79
+ context 'without aws secrets manager' do
80
+ let(:inputs) do
81
+ { 'INTEGRATION_APP_HOST' => 'https://integrate.foobar2.com' }
82
+ end
83
+ let(:expected_json) do
84
+ {
85
+ 'APP_NAME' => 'pr-123',
86
+ 'DOMAIN' => 'foobar.com',
87
+ 'APP_HOST' => 'https://pr-123.foobar.com',
88
+ 'APP_SECRET' => secret,
89
+ 'APP_PASSWORD' => salt,
90
+ 'INTEGRATION_APP_HOST' => inputs['INTEGRATION_APP_HOST'],
91
+ 'INTEGRATION_APP_URL' => "#{inputs['INTEGRATION_APP_HOST']}/api/integrate"
92
+ }
93
+ end
94
+
95
+ before do
96
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:secret).and_return(secret)
97
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:salt).and_return(salt)
98
+
99
+ allow(EnvSetup).to receive(:configuration).and_return(
100
+ EnvSetup::Configuration.new.tap do |config|
101
+ config.env_name = env_name
102
+ config.template = template
103
+ end
104
+ )
105
+ end
106
+
107
+ it 'generates env vars json' do
108
+ expect(described_class.new(inputs).build_json).to eq expected_json
109
+ end
110
+ end
111
+
112
+ context 'test' do
113
+ before do
114
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:secret).and_return("secret")
115
+ allow_any_instance_of(EnvSetup::Builder::Generator).to receive(:salt).and_return("salt")
116
+
117
+ allow(EnvSetup).to receive(:configuration).and_return(
118
+ EnvSetup::Configuration.new.tap do |config|
119
+ config.env_name = 'pr-123'
120
+ config.template = template
121
+ end
122
+ )
123
+ end
124
+
125
+ let(:template) do
126
+ {
127
+ "ASSET_HOST": {
128
+ "pattern": "https://{{ENV_NAME}}.{{DOMAIN}}"
129
+ },
130
+ "CANONICAL_URL": {
131
+ "pattern": "https://{{ENV_NAME}}.{{DOMAIN}}"
132
+ },
133
+ "DISCOURSE_AUTH_DOMAIN": {
134
+ "pattern": "https://{{ENV_NAME}}.goeatrightnow.com"
135
+ },
136
+ "DOMAIN_NAME": {
137
+ "input": "DOMAIN"
138
+ },
139
+ "MESSENGER_URI": {
140
+ "input": "MESSENGER_URI"
141
+ },
142
+ "MSCOMMUNITY_URL": {
143
+ "input": "MSCOMMUNITY_URL"
144
+ },
145
+ "PROGRAM_BBS_APP_HOST": {
146
+ "pattern": "{{ENV_NAME}}.breathebysharecare.com"
147
+ },
148
+ "PROGRAM_CTQ_APP_HOST": {
149
+ "pattern": "{{ENV_NAME}}.cravingtoquit.com"
150
+ },
151
+ "PROGRAM_ERN_APP_HOST": {
152
+ "pattern": "{{ENV_NAME}}.goeatrightnow.com"
153
+ },
154
+ "PROGRAM_UA_APP_HOST": {
155
+ "pattern": "{{ENV_NAME}}.unwindinganxiety.com"
156
+ },
157
+ "PROGRAM_UFS_APP_HOST": {
158
+ "pattern": "{{ENV_NAME}}.unwindingfromsharecare.com"
159
+ }
160
+ }
161
+ end
162
+
163
+ let(:inputs) do
164
+ {
165
+ 'DOMAIN' => 'mindsciences.net',
166
+ 'MESSENGER_URI' => 'messenger.mindsciences.net',
167
+ 'MSCOMMUNITY_URL' => 'mscom.mindsciences.net'
168
+ }
169
+ end
170
+
171
+ it 'generate json' do
172
+ described_class.new(inputs).build_json
173
+ end
174
+ end
175
+ end
176
+
177
+ describe '.build_var' do
178
+ let(:inputs) { { 'MY_VAR' => 'Hey!', 'FOO' => 'bar' } }
179
+ let(:env_name) { 'env-test' }
180
+ let(:template) { {} }
181
+ let(:builder) { described_class.new(inputs) }
182
+
183
+ before do
184
+ EnvSetup.configure do |config|
185
+ config.template = template
186
+ config.env_name = env_name
187
+ end
188
+ end
189
+
190
+ describe 'simple value' do
191
+ it 'returns same value' do
192
+ expect(builder.build_var('foo')).to eq 'foo'
193
+ end
194
+ end
195
+
196
+ describe 'nested value' do
197
+ it 'returns same value' do
198
+ expect(builder.build_var('value' => 'foo')).to eq 'foo'
199
+ end
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.describe EnvSetup do
2
+ it 'has a version number' do
3
+ expect(EnvSetup::VERSION).not_to be nil
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ require 'bundler/setup'
2
+ require 'env_setup'
3
+
4
+ RSpec.configure do |config|
5
+ # Enable flags like --only-failures and --next-failure
6
+ config.example_status_persistence_file_path = '.rspec_status'
7
+
8
+ # Disable RSpec exposing methods globally on `Module` and `main`
9
+ config.disable_monkey_patching!
10
+
11
+ config.expect_with :rspec do |c|
12
+ c.syntax = :expect
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonatas Daniel Hermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-20 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,21 +88,10 @@ executables:
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - ".gitignore"
92
- - ".rspec"
93
- - ".rubocop.yml"
94
- - ".travis.yml"
95
- - CHANGELOG.md
96
- - Gemfile
97
- - Gemfile.lock
98
91
  - README.md
99
- - Rakefile
100
92
  - bin/console
101
93
  - bin/env_setup
102
94
  - bin/setup
103
- - docs/README.md
104
- - docs/pull_request_template.md
105
- - env_setup.gemspec
106
95
  - lib/env_setup.rb
107
96
  - lib/env_setup/builder/base.rb
108
97
  - lib/env_setup/builder/generator.rb
@@ -112,6 +101,12 @@ files:
112
101
  - lib/env_setup/configuration.rb
113
102
  - lib/env_setup/env_builder.rb
114
103
  - lib/env_setup/version.rb
104
+ - spec/env_setup/builder/generator_spec.rb
105
+ - spec/env_setup/builder/input_spec.rb
106
+ - spec/env_setup/builder/pattern_spec.rb
107
+ - spec/env_setup/env_builder_spec.rb
108
+ - spec/env_setup_spec.rb
109
+ - spec/spec_helper.rb
115
110
  homepage:
116
111
  licenses: []
117
112
  metadata: {}
@@ -134,4 +129,10 @@ rubygems_version: 3.1.4
134
129
  signing_key:
135
130
  specification_version: 4
136
131
  summary: Gem to setup apps env
137
- test_files: []
132
+ test_files:
133
+ - spec/spec_helper.rb
134
+ - spec/env_setup_spec.rb
135
+ - spec/env_setup/env_builder_spec.rb
136
+ - spec/env_setup/builder/generator_spec.rb
137
+ - spec/env_setup/builder/pattern_spec.rb
138
+ - spec/env_setup/builder/input_spec.rb
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- .rvmrc
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,133 +0,0 @@
1
- require: rubocop-rspec
2
-
3
- Layout/LineLength:
4
- Max: 120
5
- Style/Documentation:
6
- Enabled: false
7
- Metrics/ClassLength:
8
- Enabled: false
9
- Metrics/ModuleLength:
10
- Enabled: false
11
- Layout/MultilineMethodCallIndentation:
12
- EnforcedStyle: indented_relative_to_receiver
13
- Layout/ArgumentAlignment:
14
- EnforcedStyle: with_fixed_indentation
15
- # https://github.com/rubocop-hq/rubocop/issues/4222#issuecomment-290722962
16
- Lint/AmbiguousBlockAssociation:
17
- Exclude:
18
- - spec/**/*
19
- RSpec/AnyInstance:
20
- Enabled: false
21
- RSpec/NestedGroups:
22
- Enabled: false
23
- AllCops:
24
- NewCops: enable
25
- TargetRubyVersion: 2.6
26
- Exclude:
27
- - Gemfile
28
- - bin/*
29
- Metrics/BlockLength:
30
- Exclude:
31
- - spec/**/*
32
- Layout/BeginEndAlignment: # (new in 0.91)
33
- Enabled: true
34
- Layout/EmptyLinesAroundAttributeAccessor: # (new in 0.83)
35
- Enabled: true
36
- Layout/SpaceAroundMethodCallOperator: # (new in 0.82)
37
- Enabled: true
38
- Lint/BinaryOperatorWithIdenticalOperands: # (new in 0.89)
39
- Enabled: true
40
- Lint/ConstantDefinitionInBlock: # (new in 0.91)
41
- Enabled: true
42
- Lint/DeprecatedOpenSSLConstant: # (new in 0.84)
43
- Enabled: true
44
- Lint/DuplicateElsifCondition: # (new in 0.88)
45
- Enabled: true
46
- Lint/DuplicateRequire: # (new in 0.90)
47
- Enabled: true
48
- Lint/DuplicateRescueException: # (new in 0.89)
49
- Enabled: true
50
- Lint/EmptyConditionalBody: # (new in 0.89)
51
- Enabled: true
52
- Lint/EmptyFile: # (new in 0.90)
53
- Enabled: true
54
- Lint/FloatComparison: # (new in 0.89)
55
- Enabled: true
56
- Lint/HashCompareByIdentity: # (new in 0.93)
57
- Enabled: true
58
- Lint/IdentityComparison: # (new in 0.91)
59
- Enabled: true
60
- Lint/MissingSuper: # (new in 0.89)
61
- Enabled: true
62
- Lint/MixedRegexpCaptureTypes: # (new in 0.85)
63
- Enabled: true
64
- Lint/OutOfRangeRegexpRef: # (new in 0.89)
65
- Enabled: true
66
- Lint/RaiseException: # (new in 0.81)
67
- Enabled: true
68
- Lint/RedundantSafeNavigation: # (new in 0.93)
69
- Enabled: true
70
- Lint/SelfAssignment: # (new in 0.89)
71
- Enabled: true
72
- Lint/StructNewOverride: # (new in 0.81)
73
- Enabled: true
74
- Lint/TopLevelReturnWithArgument: # (new in 0.89)
75
- Enabled: true
76
- Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
77
- Enabled: true
78
- Lint/UnreachableLoop: # (new in 0.89)
79
- Enabled: true
80
- Lint/UselessMethodDefinition: # (new in 0.90)
81
- Enabled: true
82
- Lint/UselessTimes: # (new in 0.91)
83
- Enabled: true
84
- Style/AccessorGrouping: # (new in 0.87)
85
- Enabled: true
86
- Style/BisectedAttrAccessor: # (new in 0.87)
87
- Enabled: true
88
- Style/CaseLikeIf: # (new in 0.88)
89
- Enabled: true
90
- Style/ClassEqualityComparison: # (new in 0.93)
91
- Enabled: true
92
- Style/CombinableLoops: # (new in 0.90)
93
- Enabled: true
94
- Style/ExplicitBlockArgument: # (new in 0.89)
95
- Enabled: true
96
- Style/ExponentialNotation: # (new in 0.82)
97
- Enabled: true
98
- Style/GlobalStdStream: # (new in 0.89)
99
- Enabled: true
100
- Style/HashAsLastArrayItem: # (new in 0.88)
101
- Enabled: true
102
- Style/HashEachMethods: # (new in 0.80)
103
- Enabled: true
104
- Style/HashLikeCase: # (new in 0.88)
105
- Enabled: true
106
- Style/HashTransformKeys: # (new in 0.80)
107
- Enabled: true
108
- Style/HashTransformValues: # (new in 0.80)
109
- Enabled: true
110
- Style/KeywordParametersOrder: # (new in 0.90)
111
- Enabled: true
112
- Style/OptionalBooleanParameter: # (new in 0.89)
113
- Enabled: true
114
- Style/RedundantAssignment: # (new in 0.87)
115
- Enabled: true
116
- Style/RedundantFetchBlock: # (new in 0.86)
117
- Enabled: true
118
- Style/RedundantFileExtensionInRequire: # (new in 0.88)
119
- Enabled: true
120
- Style/RedundantRegexpCharacterClass: # (new in 0.85)
121
- Enabled: true
122
- Style/RedundantRegexpEscape: # (new in 0.85)
123
- Enabled: true
124
- Style/RedundantSelfAssignment: # (new in 0.90)
125
- Enabled: true
126
- Style/SingleArgumentDig: # (new in 0.89)
127
- Enabled: true
128
- Style/SlicingWithRange: # (new in 0.83)
129
- Enabled: true
130
- Style/SoleNestedConditional: # (new in 0.89)
131
- Enabled: true
132
- Style/StringConcatenation: # (new in 0.89)
133
- Enabled: true
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.3.7
7
- before_install: gem install bundler -v 1.17.3
data/CHANGELOG.md DELETED
@@ -1,6 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- ruby '2.7.2'
6
-
7
- # Specify your gem's dependencies in mind_sciences-env_setup.gemspec
8
- gemspec
data/Gemfile.lock DELETED
@@ -1,76 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- env_setup (0.1.0)
5
- aws-sdk-secretsmanager (~> 1.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.2)
11
- aws-eventstream (1.1.1)
12
- aws-partitions (1.449.0)
13
- aws-sdk-core (3.114.0)
14
- aws-eventstream (~> 1, >= 1.0.2)
15
- aws-partitions (~> 1, >= 1.239.0)
16
- aws-sigv4 (~> 1.1)
17
- jmespath (~> 1.0)
18
- aws-sdk-secretsmanager (1.46.0)
19
- aws-sdk-core (~> 3, >= 3.112.0)
20
- aws-sigv4 (~> 1.1)
21
- aws-sigv4 (1.2.3)
22
- aws-eventstream (~> 1, >= 1.0.2)
23
- diff-lcs (1.3)
24
- jmespath (1.4.0)
25
- parallel (1.20.1)
26
- parser (3.0.1.0)
27
- ast (~> 2.4.1)
28
- rainbow (3.0.0)
29
- rake (10.4.2)
30
- regexp_parser (2.1.1)
31
- rexml (3.2.5)
32
- rspec (3.6.0)
33
- rspec-core (~> 3.6.0)
34
- rspec-expectations (~> 3.6.0)
35
- rspec-mocks (~> 3.6.0)
36
- rspec-core (3.6.0)
37
- rspec-support (~> 3.6.0)
38
- rspec-expectations (3.6.0)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.6.0)
41
- rspec-mocks (3.6.0)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.6.0)
44
- rspec-support (3.6.0)
45
- rubocop (1.12.1)
46
- parallel (~> 1.10)
47
- parser (>= 3.0.0.0)
48
- rainbow (>= 2.2.2, < 4.0)
49
- regexp_parser (>= 1.8, < 3.0)
50
- rexml
51
- rubocop-ast (>= 1.2.0, < 2.0)
52
- ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 3.0)
54
- rubocop-ast (1.4.1)
55
- parser (>= 2.7.1.5)
56
- rubocop-rspec (2.2.0)
57
- rubocop (~> 1.0)
58
- rubocop-ast (>= 1.1.0)
59
- ruby-progressbar (1.11.0)
60
- unicode-display_width (2.0.0)
61
-
62
- PLATFORMS
63
- ruby
64
-
65
- DEPENDENCIES
66
- bundler (~> 2.1)
67
- env_setup!
68
- rake (~> 10.0)
69
- rspec (~> 3.0)
70
- rubocop-rspec (~> 2.2)
71
-
72
- RUBY VERSION
73
- ruby 2.7.2p137
74
-
75
- BUNDLED WITH
76
- 2.1.4
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/docs/README.md DELETED
@@ -1,56 +0,0 @@
1
- This folder includes documentation about the current repo:
2
-
3
- 1. Coding Standards
4
- 2. Policies
5
- 3. Guidelines
6
- 4. Resources
7
-
8
- ---
9
-
10
- # 1. Coding Standards
11
-
12
- The repo includes `.rubocop.yml` that is used for formatting code.
13
-
14
- # 2. Policies
15
-
16
- ## Pull Requests
17
-
18
- Every change will go into a new branch and a PR will be created to merge. A template is available and will be automatically used when creating a PR. The following steps should be performed by each party:
19
-
20
- ### Developer
21
- 1. Update the `CHANGELOG.md` file and commit all changes to a new branch
22
- 2. Create a PR from new branch against `develop`
23
- 3. Fill in the PR template
24
- 4. Request a review from the designated reviewer
25
- 5. *OPTIONAL* Deploy branch to `development` environment
26
-
27
- ### Reviewer
28
-
29
- 1. Go through each step of the checklist
30
- 2. If all tasks are completed successfully, merge the PR into `develop`
31
- 3. Create a new PR against `production` or `master`
32
- 4. Assign PR to release manager
33
-
34
- # 3. Guidelines
35
- Any information on good pracitces and related can go here:
36
-
37
- ### Reviewing Pull Requests
38
- - do once a day - morning or evening
39
- - do setup a local env to easily test changes
40
- - do check for consistency with existing code and good practices
41
- - do ask questions or request comments when something's not clear or too complex
42
-
43
- ### Changelogs
44
- The repo must include a `CHANGELOG.md` file to list all changes. The accepted chnages types are:
45
-
46
- - **Added** for new features.
47
- - **Changed** for changes in existing functionality.
48
- - **Deprecated** for soon-to-be removed features.
49
- - **Removed** for now removed features.
50
- - **Fixed** for any bug fixes.
51
- - **Security** in case of vulnerabilities.
52
-
53
- # 4. Resources
54
- Documentation can be uploaded to the `docs` folder. Any useful links should be listed below:
55
-
56
- - Changelogs - https://keepachangelog.com/en/1.0.0/
@@ -1,16 +0,0 @@
1
- ## Pull Request
2
-
3
- ### 1. Task
4
- _Ticket ID or task description_
5
-
6
- ### 2. Acceptance criteria
7
- - [ ] _Rules defined in the ticket_
8
-
9
- ### 3. Notes (deployment, devices/platforms/os to test, etc.)
10
- _None_
11
-
12
- ## Reviewer's Checklist
13
- - [ ] PR summary included – task, acceptance criteria
14
- - [ ] Code reviewed – changelog, unit tests, standards
15
- - [ ] Review app deployed – Heroku review app or TeamCity deployment
16
- - [ ] Acceptance Criteria tested – steps executed on review app
data/env_setup.gemspec DELETED
@@ -1,28 +0,0 @@
1
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'env_setup/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'env_setup'
7
- spec.version = EnvSetup::VERSION
8
- spec.authors = ['Jonatas Daniel Hermann']
9
- spec.email = ['jonatas@mindsciences.com']
10
-
11
- spec.summary = %q{Gem to setup apps env}
12
- spec.description = %q{Gem to setup apps env}
13
-
14
- # Specify which files should be added to the gem when it is released.
15
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
16
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- end
19
- spec.bindir = 'bin'
20
- spec.executables = ['env_setup']
21
- spec.require_paths = ['lib']
22
-
23
- spec.add_development_dependency 'bundler', '~> 2.1'
24
- spec.add_development_dependency 'rake', '~> 10.0'
25
- spec.add_development_dependency 'rspec', '~> 3.0'
26
- spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
27
- spec.add_runtime_dependency 'aws-sdk-secretsmanager', '~> 1.0'
28
- end