etna 0.1.18 → 0.1.23
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/bin/etna +6 -51
- data/etna.completion +225 -88
- data/lib/commands.rb +90 -19
- data/lib/etna.rb +1 -0
- data/lib/etna/clients/magma/formatting/models_csv.rb +280 -271
- data/lib/etna/clients/magma/models.rb +51 -0
- data/lib/etna/clients/magma/workflows/add_project_models_workflow.rb +8 -19
- data/lib/etna/clients/magma/workflows/create_project_workflow.rb +20 -14
- data/lib/etna/clients/magma/workflows/crud_workflow.rb +2 -2
- data/lib/etna/clients/magma/workflows/json_validators.rb +8 -3
- data/lib/etna/clients/magma/workflows/materialize_magma_record_files_workflow.rb +0 -0
- data/lib/etna/clients/magma/workflows/model_synchronization_workflow.rb +1 -1
- data/lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb +75 -7
- data/lib/etna/csvs.rb +160 -0
- data/lib/etna/errors.rb +6 -0
- data/lib/etna/generate_autocompletion_script.rb +2 -1
- data/lib/etna/logger.rb +9 -1
- data/lib/etna/spec/vcr.rb +8 -0
- data/lib/helpers.rb +20 -2
- metadata +6 -3
data/lib/etna/errors.rb
CHANGED
@@ -72,7 +72,6 @@ module Etna
|
|
72
72
|
enable_flags(scope.class)
|
73
73
|
write 'while [[ "$#" != "0" ]]; do'
|
74
74
|
generate_start_match(scope.subcommands.keys)
|
75
|
-
generate_flag_handling
|
76
75
|
|
77
76
|
scope.subcommands.each do |name, command|
|
78
77
|
write %Q(elif [[ "$1" == "#{name}" ]]; then)
|
@@ -84,6 +83,8 @@ module Etna
|
|
84
83
|
end
|
85
84
|
end
|
86
85
|
|
86
|
+
generate_flag_handling
|
87
|
+
|
87
88
|
write "else"
|
88
89
|
write "return"
|
89
90
|
write "fi"
|
data/lib/etna/logger.rb
CHANGED
@@ -3,7 +3,15 @@ require 'rollbar'
|
|
3
3
|
|
4
4
|
module Etna
|
5
5
|
class Logger < ::Logger
|
6
|
-
def initialize(log_dev, age, size)
|
6
|
+
def initialize(log_dev, age, size=1048576)
|
7
|
+
# On windows, these posix devices exist, but are not mounted in *nix style paths.
|
8
|
+
# Swap the paths out with the actual IO handles instead.
|
9
|
+
if log_dev == '/dev/stdout'
|
10
|
+
log_dev = STDOUT
|
11
|
+
elsif log_dev == '/dev/stderr'
|
12
|
+
log_dev = STDERR
|
13
|
+
end
|
14
|
+
|
7
15
|
super
|
8
16
|
self.formatter = proc do |severity, datetime, progname, msg|
|
9
17
|
format(severity, datetime, progname, msg)
|
data/lib/etna/spec/vcr.rb
CHANGED
@@ -20,6 +20,7 @@ def setup_base_vcr(spec_helper_dir)
|
|
20
20
|
request_2_json = begin
|
21
21
|
JSON.parse(request_2.body) rescue 'not-json'
|
22
22
|
end
|
23
|
+
|
23
24
|
request_1_json == request_2_json
|
24
25
|
else
|
25
26
|
false
|
@@ -29,6 +30,8 @@ def setup_base_vcr(spec_helper_dir)
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
33
|
+
# c.debug_logger = File.open('log/vcr_debug.log', 'w')
|
34
|
+
|
32
35
|
c.default_cassette_options = {
|
33
36
|
serialize_with: :compressed,
|
34
37
|
record: if ENV['IS_CI'] == '1'
|
@@ -81,6 +84,11 @@ def setup_base_vcr(spec_helper_dir)
|
|
81
84
|
end
|
82
85
|
end
|
83
86
|
end
|
87
|
+
|
88
|
+
require 'multipartable'
|
89
|
+
def Multipartable.secure_boundary
|
90
|
+
"--THIS-IS-STABLE-FOR-TESTING"
|
91
|
+
end
|
84
92
|
end
|
85
93
|
|
86
94
|
def prepare_vcr_secret
|
data/lib/helpers.rb
CHANGED
@@ -6,7 +6,24 @@ module WithEtnaClients
|
|
6
6
|
EtnaApp.instance.environment
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
9
|
+
def exit(status=true)
|
10
|
+
WithEtnaClients.exit(status)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Abstraction used to prevent accidental exist in specs.
|
14
|
+
def self.exit(status)
|
15
|
+
Kernel.exit(status)
|
16
|
+
end
|
17
|
+
|
18
|
+
def token(ignore_environment: false)
|
19
|
+
unless ignore_environment
|
20
|
+
if environment == :many
|
21
|
+
raise "You have multiple environments configured, please specify your environment by adding --environment <staging|production|development>"
|
22
|
+
elsif environment == :none
|
23
|
+
raise "You do not have a successfully configured environment, please run #{program_name} config set https://polyphemus.ucsf.edu"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
10
27
|
env_token = ENV['TOKEN']
|
11
28
|
if !env_token
|
12
29
|
puts "No environment variable TOKEN is set. You should set your token with `export TOKEN=<your.janus.token>` before running."
|
@@ -68,7 +85,8 @@ module StrongConfirmation
|
|
68
85
|
def confirm
|
69
86
|
puts "Confirm Y/n:"
|
70
87
|
input = STDIN.gets.chomp
|
71
|
-
if input != "
|
88
|
+
if input.downcase != "y"
|
89
|
+
puts "Bailing..."
|
72
90
|
return false
|
73
91
|
end
|
74
92
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saurabh Asthana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/etna/clients/magma/workflows/file_linking_workflow.rb
|
118
118
|
- lib/etna/clients/magma/workflows/json_converters.rb
|
119
119
|
- lib/etna/clients/magma/workflows/json_validators.rb
|
120
|
+
- lib/etna/clients/magma/workflows/materialize_magma_record_files_workflow.rb
|
120
121
|
- lib/etna/clients/magma/workflows/model_synchronization_workflow.rb
|
121
122
|
- lib/etna/clients/magma/workflows/record_synchronization_workflow.rb
|
122
123
|
- lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- lib/etna/command.rb
|
135
136
|
- lib/etna/controller.rb
|
136
137
|
- lib/etna/cross_origin.rb
|
138
|
+
- lib/etna/csvs.rb
|
137
139
|
- lib/etna/describe_routes.rb
|
138
140
|
- lib/etna/directed_graph.rb
|
139
141
|
- lib/etna/environment_scoped.rb
|
@@ -175,7 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
177
|
- !ruby/object:Gem::Version
|
176
178
|
version: '0'
|
177
179
|
requirements: []
|
178
|
-
|
180
|
+
rubyforge_project:
|
181
|
+
rubygems_version: 2.7.6.2
|
179
182
|
signing_key:
|
180
183
|
specification_version: 4
|
181
184
|
summary: Base classes for Mount Etna applications
|