rumbda 0.2.0 → 1.0.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/bin/rumbda +6 -3
- data/lib/rumbda/build.rb +9 -10
- data/lib/rumbda/init.rb +48 -0
- data/lib/rumbda/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bee1aed26ff8b5a992de1babad49ec150b8f5f6d
|
|
4
|
+
data.tar.gz: d9783a813ebf8ed9d1f2b7306eccedb97db73ed6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e4f3d10e848a83f1dfe2b427538d6935a60ec4135ab3e7e6b009d821832f19192ea8f6609680cdcccb2a605453e6d46997370d0281d11653c92ec1a4f4167f8
|
|
7
|
+
data.tar.gz: 6add15aa81a4183d15bd1b627e16b01b82d862f5961ffd583830f2d6c0e7661ab325a66aa8cc82869bf01c003e0f1321461392e8f026c3c65695d0703c657207
|
data/bin/rumbda
CHANGED
|
@@ -5,11 +5,14 @@ require 'rumbda'
|
|
|
5
5
|
class RumbdaCLI < Thor
|
|
6
6
|
desc 'build', 'Builds the zip file for lambda.'
|
|
7
7
|
method_option 'cleanup', type: :boolean, aliases: '-c'
|
|
8
|
-
def build
|
|
9
|
-
Rumbda::Build.run(
|
|
8
|
+
def build
|
|
9
|
+
Rumbda::Build.run(FileUtils.pwd, options)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
desc 'init', 'Sets up the current directory as a rumbda project (creates `source/main.rb`, `.ruby-version`, `Gemfile`, and `.gitignore`).'
|
|
13
|
+
def init
|
|
14
|
+
Rumbda::Init.run(FileUtils.pwd)
|
|
15
|
+
end
|
|
13
16
|
|
|
14
17
|
map '-v' => :version, '--version' => :version
|
|
15
18
|
desc '-v (--version)', 'Outputs the version of rumbda.'
|
data/lib/rumbda/build.rb
CHANGED
|
@@ -15,7 +15,9 @@ module Rumbda
|
|
|
15
15
|
|
|
16
16
|
FileUtils.mkdir_p(dest_source_code_dir)
|
|
17
17
|
FileUtils.mkdir_p(vendor_dir)
|
|
18
|
-
FileUtils.cp_r(Dir.glob(File.join(dir_to_build, '*'))
|
|
18
|
+
FileUtils.cp_r(Dir.glob(File.join(dir_to_build, 'source', '*')), dest_source_code_dir)
|
|
19
|
+
FileUtils.cp_r(File.join(dir_to_build, 'Gemfile'), dest_source_code_dir)
|
|
20
|
+
FileUtils.cp_r(File.join(dir_to_build, 'Gemfile.lock'), dest_source_code_dir)
|
|
19
21
|
FileUtils.mv(File.join(dest_source_code_dir, 'Gemfile'), vendor_dir)
|
|
20
22
|
FileUtils.mv(File.join(dest_source_code_dir, 'Gemfile.lock'), vendor_dir)
|
|
21
23
|
|
|
@@ -119,17 +121,14 @@ module Rumbda
|
|
|
119
121
|
end
|
|
120
122
|
|
|
121
123
|
def self.check_for_files(dir_to_build)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
end
|
|
124
|
+
main_rb = File.join(dir_to_build, 'source', 'main.rb')
|
|
125
|
+
abort("Must have file #{main_rb}") unless File.exist?(main_rb)
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
end
|
|
127
|
+
gemfile = File.join(dir_to_build, 'Gemfile')
|
|
128
|
+
abort("Must have file #{gemfile}") unless File.exist?(gemfile)
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
end
|
|
130
|
+
gemfile_lock = File.join(dir_to_build, 'Gemfile.lock')
|
|
131
|
+
abort("Must have file #{gemfile_lock}") unless File.exist?(gemfile_lock)
|
|
133
132
|
end
|
|
134
133
|
end
|
|
135
134
|
end
|
data/lib/rumbda/init.rb
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Rumbda
|
|
2
|
+
GEMFILE_CONTENTS = <<-HEREDOC
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
# add runtime dependencies here, they will be included in the index.zip
|
|
6
|
+
|
|
7
|
+
# This is the aws ruby sdk provides a ruby client for interacting with AWS apis.
|
|
8
|
+
# gem 'aws-sdk'
|
|
9
|
+
|
|
10
|
+
# DO NOT REMOVE; bundler version MUST match the version that the traveling ruby uses, which is currently 1.9.9.
|
|
11
|
+
gem 'bundler', '= 1.9.9'
|
|
12
|
+
|
|
13
|
+
# gems in the development group will not be included in the index.zip
|
|
14
|
+
group :development do
|
|
15
|
+
gem 'rumbda'
|
|
16
|
+
end
|
|
17
|
+
HEREDOC
|
|
18
|
+
RUBY_VERSION_FILE_CONTENTS = '2.2.2'.freeze
|
|
19
|
+
GITIGNORE_FILE_CONTENTS = "tmp_rumbda\nindex.zip".freeze
|
|
20
|
+
|
|
21
|
+
class Init
|
|
22
|
+
def self.run(directory)
|
|
23
|
+
source_dir = File.join(directory, 'source')
|
|
24
|
+
FileUtils.mkdir(source_dir)
|
|
25
|
+
puts "Created: #{source_dir}"
|
|
26
|
+
|
|
27
|
+
main_rb = File.join(source_dir, 'main.rb')
|
|
28
|
+
FileUtils.touch(main_rb)
|
|
29
|
+
puts "Created: #{main_rb}"
|
|
30
|
+
|
|
31
|
+
ruby_version_file = File.join(directory, '.ruby-version')
|
|
32
|
+
FileUtils.touch(ruby_version_file)
|
|
33
|
+
File.open(ruby_version_file, 'a') { |f| f.puts RUBY_VERSION_FILE_CONTENTS }
|
|
34
|
+
puts "Created: #{ruby_version_file}"
|
|
35
|
+
|
|
36
|
+
gitignore_file = File.join(directory, '.gitignore')
|
|
37
|
+
FileUtils.touch(gitignore_file)
|
|
38
|
+
File.open(gitignore_file, 'a') { |f| f.puts GITIGNORE_FILE_CONTENTS }
|
|
39
|
+
puts "Created: #{gitignore_file}"
|
|
40
|
+
|
|
41
|
+
gemfile = File.join(directory, 'Gemfile')
|
|
42
|
+
FileUtils.touch(gemfile)
|
|
43
|
+
File.open(gemfile, 'a') do |f|
|
|
44
|
+
f.puts GEMFILE_CONTENTS
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/lib/rumbda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rumbda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kleaver
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-05-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -38,7 +38,7 @@ dependencies:
|
|
|
38
38
|
- - '='
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 1.9.9
|
|
41
|
-
description:
|
|
41
|
+
description: Run ruby scripts on aws lambda.
|
|
42
42
|
email: []
|
|
43
43
|
executables:
|
|
44
44
|
- rumbda
|
|
@@ -51,6 +51,7 @@ files:
|
|
|
51
51
|
- lambda/ruby_wrapper.sh
|
|
52
52
|
- lib/rumbda.rb
|
|
53
53
|
- lib/rumbda/build.rb
|
|
54
|
+
- lib/rumbda/init.rb
|
|
54
55
|
- lib/rumbda/version.rb
|
|
55
56
|
homepage: https://github.com/kleaver/rumbda
|
|
56
57
|
licenses:
|