jets 1.8.9 → 1.8.10
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/CHANGELOG.md +13 -0
 - data/README.md +1 -1
 - data/lib/jets/application.rb +9 -0
 - data/lib/jets/aws_info.rb +1 -1
 - data/lib/jets/booter.rb +1 -0
 - data/lib/jets/camelizer.rb +8 -4
 - data/lib/jets/cfn/ship.rb +1 -1
 - data/lib/jets/commands/help/destroy.md +16 -0
 - data/lib/jets/commands/main.rb +6 -0
 - data/lib/jets/commands/templates/skeleton/config/application.rb.tt +1 -1
 - data/lib/jets/generator.rb +14 -7
 - data/lib/jets/version.rb +1 -1
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 22ddc04092ba46aff21f3995f5c250a120c997fa5c91c60afe7c7922152ea405
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d5c2976db58b411024a26a24b4016b91290e55bec4aaf711be89a5e62e23c590
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 697201cc4e1af7c8c7449f7d020853d519293ccae20892ad98e13a99990e4c5f57d695699c2b0587ea670f9831bec365a9c52827e821ad7070e493f6fa88dd08
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b7cc5028f62577e4a754892c427c5c0730cbdb05a0b48b3df31053addf70626c9ee1bf860f48e53e352def4e9c994baa94c0626990d9155995377b5048ec0747
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -3,6 +3,19 @@ 
     | 
|
| 
       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/).
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
      
 6 
     | 
    
         
            +
            ## [1.8.10]
         
     | 
| 
      
 7 
     | 
    
         
            +
            - #208 add jets degenerate as opposite of generator
         
     | 
| 
      
 8 
     | 
    
         
            +
            - #219 fix circleci usage, remove CIRCLECI env
         
     | 
| 
      
 9 
     | 
    
         
            +
            - #222 fix config.function.dead_letter_config in starter application.rb
         
     | 
| 
      
 10 
     | 
    
         
            +
            - #223 add jets degenerate as opposite of generator cleanup
         
     | 
| 
      
 11 
     | 
    
         
            +
            - #224 add jets degenerate as opposite of generator cleanup
         
     | 
| 
      
 12 
     | 
    
         
            +
            - #228 organize docs better into subfolders
         
     | 
| 
      
 13 
     | 
    
         
            +
            - #230 Fix ValidationError branch of Cfn::Ship#update_stack
         
     | 
| 
      
 14 
     | 
    
         
            +
            - #231 Add git submodules to contributing documentation.
         
     | 
| 
      
 15 
     | 
    
         
            +
            - #234 Better API mode controller generator
         
     | 
| 
      
 16 
     | 
    
         
            +
            - #238 Fix routing link in considerations-api-gateway doc
         
     | 
| 
      
 17 
     | 
    
         
            +
            - #239 autoload concerns and allow them to work
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       6 
19 
     | 
    
         
             
            ## [1.8.9]
         
     | 
| 
       7 
20 
     | 
    
         
             
            - JETS\_DEBUG\_EAGER_LOAD flag
         
     | 
| 
       8 
21 
     | 
    
         
             
            - #216 fix webpacker v3.5 to v4 upgrade related issues
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -9,7 +9,7 @@ Ruby and Lambda splat out a baby and that child's name is [Jets](http://rubyonje 
     | 
|
| 
       9 
