serverlessgems 0.1.2 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/jets/gems/agree.rb +20 -7
- data/lib/jets/gems/api/concern.rb +4 -0
- data/lib/jets/gems/api.rb +4 -0
- data/lib/jets/gems/check.rb +20 -3
- data/lib/jets/gems/exist.rb +0 -2
- data/lib/jets/gems/extract/base.rb +4 -5
- data/lib/jets/gems/registered.rb +12 -0
- data/lib/jets/gems/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74e84f29a566951ffcc259be3bdf1e10421a5eb86528089fc0ff4f5805f52e8d
|
4
|
+
data.tar.gz: c3497fbf6fd4a7169bf29b7319599a43c59b3e6cc69d2b4a9ddd98e1bba395b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf4a3db72832ca353ea6fbe74d7e819e7631e88121d209efb1b1c645f56e520538323d480d289de5df861ddc22dd0bcc583214df6a261c6e5bf82664cbbaac13
|
7
|
+
data.tar.gz: 9d6d8d4669d7e7659a3b2ea6add218b963cd3160361ff6c5cf1b58699d0b5a069073364f9b959c1b4f9c23b7634c7178f85ea2ca4f05816651d59dbb6cda0e11
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,18 @@
|
|
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
|
+
## [0.1.6] - 2021-11-11
|
7
|
+
- [#5](https://github.com/boltops-tools/serverlessgems/pull/5) fix gem regexp detection for 2021 macbook m1 chip
|
8
|
+
|
9
|
+
## [0.1.5] - 2021-08-31
|
10
|
+
- [#4](https://github.com/boltops-tools/serverlessgems/pull/4) Don't create a file if the download fails
|
11
|
+
|
12
|
+
## [0.1.4] - 2021-07-15
|
13
|
+
- [#3](https://github.com/boltops-tools/serverlessgems/pull/3) gems/registered api
|
14
|
+
|
15
|
+
## [0.1.3] - 2021-04-13
|
16
|
+
- update jets agree messaging
|
17
|
+
|
6
18
|
## [0.1.2] - 2021-01-12
|
7
19
|
- [#2](https://github.com/boltops-tools/serverlessgems/pull/2) fix other_compiled_gems Jets.build_root
|
8
20
|
|
data/lib/jets/gems/agree.rb
CHANGED
@@ -7,19 +7,32 @@ module Jets::Gems
|
|
7
7
|
# Only prompts if hasnt prompted before and saved a ~/.jets/agree file
|
8
8
|
def prompt
|
9
9
|
return if bypass_prompt
|
10
|
-
return if File.exist?(@agree_file)
|
10
|
+
return if File.exist?(@agree_file) && File.mtime(@agree_file) > Time.parse("2021-04-12")
|
11
11
|
|
12
12
|
puts <<~EOL
|
13
|
-
Jets
|
13
|
+
Jets uses pre-built binary gems from the serverlessgems.com service to
|
14
|
+
provide a user-friendly developer experience. The Serverless Gems Service
|
15
|
+
rate limits free gem download requests daily. You can upgrade to a paid plan
|
16
|
+
for unlimited gem download requests. Open Source projects may also qualify
|
17
|
+
for a free unlimited plan. More info:
|
14
18
|
|
15
|
-
|
16
|
-
So if you run into missing gems, you can try deploying again after a few minutes.
|
17
|
-
Non-reported gems may take several days or longer.
|
19
|
+
https://www.serverlessgems.com/rate-limits
|
18
20
|
|
19
|
-
|
21
|
+
If you do not want to use Serverless Gems, you can disable the Serverless
|
22
|
+
Gems service and provide your own custom Lambda Layer. More info:
|
20
23
|
|
24
|
+
https://rubyonjets.com/docs/serverlessgems/
|
25
|
+
https://rubyonjets.com/docs/extras/custom-lambda-layers/
|
26
|
+
|
27
|
+
Also, reporting gems to Serverless Gems allows it to build new gems typically
|
28
|
+
within a few minutes. So if you run into missing gems, you can try deploying
|
29
|
+
again after a few minutes. Non-reported gems may take several days or longer.
|
30
|
+
Serverless Gems only collects the info it needs to run the service.
|
31
|
+
More info: https://www.serverlessgems.com/privacy
|
21
32
|
This message will only appear once on this machine.
|
22
|
-
|
33
|
+
|
34
|
+
You can also automatically skip this message by setting:
|
35
|
+
JETS_AGREE=yes or JETS_AGREE=no
|
23
36
|
|
24
37
|
Is it okay to send your gem data to Serverless Gems? (Y/n)?
|
25
38
|
EOL
|
data/lib/jets/gems/api.rb
CHANGED
data/lib/jets/gems/check.rb
CHANGED
@@ -12,7 +12,7 @@ module Jets::Gems
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def run!
|
15
|
-
puts "Gems source: #{gems_source}" if @options[:
|
15
|
+
puts "Gems source: #{gems_source}" if @options[:verbose]
|
16
16
|
run(exit_early: true)
|
17
17
|
end
|
18
18
|
|
@@ -24,7 +24,7 @@ module Jets::Gems
|
|
24
24
|
def run(exit_early: false)
|
25
25
|
puts "Checking projects gems for binary serverlessgems..."
|
26
26
|
compiled_gems.each do |gem_name|
|
27
|
-
puts "Checking #{gem_name}..." if @options[:
|
27
|
+
puts "Checking #{gem_name}..." if @options[:verbose]
|
28
28
|
exist = Jets::Gems::Exist.new
|
29
29
|
@missing_gems << gem_name unless exist.check(gem_name)
|
30
30
|
end
|
@@ -133,6 +133,7 @@ EOL
|
|
133
133
|
#
|
134
134
|
gems = gemspec_compiled_gems
|
135
135
|
gems += other_compiled_gems
|
136
|
+
gems += registered_compiled_gems
|
136
137
|
gems.uniq
|
137
138
|
end
|
138
139
|
end
|
@@ -147,9 +148,25 @@ EOL
|
|
147
148
|
# /tmp/jets/demo/stage/opt/ruby/gems/2.7.0/gems/nokogiri-1.11.1-x86_64-darwin
|
148
149
|
# /tmp/jets/demo/stage/opt/ruby/gems/2.7.0/gems/nokogiri-1.11.1-x86_64-linux
|
149
150
|
#
|
151
|
+
# On new 2021 macbook with m1 chip: the gems are being saved in a folder like so:
|
152
|
+
# nokogiri-1.12.5-arm64-darwin
|
153
|
+
# The GEM_REGEXP accounts for this case.
|
154
|
+
GEM_REGEXP = /-(arm|x)\d+.*-(darwin|linux)/
|
150
155
|
def other_compiled_gems
|
151
156
|
paths = Dir.glob("#{Jets.build_root}/stage/opt/ruby/gems/#{Jets::Gems.ruby_folder}/gems/*{-darwin,-linux}")
|
152
|
-
paths.map { |p| File.basename(p).sub(
|
157
|
+
paths.map { |p| File.basename(p).sub(GEM_REGEXP,'') }
|
158
|
+
end
|
159
|
+
|
160
|
+
def registered_compiled_gems
|
161
|
+
registered = Jets::Gems::Registered.new
|
162
|
+
registered_gems = registered.all # no version numbers in this list
|
163
|
+
|
164
|
+
paths = Dir.glob("#{Jets.build_root}/stage/opt/ruby/gems/#{Jets::Gems.ruby_folder}/gems/*")
|
165
|
+
project_gems = paths.map { |p| File.basename(p).sub(GEM_REGEXP,'') }
|
166
|
+
project_gems.select do |name|
|
167
|
+
name_only = name.sub(/-\d+\.\d+\.\d+.*/,'')
|
168
|
+
registered_gems.include?(name_only)
|
169
|
+
end
|
153
170
|
end
|
154
171
|
|
155
172
|
# Use pre-compiled gem because the gem could have development header shared
|
data/lib/jets/gems/exist.rb
CHANGED
@@ -41,13 +41,12 @@ module Jets::Gems::Extract
|
|
41
41
|
end
|
42
42
|
|
43
43
|
say "Downloading..."
|
44
|
+
downloaded = URI.open(url, 'rb') { |read_file| read_file.read }
|
45
|
+
|
44
46
|
FileUtils.mkdir_p(File.dirname(dest)) # ensure parent folder exists
|
45
47
|
|
46
|
-
File.open(dest, 'wb')
|
47
|
-
|
48
|
-
saved_file.write(read_file.read)
|
49
|
-
end
|
50
|
-
end
|
48
|
+
File.open(dest, 'wb') { |saved_file| saved_file.write(downloaded) }
|
49
|
+
|
51
50
|
dest
|
52
51
|
end
|
53
52
|
|
data/lib/jets/gems/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverlessgems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gems
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/jets/gems/exist.rb
|
123
123
|
- lib/jets/gems/extract/base.rb
|
124
124
|
- lib/jets/gems/extract/gem.rb
|
125
|
+
- lib/jets/gems/registered.rb
|
125
126
|
- lib/jets/gems/report.rb
|
126
127
|
- lib/jets/gems/version.rb
|
127
128
|
- lib/serverlessgems.rb
|
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.1.6
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Client Library works with Serverless Gems API for Jets Ruby Serverless Framework
|