air_test 0.1.6.1 → 0.1.6.2
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 +4 -4
- data/lib/air_test/cli.rb +53 -23
- data/lib/air_test/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e04796d0b80ac35cf63aa0d65fab417c7f1b2c793f953108be1779129489cba
|
4
|
+
data.tar.gz: 9e31c0266c59d7963c70cdc3d2158b92e12814a32be15d065f062f1026485884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ce0f69bc475ed1ef913fac555f125c131dd49aef39f9165fffd05c8288b16d5013dfb38b41f9ed7d4119f81ba270f7b8af3ea08c4faf9c18543d8f719d5559
|
7
|
+
data.tar.gz: e4311d1981fb6289d81275619461490ac2d4ee2f1c47982fa51166dafb7e48047b4519a648d44e68c398462fe3887b63923bc326a1b72993f38c7748b542cf31
|
data/lib/air_test/cli.rb
CHANGED
@@ -9,6 +9,7 @@ module AirTest
|
|
9
9
|
class CLI
|
10
10
|
def initialize
|
11
11
|
@prompt = TTY::Prompt.new
|
12
|
+
load_env_files
|
12
13
|
end
|
13
14
|
|
14
15
|
def init(silent: false)
|
@@ -152,25 +153,25 @@ module AirTest
|
|
152
153
|
end
|
153
154
|
|
154
155
|
def initialize_airtest_config(config)
|
155
|
-
# Initialize AirTest configuration with
|
156
|
+
# Initialize AirTest configuration with values from config file
|
156
157
|
AirTest.configure do |airtest_config|
|
157
158
|
case config['tool']
|
158
159
|
when 'notion'
|
159
|
-
airtest_config.notion[:token] =
|
160
|
-
airtest_config.notion[:database_id] =
|
160
|
+
airtest_config.notion[:token] = config['notion']['token']
|
161
|
+
airtest_config.notion[:database_id] = config['notion']['database_id']
|
161
162
|
when 'jira'
|
162
|
-
airtest_config.jira[:token] =
|
163
|
-
airtest_config.jira[:project_id] =
|
164
|
-
airtest_config.jira[:domain] =
|
165
|
-
airtest_config.jira[:email] =
|
163
|
+
airtest_config.jira[:token] = config['jira']['token']
|
164
|
+
airtest_config.jira[:project_id] = config['jira']['project_id']
|
165
|
+
airtest_config.jira[:domain] = config['jira']['domain']
|
166
|
+
airtest_config.jira[:email] = config['jira']['email']
|
166
167
|
when 'monday'
|
167
|
-
airtest_config.monday[:token] =
|
168
|
-
airtest_config.monday[:board_id] =
|
169
|
-
airtest_config.monday[:domain] =
|
168
|
+
airtest_config.monday[:token] = config['monday']['token']
|
169
|
+
airtest_config.monday[:board_id] = config['monday']['board_id']
|
170
|
+
airtest_config.monday[:domain] = config['monday']['domain']
|
170
171
|
end
|
171
172
|
|
172
|
-
airtest_config.github[:token] =
|
173
|
-
airtest_config.repo =
|
173
|
+
airtest_config.github[:token] = config['github']['token']
|
174
|
+
airtest_config.repo = config['github']['repo']
|
174
175
|
airtest_config.tool = config['tool']
|
175
176
|
end
|
176
177
|
end
|
@@ -386,23 +387,23 @@ module AirTest
|
|
386
387
|
'dev_assignee' => config[:dev_assignee],
|
387
388
|
'interactive_mode' => config[:interactive_mode],
|
388
389
|
'notion' => {
|
389
|
-
'token' =>
|
390
|
-
'database_id' =>
|
390
|
+
'token' => ENV['NOTION_TOKEN'] || 'your_notion_token',
|
391
|
+
'database_id' => ENV['NOTION_DATABASE_ID'] || 'your_notion_database_id'
|
391
392
|
},
|
392
393
|
'jira' => {
|
393
|
-
'token' =>
|
394
|
-
'project_id' =>
|
395
|
-
'domain' =>
|
396
|
-
'email' =>
|
394
|
+
'token' => ENV['JIRA_TOKEN'] || 'your_jira_token',
|
395
|
+
'project_id' => ENV['JIRA_PROJECT_ID'] || 'your_jira_project_id',
|
396
|
+
'domain' => ENV['JIRA_DOMAIN'] || 'your_jira_domain',
|
397
|
+
'email' => ENV['JIRA_EMAIL'] || 'your_jira_email'
|
397
398
|
},
|
398
399
|
'monday' => {
|
399
|
-
'token' =>
|
400
|
-
'board_id' =>
|
401
|
-
'domain' =>
|
400
|
+
'token' => ENV['MONDAY_TOKEN'] || 'your_monday_token',
|
401
|
+
'board_id' => ENV['MONDAY_BOARD_ID'] || 'your_monday_board_id',
|
402
|
+
'domain' => ENV['MONDAY_DOMAIN'] || 'your_monday_domain'
|
402
403
|
},
|
403
404
|
'github' => {
|
404
|
-
'token' =>
|
405
|
-
'repo' => 'your-org/your-repo'
|
405
|
+
'token' => ENV['GITHUB_BOT_TOKEN'] || 'your_github_token',
|
406
|
+
'repo' => ENV['REPO'] || 'your-org/your-repo'
|
406
407
|
}
|
407
408
|
}
|
408
409
|
|
@@ -512,6 +513,35 @@ module AirTest
|
|
512
513
|
end
|
513
514
|
end
|
514
515
|
|
516
|
+
private
|
517
|
+
|
518
|
+
def load_env_files
|
519
|
+
# Try to load .env files in order of preference
|
520
|
+
env_files = ['.env.airtest', '.env']
|
521
|
+
|
522
|
+
env_files.each do |env_file|
|
523
|
+
if File.exist?(env_file)
|
524
|
+
load_env_file(env_file)
|
525
|
+
puts "#{GREEN}✅ Loaded environment variables from #{env_file}#{RESET}" if ENV['AIRTEST_DEBUG']
|
526
|
+
break
|
527
|
+
end
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
def load_env_file(file_path)
|
532
|
+
File.readlines(file_path).each do |line|
|
533
|
+
line.strip!
|
534
|
+
next if line.empty? || line.start_with?('#')
|
535
|
+
|
536
|
+
if line.include?('=')
|
537
|
+
key, value = line.split('=', 2)
|
538
|
+
ENV[key.strip] = value.strip.gsub(/^["']|["']$/, '') # Remove quotes
|
539
|
+
end
|
540
|
+
end
|
541
|
+
rescue => e
|
542
|
+
puts "#{YELLOW}⚠️ Warning: Could not load #{file_path}: #{e.message}#{RESET}" if ENV['AIRTEST_DEBUG']
|
543
|
+
end
|
544
|
+
|
515
545
|
# Color constants
|
516
546
|
GREEN = "\e[32m"
|
517
547
|
YELLOW = "\e[33m"
|
data/lib/air_test/version.rb
CHANGED