jets 1.4.8 → 1.4.9

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: 28851f57737b507e7220fb461b5cf66a286d97a1787e20bbe49d4bde773b0206
4
- data.tar.gz: 9f1acc78bb91be8d82023667d8b30dc0d2722fde639c1ec32651e2ea17b445ee
3
+ metadata.gz: 55f7e0617aa3aa49745617e3735c5b40128b7841375fd69f0d7fecee71881ae8
4
+ data.tar.gz: 607038061932882b1f01284923dab863d33c71b5b6663aabcde5580382449148
5
5
  SHA512:
6
- metadata.gz: 712ef50748cbc8dc623e9f05d7caca13655a5ecd746615af30be68dbd003486ba1bade84fde43655f011bdc0b307bbdf9deda3861306653ba98b47d0e5c21bdb
7
- data.tar.gz: 7975a4e04113419199b59d2489b2e4e9c87311a5e2ab016d01af54197d0e10913bb51b4e03318978328b94a7ff2b19f72143bdea86cdb04aae392685dc378dd8
6
+ metadata.gz: ba6369902500a57919efa3b4545205b8fde1f055da176299df779d8026ac474f954c56d69e5b417ed04ea5fd0967ca556afc0918e3ec8e412cdcf8bd0c7e8872
7
+ data.tar.gz: b59ee42c12ffd6bc68b5026fd13b608ba298152529cfd43bd14a74b253d4cf9403f29ebe5b9c3832d4a8d57dbce90b34583bf696198b48e0427874b3876a01d5
@@ -35,8 +35,8 @@ Make sure that you've done all of these. To mark a checkbox done, replace [ ] w
35
35
  | Software | Version |
36
36
  | ---------------- | ------- |
37
37
  | Operating System | |
38
- | `jets` | |
39
- | `ruby` | |
38
+ | Jets | |
39
+ | Ruby | |
40
40
 
41
41
  ---
42
42
 
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ spec/fixtures/project/handlers
19
19
  .codebuild/definitions
20
20
  demo*
21
21
  /html
22
+ spec/fixtures/apps/franky/dynamodb/migrate
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
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.9]
7
+ - update vendor/dynomite
8
+ - #128 from Atul9/update-license: update copyright year
9
+ - #130 from tongueroo/fix-specs
10
+
6
11
  ## [1.4.8]
7
12
  - disable prewarm in `jets new` job mode
8
13
 
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.4.8)
14
+ jets (1.4.9)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -77,7 +77,7 @@ GEM
77
77
  aws-sdk-cloudwatchlogs (1.12.0)
78
78
  aws-sdk-core (~> 3, >= 3.39.0)
79
79
  aws-sigv4 (~> 1.0)
80
- aws-sdk-core (3.44.1)
80
+ aws-sdk-core (3.44.2)
81
81
  aws-eventstream (~> 1.0)
82
82
  aws-partitions (~> 1.0)
83
83
  aws-sigv4 (~> 1.0)
@@ -108,7 +108,7 @@ GEM
108
108
  concurrent-ruby (1.1.4)
109
109
  crass (1.0.4)
110
110
  diff-lcs (1.3)
111
- dotenv (2.5.0)
111
+ dotenv (2.6.0)
112
112
  erubi (1.8.0)
113
113
  gems (1.1.1)
114
114
  json
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017 Tung Nguyen
1
+ Copyright (c) 2019 Tung Nguyen
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -146,9 +146,10 @@ After deployment, you can test the Lambda functions with the AWS Lambda console
146
146
 
147
147
  Here are some demos of Jets applications:
148
148
 
