jets 1.4.0 → 1.4.1

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
  SHA256:
3
- metadata.gz: ec914295c99192ef042110202c7ac3161003e644fb73a7b24cc196884d6295ae
4
- data.tar.gz: 716b93e31d27fa740b11bfba46db5a5af8b344d0e8877363ad07a49d50728032
3
+ metadata.gz: 489544f3af230a57a1f1bbeadae001f8ae967aaf9323c165945b11e7a985d36c
4
+ data.tar.gz: 7613d5cc1452fff7d036488d6fd4dc7d61e8b81aadd3b70f8110a27d29b74424
5
5
  SHA512:
6
- metadata.gz: fc7e956e2c6a675fc14d325f3207d10cecb16d29a54e7ef81679de2161feff423055bbef8e0b25071dc059a9c57c4205a5d8d20094d0fe46315deed8b58f8062
7
- data.tar.gz: 05067666cbda6be6986a12fc1acd6f757f8c33f8fa12a3debfe7182f72d1b08a17bd7321d0c23a2e2d0f827e19c7b16ea6386a2e4a177d71e66af16b41f42d42
6
+ metadata.gz: 95949b8c93a2ed42d503be2fb602c56b464d085ef11cf0c127fc50e7346a86509a09340daf8d298cc2381c7e3a731d47ca3e170e690455a217db4fb30b77c52b
7
+ data.tar.gz: 102d6bc2d9cb2fe4f2d78fbfdeecf999635ce04f6bedb3ca2e8f7f7f5674fdaaec704825d97890c5f58a4a6c83164f595d242f5f602fb5435d8d003510ef50d5
data/CHANGELOG.md CHANGED
@@ -3,6 +3,8 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.4.1]
7
+
6
8
  ## [1.4.0]
7
9
  - Afterburner mode: Allows you to deploy from within a Rails app
8
10
  - #110 from tongueroo/jet-pack: Turbo charge mode: enabling afterburner
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.4.0)
14
+ jets (1.4.1)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -67,7 +67,7 @@ GEM
67
67
  tzinfo (~> 1.1)
68
68
  arel (9.0.0)
69
69
  aws-eventstream (1.0.1)
70
- aws-partitions (1.126.0)
70
+ aws-partitions (1.127.0)
71
71
  aws-sdk-apigateway (1.23.0)
72
72
  aws-sdk-core (~> 3, >= 3.39.0)
73
73
  aws-sigv4 (~> 1.0)
@@ -82,7 +82,7 @@ GEM
82
82
  aws-partitions (~> 1.0)
83
83
  aws-sigv4 (~> 1.0)
84
84
  jmespath (~> 1.0)
85
- aws-sdk-dynamodb (1.18.1)
85
+ aws-sdk-dynamodb (1.19.0)
86
86
  aws-sdk-core (~> 3, >= 3.39.0)
87
87
  aws-sigv4 (~> 1.0)
88
88
  aws-sdk-kms (1.13.0)
@@ -29,9 +29,9 @@ class Jets::Application
29
29
  @config ||= ActiveSupport::OrderedOptions.new # dont use memoize since we reset @config later
30
30
  end
31
31
 
32
- def default_config(project_name=nil)
32
+ def default_config
33
33
  config = ActiveSupport::OrderedOptions.new
34
- config.project_name = project_name
34
+ config.project_name = parse_project_name # must set early because other configs requires this
35
35
  config.cors = true
36
36
  config.autoload_paths = default_autoload_paths
37
37
  config.extra_autoload_paths = []
@@ -93,16 +93,18 @@ class Jets::Application
93
93
  # Lets parse for the project name instead for now.
94
94
  #
95
95
  def parse_project_name
96
+ return ENV['JETS_PROJECT_NAME'] if ENV['JETS_PROJECT_NAME'] # override
97
+
96
98
  lines = IO.readlines("#{Jets.root}config/application.rb")
97
99
  project_name_line = lines.find { |l| l =~ /project_name/ }
