lam 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -16
  3. data/Gemfile +3 -3
  4. data/README.md +17 -19
  5. data/Rakefile +0 -4
  6. data/bin/console +14 -0
  7. data/bin/setup +8 -0
  8. data/lam.gemspec +20 -18
  9. data/lib/lam.rb +1 -10
  10. data/lib/lam/version.rb +1 -1
  11. metadata +21 -189
  12. data/.rspec +0 -2
  13. data/.ruby-version +0 -1
  14. data/Gemfile.lock +0 -107
  15. data/Guardfile +0 -22
  16. data/LICENSE.txt +0 -22
  17. data/bin/lam +0 -14
  18. data/lib/lam/base_controller.rb +0 -54
  19. data/lib/lam/build.rb +0 -43
  20. data/lib/lam/build/handler_generator.rb +0 -34
  21. data/lib/lam/build/lambda_deducer.rb +0 -47
  22. data/lib/lam/build/templates/handler.js +0 -156
  23. data/lib/lam/build/traveling_ruby.rb +0 -108
  24. data/lib/lam/cli.rb +0 -23
  25. data/lib/lam/cli/help.rb +0 -19
  26. data/lib/lam/command.rb +0 -25
  27. data/lib/lam/process.rb +0 -18
  28. data/lib/lam/process/base_processor.rb +0 -23
  29. data/lib/lam/process/controller_processor.rb +0 -36
  30. data/lib/lam/process/help.rb +0 -11
  31. data/lib/lam/process/processor_deducer.rb +0 -52
  32. data/lib/lam/util.rb +0 -13
  33. data/notes/design.md +0 -43
  34. data/notes/traveling-ruby-packaging-lam.md +0 -26
  35. data/notes/traveling-ruby-packaging.md +0 -103
  36. data/notes/traveling-ruby.md +0 -82
  37. data/spec/fixtures/project/.gitignore +0 -3
  38. data/spec/fixtures/project/.ruby-version +0 -1
  39. data/spec/fixtures/project/Gemfile +0 -4
  40. data/spec/fixtures/project/Gemfile.lock +0 -35
  41. data/spec/fixtures/project/app/controllers/application_controller.rb +0 -2
  42. data/spec/fixtures/project/app/controllers/posts_controller.rb +0 -12
  43. data/spec/fixtures/project/bin/lam +0 -22
  44. data/spec/fixtures/project/handlers/controllers/posts.js +0 -156
  45. data/spec/lib/cli_spec.rb +0 -20
  46. data/spec/lib/lam/base_controller_spec.rb +0 -18
  47. data/spec/lib/lam/build/lambda_deducer_spec.rb +0 -20
  48. data/spec/lib/lam/build_spec.rb +0 -29
  49. data/spec/lib/lam/process/controller_processor_spec.rb +0 -22
  50. data/spec/lib/lam/process/infer_spec.rb +0 -24
  51. data/spec/lib/lam/process_spec.rb +0 -18
  52. 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
@@ -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