149
- * [Quintessential CRUD Jets app](https://demo.rubyonjets.com/posts)
150
- * [Rails Running on AWS Lambda Mega Mode Example](https://mega.demo.rubyonjets.com/)
151
- * [Image Upload Example](https://upload.demo.rubyonjets.com/)
149
+ * [Quintessential CRUD Jets app](https://demo.rubyonjets.com/)
150
+ * [Jets Afterburner: Easy Rails Support](https://afterburner.demo.rubyonjets.com/)
151
+ * [Mega Mode: Jets and Rails Combined](https://mega.demo.rubyonjets.com/)
152
+ * [Image Upload with CarrierWave](https://upload.demo.rubyonjets.com/)
152
153
 
153
154
  Please feel free to add your own example to the [jets-examples](https://github.com/tongueroo/jets-examples) repo.
154
155
 
@@ -196,3 +197,4 @@ For more documentation, check out the official docs: [Ruby on Jets](http://rubyo
196
197
  * [Jets Tutorial Different Environments Part 8](https://blog.boltops.com/2018/09/26/jets-tutorial-different-environments-part-8)
197
198
  * [Jets Tutorial Polymorphic Support Part 9](https://blog.boltops.com/2018/09/27/jets-tutorial-polymorphic-support-part-9)
198
199
  * [Jets Delete Tutorial](https://blog.boltops.com/2018/11/12/jets-tutorial-jets-delete)
200
+ * [Serverless Ruby Cron Jobs Tutorial: Route53 Backup](https://blog.boltops.com/2019/01/03/serverless-ruby-cron-jobs-with-jets-route53-backup)
@@ -20,7 +20,7 @@ class Jets::Commands::Dynamodb::Migrator
20
20
  path = "#{Jets.root}#{@path}"
21
21
  unless File.exist?(path)
22
22
  puts "Unable to find the migration file: #{path}"
23
- exit 1
23
+ exit 1 unless ENV['TEST']
24
24
  end
25
25
 
26
26
  require path
@@ -28,10 +28,12 @@ class Jets::Processors::MainProcessor
28
28
  # deducer.code => HelloFunction.process(event, context, "world")
29
29
  # deducer.path => app/functions/hello.rb
30
30
  deducer.load_class
31
- result = instance_eval(deducer.code, deducer.path)
32
31
  # result = PostsController.process(event, context, "create")
32
+ result = instance_eval(deducer.code, deducer.path)
33
+ result = HashWithIndifferentAccess.new(result) if result.is_a?(Hash)
33
34
 
34
35
  Jets.increase_call_count
36
+
35
37
  if result.is_a?(Hash) && result["headers"]
36
38
  result["headers"]["x-jets-call-count"] = Jets.call_count
37
39
  result["headers"]["x-jets-prewarm-count"] = Jets.prewarm_count
@@ -6,14 +6,19 @@ class Jets::Resource::ApiGateway::RestApi
6
6
  def get
7
7
  return default unless stack_exists?(parent_stack_name) && api_gateway_exists?
8
8
 
9
- change_detection = ChangeDetection.new
10
- if change_detection.changed?
9
+
10
+ if changed?
11
11
  new_id
12
12
  else
13
13
  current
14
14
  end
15
15
  end
16
16
 
17
+ def changed?
18
+ change_detection = ChangeDetection.new
19
+ change_detection.changed?
20
+ end
21
+
17
22
  # Takes current logical id and increments the number that is appended to it.
18
23
  #
19
24
  # Examples:
@@ -15,11 +15,9 @@ module Jets::Resource::Lambda
15
15
  layer_version_logical_id => {
16
16
  type: "AWS::Lambda::LayerVersion",
17
17
  properties: {
18
- # compatible_runtimes: ["ruby2.5"],
19
18
  content: {
20
19
  s3_bucket: s3_bucket,
21
20
  s3_key: code_s3_key,
22
- # s3_object_version: string,
23
21
  },
24
22
  description: description,
25
23
  layer_name: layer_name,
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.4.8"
2
+ VERSION = "1.4.9"
3
3
  end
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.9]
7
+ - allow item.replace(hash) to work
8
+ - Merge pull request #3 from mveer99/patch-1 Update comments: Fixed typo in project_name
9
+
6
10
  ## [1.0.8]
7
11
  - scope endpoint option to dynamodb client only vs the entire Aws.config
8
12
 
@@ -1,36 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynomite (1.0.8)
4
+ dynomite (1.0.9)
5
5
  activesupport
6
6
  aws-sdk-dynamodb
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (5.2.1)
11
+ activesupport (5.2.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
16
  aws-eventstream (1.0.1)
17
- aws-partitions (1.111.0)
18
- aws-sdk-core (3.38.0)
17
+ aws-partitions (1.128.0)
18
+ aws-sdk-core (3.44.2)
19
19
  aws-eventstream (~> 1.0)
20
20
  aws-partitions (~> 1.0)
21
21
  aws-sigv4 (~> 1.0)
22
22
  jmespath (~> 1.0)
23
- aws-sdk-dynamodb (1.16.0)
24
- aws-sdk-core (~> 3, >= 3.26.0)
23
+ aws-sdk-dynamodb (1.19.0)
24
+ aws-sdk-core (~> 3, >= 3.39.0)
25
25
  aws-sigv4 (~> 1.0)
26
26
  aws-sigv4 (1.0.3)
27
- concurrent-ruby (1.1.3)
27
+ concurrent-ruby (1.1.4)
28
28
  diff-lcs (1.3)
29
- i18n (1.1.1)
29
+ i18n (1.4.0)
30
30
  concurrent-ruby (~> 1.0)
31
31
  jmespath (1.4.0)
32
32
  minitest (5.11.3)
33
- rake (12.3.1)
33
+ rake (12.3.2)
34
34
  rspec (3.8.0)
35
35
  rspec-core (~> 3.8.0)
36
36
  rspec-expectations (~> 3.8.0)
@@ -58,4 +58,4 @@ DEPENDENCIES
58
58
  rspec
59
59
 
60
60
  BUNDLED WITH
61
- 1.16.3
61
+ 1.17.2
@@ -21,10 +21,10 @@
21
21
  # If your project_name is demo and environment is production:
22
22
  # create_table "posts" => table name: "demo-prod-posts"
23
23
  #
24
- # If your project_name is proj and environment is staging:
24
+ # If your project_name is demo and environment is staging:
25
25
  # create_table "posts" => table name: "demo-stag-posts"
26
26
  #
27
- # If your project_name is proj and environment is development:
27
+ # If your project_name is demo and environment is development:
28
28
  # create_table "posts" => table name: "demo-dev-posts"
29
29
  #
30
30
  # If the table_namespace is set to a blank string or nil, then a namespace
@@ -66,8 +66,8 @@ module Dynomite
66
66
 
67
67
  # The method is named replace to clearly indicate that the item is
68
68
  # fully replaced.
69
- def replace
70
- attrs = self.class.replace(@attrs)
69
+ def replace(hash={})
70
+ attrs = self.class.replace(@attrs.deep_merge(hash))
71
71
  @attrs = attrs # refresh attrs because it now has the id
72
72
  end
73
73
 
@@ -123,6 +123,7 @@ module Dynomite
123
123
  # AWS Docs examples: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Ruby.04.html
124
124
  def self.scan(params={})
125
125
  log("It's recommended to not use scan for production. It can be slow and expensive. You can a LSI or GSI and query the index instead.")
126
+ log("Scanning table: #{table_name}")
126
127
  params = { table_name: table_name }.merge(params)
127
128
  resp = db.scan(params)
128
129
  resp.items.map {|i| self.new(i) }
@@ -1,3 +1,3 @@
1
1
  module Dynomite
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
@@ -63,6 +63,19 @@ describe Dynomite::Item do
63
63
  expect(attrs[:id].size).to eq 40 # generated unique id
64
64
  end
65
65
 
66
+ it "replace with hash" do
67
+ # Not returning a resp with receive because it is not useful
68
+ # Dynanmodb doesnt provide much useful info there.
69
+ expect(Post.db).to receive(:put_item)
70
+
71
+ post = Post.new(title: "my title")
72
+ post.replace(title: "my title 2")
73
+ attrs = post.attrs
74
+
75
+ expect(attrs[:title]).to eq "my title 2"
76
+ expect(attrs[:id].size).to eq 40 # generated unique id
77
+ end
78
+
66
79
  it "delete" do
67
80
  allow(Post.db).to receive(:delete_item)
68
81
 
@@ -21,7 +21,7 @@ module Jets::Gems
21
21
  # }
22
22
  #
23
23
  def run!
24
- puts "Checking projects gems for pre-built Lambda gems..."
24
+ puts "Checking projects gems for binary Lambda gems..."
25
25
  found_gems = {}
26
26
  compiled_gems.each do |gem_name|
27
27
  puts "Checking #{gem_name}..." if @options[:cli]
@@ -17,7 +17,7 @@ module Jets::Gems::Extract
17
17
  zipfile_path = download_gem
18
18
  remove_current_gem
19
19
  unzip_file(zipfile_path)
20
- say("Gem #{full_gem_name} unpacked at #{project_root}", :debug)
20
+ say("Gem #{full_gem_name} unpacked at #{project_root}")
21
21
  end
22
22
 
23
23
  def unzip_file(zipfile_path)
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.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-04 00:00:00.000000000 Z
11
+ date: 2019-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -826,8 +826,9 @@ files:
826
826
  - vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
827
827
  - vendor/dynomite/lib/dynomite/version.rb
828
828
  - vendor/dynomite/pkg/dynomite-1.0.8.gem
829
+ - vendor/dynomite/pkg/dynomite-1.0.9.gem
829
830
  - vendor/dynomite/spec/fixtures/app_root/config/dynamodb.yml
830
- - vendor/dynomite/spec/fixtures/dynamodb/migrate/20181113165001-comments_migration.rb
831
+ - vendor/dynomite/spec/fixtures/dynamodb/migrate/20190106183548-comments_migration.rb
831
832
  - vendor/dynomite/spec/lib/dynomite/item_spec.rb
832
833
  - vendor/dynomite/spec/lib/dynomite/migration/dsl/global_secondary_index_spec.rb
833
834
  - vendor/dynomite/spec/lib/dynomite/migration/dsl/local_secondary_index_spec.rb