etna 0.1.19 → 0.1.20

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.
@@ -22,6 +22,12 @@ module Etna
22
22
  end
23
23
  end
24
24
 
25
+ class NotFound < Etna::Error
26
+ def initialize(msg = 'Resource not found', status = 404)
27
+ super
28
+ end
29
+ end
30
+
25
31
  class BadRequest < Etna::Error
26
32
  def initialize(msg = 'Client error', status = 422)
27
33
  super
@@ -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)
@@ -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
@@ -6,11 +6,13 @@ module WithEtnaClients
6
6
  EtnaApp.instance.environment
7
7
  end
8
8
 
9
- def token
10
- if environment == :many
11
- raise "You have multiple environments configured, please specify your environment by adding --environment #{@config.keys.join("|")}"
12
- elsif environment == :none
13
- raise "You do not have a successfully configured environment, please run #{program_name} config set https://polyphemus.ucsf.edu"
9
+ def token(ignore_environment: false)
10
+ unless ignore_environment
11
+ if environment == :many
12
+ raise "You have multiple environments configured, please specify your environment by adding --environment <staging|production|development>"
13
+ elsif environment == :none
14
+ raise "You do not have a successfully configured environment, please run #{program_name} config set https://polyphemus.ucsf.edu"
15
+ end
14
16
  end
15
17
 
16
18
  env_token = ENV['TOKEN']
@@ -74,7 +76,8 @@ module StrongConfirmation
74
76
  def confirm
75
77
  puts "Confirm Y/n:"
76
78
  input = STDIN.gets.chomp
77
- if input != "Y"
79
+ if input.downcase != "y"
80
+ puts "Bailing..."
78
81
  return false
79
82
  end
80
83
 
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.19
4
+ version: 0.1.20
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-24 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -134,6 +134,7 @@ files:
134
134
  - lib/etna/command.rb
135
135
  - lib/etna/controller.rb
136
136
  - lib/etna/cross_origin.rb
137
+ - lib/etna/csvs.rb
137
138
  - lib/etna/describe_routes.rb
138
139
  - lib/etna/directed_graph.rb
139
140
  - lib/etna/environment_scoped.rb