pangea 0.0.32 → 0.0.35

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: 05fd91af3bdb569afe2b6a4a2b4f8445f479cf1fe312282c9c75d5e35b4f359d
4
- data.tar.gz: 06df4b71cf542c16cc3c0ea44bff9324cb88cca3b3ed6cee327f6b72565e02cc
3
+ metadata.gz: f4b86f771d7dba0dcd81628331397bab6f0af7393881525bf56d69c6610afc0c
4
+ data.tar.gz: 0bdb7aab8a9daf84a340f2a91e8e059a9b0d4140a27de080f4752b41f5ba6227
5
5
  SHA512:
6
- metadata.gz: deae78f3c4384d097481c572fff86e711fc9ab7f5b3472a3b813a3028ada006de0c6887f03163c2b38275c77416f3d79c7459c62077621ffc7a1d510e0ba46ed
7
- data.tar.gz: 40636066a0d51c458bfad53af314bc1fd2da310566e8a8bbbed3bc63b27f804532d5039588380feb9be4e49106841c2a5e564dceff04420dc90767fca6c170bc
6
+ metadata.gz: 1b07f36ea7ed8131657ecc1836fb8d239962610db85afb8c0abb448a5ab6ddcfe44a6b367374e951c8d40f99bd14c657335961b00017ab1ba1ac886190735b63
7
+ data.tar.gz: f2b43731ade333979046e962f8312173e61068d9dd8644d6f73611972a69cf45780f81e791fe9879090b68146a118f9e56be863363594e60fd51ca1ebc3742b3
data/Gemfile.lock CHANGED
@@ -1,21 +1,20 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- abstract-synthesizer (0.0.1)
4
+ abstract-synthesizer (0.0.2)
5
5
  ast (2.4.2)
6
6
  aws-eventstream (1.2.0)
7
- aws-partitions (1.802.0)
8
- aws-sdk-core (3.180.3)
7
+ aws-partitions (1.854.0)
8
+ aws-sdk-core (3.187.1)
9
9
  aws-eventstream (~> 1, >= 1.0.2)
10
10
  aws-partitions (~> 1, >= 1.651.0)
11
11
  aws-sigv4 (~> 1.5)
12
12
  jmespath (~> 1, >= 1.6.1)
13
- aws-sdk-dynamodb (1.93.1)
14
- aws-sdk-core (~> 3, >= 3.177.0)
13
+ aws-sdk-dynamodb (1.96.0)
14
+ aws-sdk-core (~> 3, >= 3.184.0)
15
15
  aws-sigv4 (~> 1.1)
16
- aws-sigv4 (1.6.0)
16
+ aws-sigv4 (1.6.1)
17
17
  aws-eventstream (~> 1, >= 1.0.2)
18
- base64 (0.1.1)
19
18
  citrus (3.0.2)
20
19
  diff-lcs (1.5.0)
21
20
  jmespath (1.6.2)
@@ -23,15 +22,15 @@ GEM
23
22
  keycutter (1.0.2)
24
23
  language_server-protocol (3.17.0.3)
25
24
  parallel (1.23.0)
26
- parser (3.2.2.3)
25
+ parser (3.2.2.4)
27
26
  ast (~> 2.4.1)
28
27
  racc
29
28
  pastel (0.8.0)
30
29
  tty-color (~> 0.5)
31
- racc (1.7.1)
30
+ racc (1.7.3)
32
31
  rainbow (3.1.1)
33
- rake (13.0.6)
34
- regexp_parser (2.8.1)
32
+ rake (13.1.0)
33
+ regexp_parser (2.8.2)
35
34
  rexml (3.2.6)
36
35
  rspec (3.12.0)
37
36
  rspec-core (~> 3.12.0)
@@ -46,28 +45,27 @@ GEM
46
45
  diff-lcs (>= 1.2.0, < 2.0)
47
46
  rspec-support (~> 3.12.0)
48
47
  rspec-support (3.12.1)
49
- rubocop (1.56.0)
50
- base64 (~> 0.1.1)
48
+ rubocop (1.57.2)
51
49
  json (~> 2.3)