9 
     | 
    
         
             
            [](https://badge.fury.io/rb/jets)
         
     | 
| 
       10 
10 
     | 
    
         
             
            [](http://rubyonjets.com/support/)
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            **Upgrading**: If you are upgrading Jets, please check on the [Upgrading Notes](http://rubyonjets.com/docs/upgrading/).
         
     | 
| 
      
 12 
     | 
    
         
            +
            **Upgrading**: If you are upgrading Jets, please check on the [Upgrading Notes](http://rubyonjets.com/docs/extras/upgrading/).
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
            ## What is Ruby on Jets?
         
     | 
| 
       15 
15 
     | 
    
         | 
    
        data/lib/jets/application.rb
    CHANGED
    
    | 
         @@ -201,12 +201,21 @@ class Jets::Application 
     | 
|
| 
       201 
201 
     | 
    
         
             
              #   app/models
         
     | 
| 
       202 
202 
     | 
    
         
             
              #   app/rules
         
     | 
| 
       203 
203 
     | 
    
         
             
              #   app/shared/resources
         
     | 
| 
      
 204 
     | 
    
         
            +
              #
         
     | 
| 
      
 205 
     | 
    
         
            +
              # Also include:
         
     | 
| 
      
 206 
     | 
    
         
            +
              #   app/models/concerns
         
     | 
| 
      
 207 
     | 
    
         
            +
              #   app/controllers/concerns
         
     | 
| 
       204 
208 
     | 
    
         
             
              def default_autoload_paths
         
     | 
| 
       205 
209 
     | 
    
         
             
                paths = []
         
     | 
| 
       206 
210 
     | 
    
         
             
                Dir.glob("#{Jets.root}/app/*").each do |p|
         
     | 
| 
       207 
211 
     | 
    
         
             
                  p.sub!('./','')
         
     | 
| 
       208 
212 
     | 
    
         
             
                  paths << p unless exclude_autoload_path?(p)
         
     | 
| 
       209 
213 
     | 
    
         
             
                end
         
     | 
| 
      
 214 
     | 
    
         
            +
                # Handle concerns folders
         
     | 
| 
      
 215 
     | 
    
         
            +
                Dir.glob("#{Jets.root}/app/**/concerns").each do |p|
         
     | 
| 
      
 216 
     | 
    
         
            +
                  p.sub!('./','')
         
     | 
| 
      
 217 
     | 
    
         
            +
                  paths << p unless exclude_autoload_path?(p)
         
     | 
| 
      
 218 
     | 
    
         
            +
                end
         
     | 
| 
       210 
219 
     | 
    
         
             
                paths
         
     | 
| 
       211 
220 
     | 
    
         
             
              end
         
     | 
| 
       212 
221 
     | 
    
         | 
    
        data/lib/jets/aws_info.rb
    CHANGED
    
    
    
        data/lib/jets/booter.rb
    CHANGED
    
    | 
         @@ -206,6 +206,7 @@ class Jets::Booter 
     | 
|
| 
       206 
206 
     | 
    
         
             
                                  .sub(/\.rb$/,'') # remove .rb
         
     | 
| 
       207 
207 
     | 
    
         
             
                                  .sub(%{^\./},'') # remove ./
         
     | 
| 
       208 
208 
     | 
    
         
             
                                  .sub("#{Jets.root}/",'')
         
     | 
| 
      
 209 
     | 
    
         
            +
                                  .sub(%r{app\/\w+/concerns/},'')
         
     | 
| 
       209 
210 
     | 
    
         
             
                                  .sub(%r{app/shared/\w+/},'') # remove shared/resources or shared/extensions
         
     | 
| 
       210 
211 
     | 
    
         
             
                                  .sub(%r{app/\w+/},'') # remove app/controllers or app/jobs etc
         
     | 
| 
       211 
212 
     | 
    
         
             
                    class_name = class_name.classify
         
     | 
    
        data/lib/jets/camelizer.rb
    CHANGED
    
    | 
         @@ -6,7 +6,7 @@ module Jets 
     | 
|
| 
       6 
6 
     | 
    
         
             
                  def transform(value, parent_keys=[])
         
     | 
| 
       7 
7 
     | 
    
         
             
                    case value
         
     | 
| 
       8 
8 
     | 
    
         
             
                    when Array
         
     | 
| 
       9 
     | 
    
         
            -
                      value.map { |v| transform(v) }
         
     | 
| 
      
 9 
     | 
    
         
            +
                      value.map { |v| transform(v, parent_keys) }
         
     | 
| 
       10 
10 
     | 
    
         
             
                    when Hash
         
     | 
| 
       11 
11 
     | 
    
         
             
                      initializer = value.map do |k, v|
         
     | 
| 
       12 
12 
     | 
    
         
             
                        new_key = camelize_key(k, parent_keys)
         
     | 
| 
         @@ -15,7 +15,7 @@ module Jets 
     | 
|
| 
       15 
15 
     | 
    
         
             
                      Hash[initializer]
         
     | 
| 
       16 
16 
     | 
    
         
             
                    else
         
     | 
| 
       17 
17 
     | 
    
         
             
                      value # do not transform values
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 18 
     | 
    
         
            +
                    end
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  def camelize_key(k, parent_keys=[])
         
     | 
| 
         @@ -34,8 +34,10 @@ module Jets 
     | 
|
| 
       34 
34 
     | 
    
         
             
                  end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                  def passthrough?(k, parent_keys)
         
     | 
| 
       37 
     | 
    
         
            -
                     
     | 
| 
       38 
     | 
    
         
            -
                    parent_keys.include?(" 
     | 
| 
      
 37 
     | 
    
         
            +
                    # do not transform keys anything under these special keys
         
     | 
| 
      
 38 
     | 
    
         
            +
                    parent_keys.include?("Variables") ||
         
     | 
| 
      
 39 
     | 
    
         
            +
                    parent_keys.include?("ResponseParameters") ||
         
     | 
| 
      
 40 
     | 
    
         
            +
                    parent_keys.include?("Fn::Sub") ||
         
     | 
| 
       39 
41 
     | 
    
         
             
                    k.include?('-') || k.include?('/')
         
     | 
| 
       40 
42 
     | 
    
         
             
                  end
         
     | 
| 
       41 
43 
     | 
    
         | 
| 
         @@ -60,6 +62,8 @@ module Jets 
     | 
|
| 
       60 
62 
     | 
    
         
             
                      "Ttl" => "TTL",
         
     | 
| 
       61 
63 
     | 
    
         
             
                      "MaxReceiveCount" => "maxReceiveCount",
         
     | 
| 
       62 
64 
     | 
    
         
             
                      "DeadLetterTargetArn" => "deadLetterTargetArn",
         
     | 
| 
      
 65 
     | 
    
         
            +
                      "DbSubnetGroupDescription" => "DBSubnetGroupDescription",
         
     | 
| 
      
 66 
     | 
    
         
            +
                      "DbSubnetGroupName" => "DBSubnetGroupName",
         
     | 
| 
       63 
67 
     | 
    
         
             
                    }
         
     | 
| 
       64 
68 
     | 
    
         
             
                  end
         
     | 
| 
       65 
69 
     | 
    
         
             
                end
         
     | 
    
        data/lib/jets/cfn/ship.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            This piggy backs off of the [rails scaffold destroy](https://guides.rubyonrails.org/command_line.html#rails-destroy).
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            ## Example
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                $ jets destroy scaffold Post title:string body:text published:boolean
         
     | 
| 
      
 6 
     | 
    
         
            +
                      invoke  active_record
         
     | 
| 
      
 7 
     | 
    
         
            +
                      remove    db/migrate/20190225231821_create_posts.rb
         
     | 
| 
      
 8 
     | 
    
         
            +
                      remove    app/models/post.rb
         
     | 
| 
      
 9 
     | 
    
         
            +
                      invoke  resource_route
         
     | 
| 
      
 10 
     | 
    
         
            +
                      route    resources :posts
         
     | 
| 
      
 11 
     | 
    
         
            +
                      invoke  scaffold_controller
         
     | 
| 
      
 12 
     | 
    
         
            +
                      remove    app/controllers/posts_controller.rb
         
     | 
| 
      
 13 
     | 
    
         
            +
                      invoke    erb
         
     | 
| 
      
 14 
     | 
    
         
            +
                      invoke    helper
         
     | 
| 
      
 15 
     | 
    
         
            +
                      remove      app/helpers/posts_helper.rb
         
     | 
| 
      
 16 
     | 
    
         
            +
                $
         
     | 
    
        data/lib/jets/commands/main.rb
    CHANGED
    
    | 
         @@ -103,6 +103,12 @@ module Jets::Commands 
     | 
|
| 
       103 
103 
     | 
    
         
             
                  Jets::Generator.invoke(generator, *args)
         
     | 
| 
       104 
104 
     | 
    
         
             
                end
         
     | 
| 
       105 
105 
     | 
    
         | 
| 
      
 106 
     | 
    
         
            +
                desc "degenerate [type] [args]", "Destroys things like scaffolds"
         
     | 
| 
      
 107 
     | 
    
         
            +
                long_desc Help.text(:degenerate)
         
     | 
| 
      
 108 
     | 
    
         
            +
                def degenerate(generator, *args)
         
     | 
| 
      
 109 
     | 
    
         
            +
                  Jets::Generator.revoke(generator, *args)
         
     | 
| 
      
 110 
     | 
    
         
            +
                end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
       106 
112 
     | 
    
         
             
                desc "status", "Shows the current status of the Jets app"
         
     | 
| 
       107 
113 
     | 
    
         
             
                long_desc Help.text(:status)
         
     | 
| 
       108 
114 
     | 
    
         
             
                def status
         
     | 
| 
         @@ -30,7 +30,7 @@ Jets.application.configure do 
     | 
|
| 
       30 
30 
     | 
    
         
             
              #   global_app_key2: "global_app_value2",
         
     | 
| 
       31 
31 
     | 
    
         
             
              # }
         
     | 
| 
       32 
32 
     | 
    
         
             
              # More examples:
         
     | 
| 
       33 
     | 
    
         
            -
              # config.function. 
     | 
| 
      
 33 
     | 
    
         
            +
              # config.function.dead_letter_config = { target_arn: "arn" }
         
     | 
| 
       34 
34 
     | 
    
         
             
              # config.function.vpc_config = {
         
     | 
| 
       35 
35 
     | 
    
         
             
              #   security_group_ids: [ "sg-1", "sg-2" ],
         
     | 
| 
       36 
36 
     | 
    
         
             
              #   subnet_ids: [ "subnet-1", "subnet-2" ]
         
     | 
    
        data/lib/jets/generator.rb
    CHANGED
    
    | 
         @@ -1,34 +1,41 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Piggy back off of Rails Generators.
         
     | 
| 
       2 
2 
     | 
    
         
             
            class Jets::Generator
         
     | 
| 
       3 
3 
     | 
    
         
             
              def self.invoke(generator, *args)
         
     | 
| 
       4 
     | 
    
         
            -
                new(generator, *args).invoke
         
     | 
| 
      
 4 
     | 
    
         
            +
                new(generator, *args).run(:invoke)
         
     | 
| 
      
 5 
     | 
    
         
            +
              end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              def self.revoke(generator, *args)
         
     | 
| 
      
 8 
     | 
    
         
            +
                new(generator, *args).run(:revoke)
         
     | 
| 
       5 
9 
     | 
    
         
             
              end
         
     | 
| 
       6 
10 
     | 
    
         | 
| 
       7 
11 
     | 
    
         
             
              def initialize(generator, *args)
         
     | 
| 
       8 
     | 
    
         
            -
                @generator = generator
         
     | 
| 
       9 
     | 
    
         
            -
                @args = args
         
     | 
| 
      
 12 
     | 
    
         
            +
                @generator, @args = generator, args
         
     | 
| 
       10 
13 
     | 
    
         
             
              end
         
     | 
| 
       11 
14 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
              def invoke
         
     | 
| 
      
 15 
     | 
    
         
            +
              def run(behavior=:invoke)
         
     | 
| 
       13 
16 
     | 
    
         
             
                # lazy require so Rails const is only defined when using generators
         
     | 
| 
       14 
17 
     | 
    
         
             
                require "rails/generators"
         
     | 
| 
       15 
18 
     | 
    
         
             
                require "rails/configuration"
         
     | 
| 
       16 
19 
     | 
    
         
             
                Rails::Generators.configure!(config)
         
     | 
| 
       17 
     | 
    
         
            -
                Rails::Generators.invoke(@generator, @args, behavior:  
     | 
| 
      
 20 
     | 
    
         
            +
                Rails::Generators.invoke(@generator, @args, behavior: behavior, destination_root: Jets.root)
         
     | 
| 
       18 
21 
     | 
    
         
             
              end
         
     | 
| 
       19 
22 
     | 
    
         | 
| 
       20 
23 
     | 
    
         
             
              def config
         
     | 
| 
       21 
24 
     | 
    
         
             
                g = Rails::Configuration::Generators.new
         
     | 
| 
       22 
25 
     | 
    
         
             
                g.orm             :active_record, migration: true, timestamps: true
         
     | 
| 
       23 
26 
     | 
    
         
             
                # TODO: support g.orm :dynamodb
         
     | 
| 
       24 
     | 
    
         
            -
                g.template_engine :erb
         
     | 
| 
       25 
27 
     | 
    
         
             
                g.test_framework  false #:test_unit, fixture: false
         
     | 
| 
       26 
28 
     | 
    
         
             
                # g.test_framework :rspec # need to
         
     | 
| 
       27 
29 
     | 
    
         
             
                # TODO: load rspec configuration to use rspec
         
     | 
| 
       28 
30 
     | 
    
         
             
                g.stylesheets     false
         
     | 
| 
       29 
31 
     | 
    
         
             
                g.javascripts     false
         
     | 
| 
       30 
32 
     | 
    
         
             
                g.assets          false
         
     | 
| 
       31 
     | 
    
         
            -
                 
     | 
| 
      
 33 
     | 
    
         
            +
                if Jets.config.mode == 'api'
         
     | 
| 
      
 34 
     | 
    
         
            +
                  g.api_only = true
         
     | 
| 
      
 35 
     | 
    
         
            +
                  g.template_engine nil
         
     | 
| 
      
 36 
     | 
    
         
            +
                else
         
     | 
| 
      
 37 
     | 
    
         
            +
                  g.template_engine :erb
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
       32 
39 
     | 
    
         
             
                g.resource_route  true
         
     | 
| 
       33 
40 
     | 
    
         
             
                g.templates.unshift(template_paths)
         
     | 
| 
       34 
41 
     | 
    
         
             
                g
         
     | 
    
        data/lib/jets/version.rb
    CHANGED
    
    
    
        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.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.8.10
         
     | 
| 
       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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2019-04-27 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: actionmailer
         
     | 
| 
         @@ -570,6 +570,7 @@ files: 
     | 
|
| 
       570 
570 
     | 
    
         
             
            - lib/jets/commands/help/dbconsole.md
         
     | 
| 
       571 
571 
     | 
    
         
             
            - lib/jets/commands/help/delete.md
         
     | 
| 
       572 
572 
     | 
    
         
             
            - lib/jets/commands/help/deploy.md
         
     | 
| 
      
 573 
     | 
    
         
            +
            - lib/jets/commands/help/destroy.md
         
     | 
| 
       573 
574 
     | 
    
         
             
            - lib/jets/commands/help/dynamodb/generate.md
         
     | 
| 
       574 
575 
     | 
    
         
             
            - lib/jets/commands/help/dynamodb/migrate.md
         
     | 
| 
       575 
576 
     | 
    
         
             
            - lib/jets/commands/help/gems/check.md
         
     |