98
100
  project_name_line.gsub(/.*=/,'').strip.gsub(/["']/,'') # project_name
99
101
  end
100
102
 
101
103
  def load_app_config
102
- project_name = parse_project_name
103
- @config = default_config(project_name)
104
+ @config = default_config
104
105
  set_dependent_configs! # things like project_namespace that need project_name
105
- eval_app_config
106
+ eval_app_config # this overwrites Jets.config.project_name
107
+ Jets.config.project_name = parse_project_name # Must set again because JETS_PROJECT_NAME is possible
106
108
 
107
109
  set_iam_policy # relies on dependent values, must be called afterwards
108
110
  normalize_env_vars!
data/lib/jets/booter.rb CHANGED
@@ -23,7 +23,7 @@ class Jets::Booter
23
23
 
24
24
  def bypass_bundler_setup?
25
25
  command = ARGV.first
26
- %w[build delete deploy].include?(command)
26
+ %w[build delete deploy url].include?(command)
27
27
  end
28
28
 
29
29
  def turbo_charge
@@ -163,15 +163,15 @@ EOL
163
163
  end
164
164
 
165
165
  def copy_cache_gems
166
- vendor_bundle = "#{@full_app_root}/vendor/gems"
167
- if File.exist?(vendor_bundle)
168
- puts "Removing current vendor_bundle from project"
169
- FileUtils.rm_rf(vendor_bundle)
166
+ vendor_gems = "#{@full_app_root}/vendor/gems"
167
+ if File.exist?(vendor_gems)
168
+ puts "Removing current vendor_gems from project"
169
+ FileUtils.rm_rf(vendor_gems)
170
170
  end
171
- # Leave #{Jets.build_root}/vendor_bundle behind to act as cache
171
+ # Leave #{Jets.build_root}/vendor_gems behind to act as cache
172
172
  if File.exist?("#{cache_area}/vendor/gems")
173
- FileUtils.mkdir_p(File.dirname(vendor_bundle))
174
- FileUtils.cp_r("#{cache_area}/vendor/gems", vendor_bundle)
173
+ FileUtils.mkdir_p(File.dirname(vendor_gems))
174
+ FileUtils.cp_r("#{cache_area}/vendor/gems", vendor_gems)
175
175
  end
176
176
  end
177
177
  end
data/lib/jets/cli.rb CHANGED
@@ -60,6 +60,7 @@ class Jets::CLI
60
60
  command, env = thor_args[0..1]
61
61
  return unless %w[deploy delete].include?(command)
62
62
  env = nil if env&.starts_with?('-')
63
+ return unless env
63
64
  ENV['JETS_ENV'] = env ? env : 'development'
64
65
  end
65
66
 
@@ -10,6 +10,7 @@ module Jets::Commands
10
10
 
11
11
  def run
12
12
  puts "Building project for Lambda..."
13
+
13
14
  return if @options[:noop]
14
15
  # run gets called from the CLI and does not have all the stack_options yet.
15
16
  # We compute it and change the options early here.
@@ -10,6 +10,7 @@ class Jets::Commands::Db::Tasks
10
10
  db_configs = Jets.application.config.database
11
11
  ActiveRecord::Tasks::DatabaseTasks.database_configuration = db_configs
12
12
  ActiveRecord::Tasks::DatabaseTasks.migrations_paths = ["db/migrate"]
13
+ ActiveRecord::Tasks::DatabaseTasks.seed_loader = Seeder.new("#{Jets.root}db/seeds.rb")
13
14
 
14
15
  # Need to mock out the usage of Rails.application in:
15
16
  # activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb
@@ -27,4 +28,16 @@ class Jets::Commands::Db::Tasks
27
28
 
28
29
  load File.expand_path("../environment-task.rake", __FILE__)
29
30
  end
31
+
32
+ # Thanks: https://stackoverflow.com/questions/19206764/how-can-i-load-activerecord-database-tasks-on-a-ruby-project-outside-rails/24840749
33
+ class Seeder
34
+ def initialize(seed_file)
35
+ @seed_file = seed_file
36
+ end
37
+
38
+ def load_seed
39
+ raise "Seed file '#{@seed_file}' does not exist" unless File.file?(@seed_file)
40
+ load @seed_file
41
+ end
42
+ end
30
43
  end
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-21 00:00:00.000000000 Z
11
+ date: 2018-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack