lam 0.0.1 → 0.1.0
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/.gitignore +8 -16
- data/Gemfile +3 -3
- data/README.md +17 -19
- data/Rakefile +0 -4
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lam.gemspec +20 -18
- data/lib/lam.rb +1 -10
- data/lib/lam/version.rb +1 -1
- metadata +21 -189
- data/.rspec +0 -2
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -107
- data/Guardfile +0 -22
- data/LICENSE.txt +0 -22
- data/bin/lam +0 -14
- data/lib/lam/base_controller.rb +0 -54
- data/lib/lam/build.rb +0 -43
- data/lib/lam/build/handler_generator.rb +0 -34
- data/lib/lam/build/lambda_deducer.rb +0 -47
- data/lib/lam/build/templates/handler.js +0 -156
- data/lib/lam/build/traveling_ruby.rb +0 -108
- data/lib/lam/cli.rb +0 -23
- data/lib/lam/cli/help.rb +0 -19
- data/lib/lam/command.rb +0 -25
- data/lib/lam/process.rb +0 -18
- data/lib/lam/process/base_processor.rb +0 -23
- data/lib/lam/process/controller_processor.rb +0 -36
- data/lib/lam/process/help.rb +0 -11
- data/lib/lam/process/processor_deducer.rb +0 -52
- data/lib/lam/util.rb +0 -13
- data/notes/design.md +0 -43
- data/notes/traveling-ruby-packaging-lam.md +0 -26
- data/notes/traveling-ruby-packaging.md +0 -103
- data/notes/traveling-ruby.md +0 -82
- data/spec/fixtures/project/.gitignore +0 -3
- data/spec/fixtures/project/.ruby-version +0 -1
- data/spec/fixtures/project/Gemfile +0 -4
- data/spec/fixtures/project/Gemfile.lock +0 -35
- data/spec/fixtures/project/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/project/app/controllers/posts_controller.rb +0 -12
- data/spec/fixtures/project/bin/lam +0 -22
- data/spec/fixtures/project/handlers/controllers/posts.js +0 -156
- data/spec/lib/cli_spec.rb +0 -20
- data/spec/lib/lam/base_controller_spec.rb +0 -18
- data/spec/lib/lam/build/lambda_deducer_spec.rb +0 -20
- data/spec/lib/lam/build_spec.rb +0 -29
- data/spec/lib/lam/process/controller_processor_spec.rb +0 -22
- data/spec/lib/lam/process/infer_spec.rb +0 -24
- data/spec/lib/lam/process_spec.rb +0 -18
- data/spec/spec_helper.rb +0 -25
| @@ -1,24 +0,0 @@ | |
| 1 | 
            -
            require "spec_helper"
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            describe Lam::Process::ProcessorDeducer do
         | 
| 4 | 
            -
              describe "ProcessorDeducer" do
         | 
| 5 | 
            -
                let(:deducer) { Lam::Process::ProcessorDeducer.new(handle) }
         | 
| 6 | 
            -
             | 
| 7 | 
            -
                context("controller") do
         | 
| 8 | 
            -
                  let(:handle) { "handlers/controllers/posts.create" }
         | 
| 9 | 
            -
                  it "deduces processor info" do
         | 
| 10 | 
            -
                    expect(deducer.controller[:path]).to include "app/controllers/posts_controller.rb"
         | 
| 11 | 
            -
                    expect(deducer.controller[:code]).to eq "PostsController.new(event, context).create"
         | 
| 12 | 
            -
                  end
         | 
| 13 | 
            -
                end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
                context("function") do
         | 
| 16 | 
            -
                  let(:handle) { "handlers/functions/posts.create" }
         | 
| 17 | 
            -
                  it "deduces processor info" do
         | 
| 18 | 
            -
                    expect(deducer.function[:path]).to include "app/functions/posts.rb"
         | 
| 19 | 
            -
                    expect(deducer.function[:code]).to eq "create(event, context)"
         | 
| 20 | 
            -
                  end
         | 
| 21 | 
            -
                end
         | 
| 22 | 
            -
             | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
            end
         | 
| @@ -1,18 +0,0 @@ | |
| 1 | 
            -
            require_relative "../../spec_helper"
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            describe Lam::Process do
         | 
| 4 | 
            -
              before(:all) do
         | 
| 5 | 
            -
                # @args = "--noop --project-root spec/fixtures/my_project"
         | 
| 6 | 
            -
                @args = '\'{ "we" : "love", "using" : "Lambda" }\' \'{"test": "1"}\' "handlers/controllers/posts.create"'
         | 
| 7 | 
            -
              end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
              describe "lam process" do
         | 
| 10 | 
            -
                it "controller [event] [context] [handler]" do
         | 
| 11 | 
            -
                  out = execute("bin/lam process controller #{@args}")
         | 
| 12 | 
            -
                  # pp out # uncomment to debug
         | 
| 13 | 
            -
                  data = JSON.parse(out)
         | 
| 14 | 
            -
                  expect(data["statusCode"]).to eq 200
         | 
| 15 | 
            -
                  expect(data["body"]).to eq({"we"=>"love", "using"=>"Lambda"})
         | 
| 16 | 
            -
                end
         | 
| 17 | 
            -
              end
         | 
| 18 | 
            -
            end
         | 
    
        data/spec/spec_helper.rb
    DELETED
    
    | @@ -1,25 +0,0 @@ | |
| 1 | 
            -
            ENV["TEST"] = "1"
         | 
| 2 | 
            -
            ENV["PROJECT_ROOT"] = "./spec/fixtures/project"
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            # require "simplecov"
         | 
| 5 | 
            -
            # SimpleCov.start
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            require "pp"
         | 
| 8 | 
            -
            require "byebug"
         | 
| 9 | 
            -
            require "fileutils"
         | 
| 10 | 
            -
             | 
| 11 | 
            -
            root = File.expand_path("../../", __FILE__)
         | 
| 12 | 
            -
            require "#{root}/lib/lam"
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            module Helpers
         | 
| 15 | 
            -
              def execute(cmd)
         | 
| 16 | 
            -
                puts "Running: #{cmd}" if ENV["DEBUG"]
         | 
| 17 | 
            -
                out = `#{cmd}`
         | 
| 18 | 
            -
                puts out if ENV["DEBUG"]
         | 
| 19 | 
            -
                out
         | 
| 20 | 
            -
              end
         | 
| 21 | 
            -
            end
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            RSpec.configure do |c|
         | 
| 24 | 
            -
              c.include Helpers
         | 
| 25 | 
            -
            end
         |