52
50
  language_server-protocol (>= 3.17.0)
53
51
  parallel (~> 1.10)
54
- parser (>= 3.2.2.3)
52
+ parser (>= 3.2.2.4)
55
53
  rainbow (>= 2.2.2, < 4.0)
56
54
  regexp_parser (>= 1.8, < 3.0)
57
55
  rexml (>= 3.2.5, < 4.0)
58
56
  rubocop-ast (>= 1.28.1, < 2.0)
59
57
  ruby-progressbar (~> 1.7)
60
58
  unicode-display_width (>= 2.4.0, < 3.0)
61
- rubocop-ast (1.29.0)
59
+ rubocop-ast (1.30.0)
62
60
  parser (>= 3.2.1.0)
63
- rubocop-capybara (2.18.0)
61
+ rubocop-capybara (2.19.0)
64
62
  rubocop (~> 1.41)
65
- rubocop-factory_bot (2.23.1)
63
+ rubocop-factory_bot (2.24.0)
66
64
  rubocop (~> 1.33)
67
65
  rubocop-rake (0.6.0)
68
66
  rubocop (~> 1.0)
69
- rubocop-rspec (2.23.2)
70
- rubocop (~> 1.33)
67
+ rubocop-rspec (2.25.0)
68
+ rubocop (~> 1.40)
71
69
  rubocop-capybara (~> 2.17)
72
70
  rubocop-factory_bot (~> 2.22)
73
71
  ruby-progressbar (1.13.0)
@@ -76,7 +74,7 @@ GEM
76
74
  unicode-display_width (>= 1.5, < 3.0)
77
75
  unicode_utils (~> 1.4)
78
76
  strings-ansi (0.2.0)
79
- terraform-synthesizer (0.0.1)
77
+ terraform-synthesizer (0.0.2)
80
78
  toml-rb (2.2.0)
81
79
  citrus (~> 3.0, > 3.0)
82
80
  tty-box (0.7.0)
@@ -96,12 +94,12 @@ GEM
96
94
  pastel (~> 0.8)
97
95
  strings (~> 0.2.0)
98
96
  tty-screen (~> 0.8)
99
- unicode-display_width (2.4.2)
97
+ unicode-display_width (2.5.0)
100
98
  unicode_utils (1.4.0)
101
99
  yard (0.9.34)
102
100
 
103
101
  PLATFORMS
104
- x86_64-darwin-22
102
+ x86_64-linux
105
103
 
106
104
  DEPENDENCIES
107
105
  abstract-synthesizer
@@ -110,6 +110,7 @@ class ConfigCommand < PangeaCommand
110
110
 
111
111
  if this_mod[:sandboxed]
112
112
  # TODO: setup sandboxed module
113
+ # sandbox should be a complete ruby executable space
113
114
  nil
114
115
  elsif this_mod[:path]
115
116
 
@@ -174,7 +175,7 @@ class ConfigCommand < PangeaCommand
174
175
  )
175
176
  puts "Created table. Status: #{result.table_description.table_status}"
176
177
  rescue Aws::DynamoDB::Errors::ServiceError => e
177
- puts e.message.to_s
178
+ puts e.message
178
179
  end
179
180
  end
180
181
 
@@ -51,15 +51,10 @@ module PangeaModule
51
51
  %(rubies)
52
52
  )
53
53
 
54
- RUBIES_DIR = File.join(
55
- BASE_DIR,
56
- %(rubies)
57
- )
58
-
59
- SECTIONS = %i[
60
- lib
61
- src
62
- ].freeze
54
+ # SECTIONS = %i[
55
+ # lib
56
+ # src
57
+ # ].freeze
63
58
 
64
59
  class << self
65
60
  # entrypoint for module processing
@@ -0,0 +1,90 @@
1
+ ###############################################################################
2
+ # sandbox
3
+ #
4
+ # modules need an execution space which I'm naming sandboxes
5
+ # sandboxes will contain the ruby interpreter, associated packages
6
+ # and pangea DSL code for the execution of a single module
7
+ ###############################################################################
8
+
9
+ class SandboxRuby
10
+ attr_reader(*%i[base_dir name gemset version])
11
+
12
+ def initialize(base_dir:, name:, gemset:, version:)
13
+ @base_dir = base_dir
14
+ @version = version
15
+ @name = name
16
+ @gemset = gemset
17
+ end
18
+ end
19
+
20
+ class SandBox
21
+ attr_reader(*%i[base_dir name rubies])
22
+
23
+ def initialize(
24
+ name:,
25
+ base_dir: %(~/.pangea/sandbox),
26
+ rubies: []
27
+ )
28
+ @base_dir = base_dir
29
+ @name = name
30
+ @rubies = rubies
31
+
32
+ @rubies_dir = File.join(@base_dir, @name, %(rubies))
33
+
34
+ @ruby_build_cmd = %(ruby-build)
35
+ end
36
+
37
+ def prepare_sandbox
38
+ ensure_base_dir_exists
39
+ ensure_rubies_directories_exist
40
+ check_ruby_build_installed
41
+ ensure_rubies_installed
42
+ end
43
+
44
+ def clean_sandbox
45
+ system %(rm -rf #{base_dir})
46
+ end
47
+
48
+ private
49
+
50
+ def ensure_base_dir_exists
51
+ system %(mkdir -p #{base_dir}) unless Dir.exist?(base_dir)
52
+ end
53
+
54
+ def ensure_rubies_directories_exist
55
+ rubies.each do |ruby|
56
+ ruby_dir = File.join(@rubies_dir, ruby.version, ruby.gemset, ruby.name)
57
+ system %(mkdir -p #{ruby_dir}) unless Dir.exist?(ruby_dir)
58
+ end
59
+ end
60
+
61
+ def command_exists_on_path?(cmd)
62
+ system("which #{cmd} > /dev/null 2>&1")
63
+ end
64
+
65
+ def ruby_build_installed?
66
+ command_exists_on_path?(@ruby_build_cmd)
67
+ end
68
+
69
+ def ensure_rubies_installed
70
+ rubies.each do |ruby|
71
+ ruby_dir = File.join(@rubies_dir, ruby.version, ruby.gemset, ruby.name)
72
+ system %(#{@ruby_build_cmd} #{ruby.version} #{ruby_dir}) unless File.exist?(
73
+ File.join(
74
+ ruby_dir,
75
+ %(.installed_by_pangea)
76
+ )
77
+ )
78
+ system %(touch #{File.join(ruby_dir, %(.installed_by_pangea))}) unless File.exist?(
79
+ File.join(
80
+ ruby_dir,
81
+ %(.installed_by_pangea)
82
+ )
83
+ )
84
+ end
85
+ end
86
+
87
+ def check_ruby_build_installed
88
+ raise %(ruby-build not installed) unless ruby_build_installed?
89
+ end
90
+ end
@@ -1,3 +1,3 @@
1
1
  module Pangea
2
- VERSION = %(0.0.32).freeze
2
+ VERSION = %(0.0.35).freeze
3
3
  end
data/pangea.gemspec CHANGED
@@ -13,11 +13,14 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = %(control rest apis declaratively with ruby)
14
14
  spec.homepage = %(https://github.com/drzln/#{spec.name})
15
15
  spec.license = %(MIT)
16
- spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
17
16
  spec.require_paths = [%(lib)]
18
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
18
  spec.required_ruby_version = %(>= #{`cat .ruby-version`})
20
19
 
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+
21
24
  %i[
22
25
  rubocop-rspec
23
26
  rubocop-rake
data/pangea.rb CHANGED
@@ -2,17 +2,19 @@ namespace :nexus, :atavan do
2
2
  long :atavan
3
3
  short :at
4
4
 
5
- state_config({
6
- terraform: {
7
- s3: {
8
- bucket: %(atavan-terraform-state),
9
- key: %(atavan/terraform.tfstate),
10
- region: %(us-west-2),
11
- dynamodb_table: %(atavan-terraform-lock),
12
- encrypt: true
5
+ state_config(
6
+ {
7
+ terraform: {
8
+ s3: {
9
+ bucket: %(atavan-terraform-state),
10
+ key: %(atavan/terraform.tfstate),
11
+ region: %(us-west-2),
12
+ dynamodb_table: %(atavan-terraform-lock),
13
+ encrypt: true
14
+ }
13
15
  }
14
16
  }
15
- })
17
+ )
16
18
 
17
19
  # environments(
18
20
  # {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pangea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - drzthslnt@gmail.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-22 00:00:00.000000000 Z
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop-rspec
@@ -265,9 +265,7 @@ dependencies:
265
265
  description: control rest apis declaratively with ruby
266
266
  email:
267
267
  - drzthslnt@gmail.com
268
- executables:
269
- - pangea
270
- - stitches
268
+ executables: []
271
269
  extensions: []
272
270
  extra_rdoc_files: []
273
271
  files:
@@ -282,7 +280,6 @@ files:
282
280
  - README.md
283
281
  - Rakefile
284
282
  - bin/pangea
285
- - bin/stitches
286
283
  - example/config/README.md
287
284
  - example/config/sample.rb
288
285
  - flake.lock
@@ -304,6 +301,7 @@ files:
304
301
  - lib/pangea/errors/site_not_found_error.rb
305
302
  - lib/pangea/log/init.rb
306
303
  - lib/pangea/modules.rb
304
+ - lib/pangea/sandbox.rb
307
305
  - lib/pangea/say/init.rb
308
306
  - lib/pangea/shell/README.md
309
307
  - lib/pangea/shell/terraform.rb
@@ -316,9 +314,6 @@ files:
316
314
  - lib/pangea/version.rb
317
315
  - pangea.gemspec
318
316
  - pangea.rb
319
- - spec/cli/config_spec.rb
320
- - spec/modules_spec.rb
321
- - spec/synthesizer/config_spec.rb
322
317
  homepage: https://github.com/drzln/pangea
323
318
  licenses:
324
319
  - MIT
data/bin/stitches DELETED
File without changes
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require %(pangea/cli/config)
4
-
5
- describe Config do
6
- context %(#resolve_configuration) do
7
- defaults = { ignore_default_paths: true }
8
- it %(empty when paths ignored) do
9
- expect(
10
- Config.resolve_configurations(**defaults.merge(
11
- { extra_paths: [] }
12
- ))
13
- ).to be_empty
14
- end
15
- end
16
- end
data/spec/modules_spec.rb DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require %(pangea/modules)
4
-
5
- describe PangeaModule do
6
- context %(baseline) do
7
- it %(does things) do
8
- expect(true).to be true
9
- end
10
- end
11
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require %(pangea/synthesizer/config)
4
-
5
- # describe ConfigSynthesizer do
6
- # context %(main) do
7
- # let(:synth) do
8
- # described_class.new
9
- # end
10
- #
11
- # it %(should compile small declaration and be hash) do
12
- # synth.synthesize do
13
- # namespace :nietztche, :thus_spoke_zarathustra do
14
- # superman(%(came from krypton))
15
- # overman(%(came from austria))
16
- # end
17
- # end
18
- # expect(synth.synthesis).to be_kind_of(Hash)
19
- # end
20
- #
21
- # it %(should raise an argument error with more than one arg per field) do
22
- # expect do
23
- # synth.synthesize do
24
- # namespace :socrates, :the_republic do
25
- # things(%(may), %(not), %(be), %(what), %(you), %(think))
26
- # end
27
- # end
28
- # end.to raise_error(TooManyFieldValuesError)
29
- # end
30
- #
31
- # it %(should have expected keys) do
32
- # synth.synthesize do
33
- # namespace :kafka, :metamorphasis do
34
- # change :inevitable
35
- # end
36
- # end
37
- # expect(
38
- # synth.synthesis[:namespace][:kafka][:metamorphasis][:change]
39
- # ).to be(:inevitable)
40
- # end
41
- # end
42
- # end