hashipack 0.1.2 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bc601e0ae8e788119ff4b30e7ce12a45d7ab3ae0b0987ecdd4b45c885f9ada4
4
- data.tar.gz: c53094f4224088d6a046fdaad716840bd0f821ec4dd29a1c3512c176302f00ac
3
+ metadata.gz: bad7a4163d44985247790a4318629ceef091c75741cb92dd222d9cc34841ea45
4
+ data.tar.gz: 612a8f92ff96680ec3e92c48ef1e9c5183203811191d8367f146533db2c52f5b
5
5
  SHA512:
6
- metadata.gz: fa0bbfb55fd33146016a1b096d5b40c9eb103d0d04a78c5254b4884d9a8fdfd0ced8b9202eee1dde1a64faa3f598465b3c6bfcdbd3989ce49e6988c639938754
7
- data.tar.gz: '0790ba7c73c13834b421803a3243c32c0cd51b711821c30457ef64c3cc1c2758d81455a98f89f71ea0d65c8aa6783849e00fa67cf529abb98366ada85c9c5ffc'
6
+ metadata.gz: 6d89c910f7daac9f11748ecd0fd6d8e8dc847a84806059373371e37aa5ca1e0f1eba9a334904bd0f44b483f18494758e3ec2bd980c86e2e5d3b74d23ae06e422
7
+ data.tar.gz: 2b947c3a9fe0508320f3bc6c64ab571d9b2f1df9ceeef1fd982460927c439912b787ea92d84ca2160175fdb9c256386fb537a2e342e008825062da22114a9e7c
@@ -0,0 +1,34 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "Ruby",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye",
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ // "features": {},
10
+
11
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
12
+ // "forwardPorts": [],
13
+
14
+ // Use 'postCreateCommand' to run commands after the container is created.
15
+ // "postCreateCommand": "ruby --version",
16
+
17
+ // Configure tool-specific properties.
18
+ "customizations": {
19
+ "vscode": {
20
+ "extensions": [
21
+ "shardulm94.trailing-spaces"
22
+ ],
23
+ "settings": {
24
+ "rubyLsp.rubyVersionManager": {
25
+ "identifier": "none"
26
+ },
27
+ "editor.formatOnSaveMode": "file"
28
+ }
29
+ }
30
+ }
31
+
32
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
33
+ // "remoteUser": "root"
34
+ }
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hashipack (0.1.2)
4
+ hashipack (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -20,7 +20,8 @@ GEM
20
20
  rainbow (3.1.1)
21
21
  rake (13.0.6)
22
22
  regexp_parser (2.8.2)
23
- rexml (3.2.6)
23
+ rexml (3.3.3)
24
+ strscan
24
25
  rspec (3.12.0)
25
26
  rspec-core (~> 3.12.0)
26
27
  rspec-expectations (~> 3.12.0)
@@ -64,6 +65,7 @@ GEM
64
65
  standard-performance (1.2.1)
65
66
  lint_roller (~> 1.1)
66
67
  rubocop-performance (~> 1.19.1)
68
+ strscan (3.1.0)
67
69
  unicode-display_width (2.5.0)
68
70
 
69
71
  PLATFORMS
@@ -76,4 +78,4 @@ DEPENDENCIES
76
78
  standard (~> 1.3)
77
79
 
78
80
  BUNDLED WITH
79
- 2.4.10
81
+ 2.5.11
data/README.md CHANGED
@@ -35,13 +35,22 @@ Create a client:
35
35
  client = Hashipack::Client.new
36
36
  ```
37
37
 
38
- Build an image by providing the template:
38
+ Build an image by providing the filename of the template:
39
39
 
40
40
  ```ruby
41
- template = File.read('myimage.pkr.hcl')
41
+ template = 'myimage.pkr.hcl'
42
42
  result = client.build(template)
43
43
  ```
44
44
 
45
+ If the template and the assets are in a different folder:
46
+
47
+ ```ruby
48
+ Dir.chdir('./app/templates') do
49
+ template = 'myimage.pkr.hcl'
50
+ result = client.build(template)
51
+ end
52
+ ```
53
+
45
54
  Subscribe to log messages and print them as they arrive:
46
55
 
47
56
  ```ruby
@@ -2,11 +2,8 @@ require 'tempfile'
2
2
 
3
3
  module Hashipack
4
4
  class Client
5
- def build(content, on_output: lambda {}, on_progress: lambda {}, estimated_duration: 300)
6
- template = Tempfile.new(["template", ".pkr.hcl"])
7
- template.write(content)
8
- template.close
9
- command = "packer -machine-readable build #{template.path}"
5
+ def build(filename, on_output: lambda {}, on_progress: lambda {}, estimated_duration: 300)
6
+ command = "packer -machine-readable build #{filename}"
10
7
 
11
8
  initial_timestamp = 99999999999
12
9
  last_timestamp = 0
@@ -13,6 +13,8 @@ module Hashipack
13
13
  end
14
14
 
15
15
  def initialize(line)
16
+ line = line.force_encoding('UTF-8')
17
+ line = line.encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
16
18
  @parts = line.split(",")
17
19
  end
18
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hashipack
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashipack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-17 00:00:00.000000000 Z
11
+ date: 2024-08-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: None.
14
14
  email:
@@ -17,6 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - ".devcontainer/devcontainer.json"
20
21
  - ".rspec"
21
22
  - ".standard.yml"
22
23
  - CHANGELOG.md
@@ -52,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
53
  - !ruby/object:Gem::Version
53
54
  version: '0'
54
55
  requirements: []
55
- rubygems_version: 3.4.10
56
+ rubygems_version: 3.5.11
56
57
  signing_key:
57
58
  specification_version: 4
58
59
  summary: Ruby client for Hashicorps Packer