serverlessgems 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6634f0a8d8bb9ce0b79e4cf834f39c016d9564cb23945bd451f4bfe5cc348e2c
4
- data.tar.gz: 7aa9d14a70a58ce6d042f86bd46ac5cc69b4d32f7769b5bad3378dc89ea3cadd
3
+ metadata.gz: 801c924a1a3b4c3308e4637a26d849d7423322f579c9985c2197a1ae64b6b98d
4
+ data.tar.gz: d567760d50e0f0c095a4d6ece3bb659a31a351898bb6827266c9bbc0bef0a27a
5
5
  SHA512:
6
- metadata.gz: 7e2a1a50ad495a1430889191b6775ec5d9b5f70aabfda5f0e464bd63b49bfa970c979da824507a327bc0385f367db5e964db99ba83e888342e6ca660b582cf83
7
- data.tar.gz: 87c73a5acb4afe00f462a45c30a03c4cc7b6a91b07e87f60ebe817c53e63b247400ea0912732c3a2c260d1fbd5e8739c8eb9f44bfc4b32426401798a3006c61e
6
+ metadata.gz: 723634152694aebb484c1693c1cbf49466195b0e84424e72a8f46cce75216211fcf138bd5fd36ac4b75fc3c3dbd79f75703964ebac8b1bfc4704e0fef93b76c4
7
+ data.tar.gz: cceb728e1d0bf62c2ced97d31059ab8ff0c155338c540572bbf70c72238b81365392eea49fcc66e2c0ada09c862d4cd152fd5e77b3375e13282af712ad37e6f8
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
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.4] - 2021-07-15
7
+ - [#3](https://github.com/boltops-tools/serverlessgems/pull/3) gems/registered api
8
+
6
9
  ## [0.1.3] - 2021-04-13
7
10
  - update jets agree messaging
8
11
 
data/lib/jets/gems/api.rb CHANGED
@@ -18,6 +18,10 @@ module Jets::Gems
18
18
  get("report/missing?gem_name=#{gem_name}&ruby_folder=#{ruby_folder}")
19
19
  end
20
20
 
21
+ def registered_gems
22
+ get("gems/registered")
23
+ end
24
+
21
25
  def ruby_folder
22
26
  Jets::Gems.ruby_folder
23
27
  end
@@ -1,3 +1,7 @@
1
+ # Need 'open-uri' for exist.rb and regsitered.rb which uses
2
+ # rescue SocketError, OpenURI::HTTPError, OpenSSL::SSL::SSLError
3
+ require 'open-uri'
4
+
1
5
  class Jets::Gems::Api
2
6
  module Concern
3
7
  def api
@@ -12,7 +12,7 @@ module Jets::Gems
12
12
  end
13
13
 
14
14
  def run!
15
- puts "Gems source: #{gems_source}" if @options[:show_source]
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[:cli]
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
@@ -152,6 +153,18 @@ EOL
152
153
  paths.map { |p| File.basename(p).sub(/-x\d+.*-(darwin|linux)/,'') }
153
154
  end
154
155
 
156
+ def registered_compiled_gems
157
+ registered = Jets::Gems::Registered.new
158
+ registered_gems = registered.all # no version numbers in this list
159
+
160
+ paths = Dir.glob("#{Jets.build_root}/stage/opt/ruby/gems/#{Jets::Gems.ruby_folder}/gems/*")
161
+ project_gems = paths.map { |p| File.basename(p).sub(/-x\d+.*-(darwin|linux)/,'') }
162
+ project_gems.select do |name|
163
+ name_only = name.sub(/-\d+\.\d+\.\d+.*/,'')
164
+ registered_gems.include?(name_only)
165
+ end
166
+ end
167
+
155
168
  # Use pre-compiled gem because the gem could have development header shared
156
169
  # object file dependencies. The shared dependencies are packaged up as part
157
170
  # of the pre-compiled gem so it is available in the Lambda execution environment.
@@ -1,5 +1,3 @@
1
- require 'open-uri'
2
-
3
1
  module Jets::Gems
4
2
  class Exist
5
3
  include Jets::Gems::Api::Concern
@@ -0,0 +1,12 @@
1
+ module Jets::Gems
2
+ class Registered
3
+ include Jets::Gems::Api::Concern
4
+
5
+ def all
6
+ data = api.registered_gems
7
+ data["gems"]
8
+ rescue SocketError, OpenURI::HTTPError, OpenSSL::SSL::SSLError
9
+ []
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Jets
2
2
  module Gems
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
4
+ version: 0.1.4
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-04-13 00:00:00.000000000 Z
11
+ date: 2021-07-15 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