sdn_test_simple_car 0.2.2 → 0.2.3
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/Dockerfile +30 -0
- data/lib/grft_test_simple_car/version.rb +1 -1
- data/lib/simple_car.rb +5 -3
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5be9e62bd0a39ae23b5bd2014ec39d6a902bbb6f89fd41b18cb86ddffb3f4172
|
|
4
|
+
data.tar.gz: b64195b0dc4478c7c0426f198958b593b525a8ee3d0040bf51b0c59c1e7a0cfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b9076234a2ff4b896287e94f7c27e463ba38ff56c9179e9af950bc39f90c30dc6656075a82bc9de2f525d6db38e83bb15c9e09a258f68d0104d7620f0ddc94d
|
|
7
|
+
data.tar.gz: df837c15014a8a8b0dab8918c6f891ac33f71ee2981d98b95e5961e9c06a14f160a4d21f048a775a50daab8ed0375ba31a0666f0e7db5cd8b72d8a82d1ba5064
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
FROM ruby:3.3-slim-bookworm
|
|
2
|
+
|
|
3
|
+
ARG GG_VERSION=latest
|
|
4
|
+
|
|
5
|
+
RUN apt-get update && \
|
|
6
|
+
apt-get install -y --no-install-recommends ca-certificates curl build-essential && \
|
|
7
|
+
rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
RUN if [ "$GG_VERSION" = "latest" ]; then \
|
|
10
|
+
GG_URL="https://github.com/grft-dev/graftcode-gateway/releases/latest/download/gg_linux_amd64.deb"; \
|
|
11
|
+
else \
|
|
12
|
+
GG_URL="https://github.com/grft-dev/graftcode-gateway/releases/download/v${GG_VERSION}/gg_linux_amd64.deb"; \
|
|
13
|
+
fi && \
|
|
14
|
+
curl -fsSL "$GG_URL" -o /tmp/gg.deb && \
|
|
15
|
+
dpkg -i /tmp/gg.deb && \
|
|
16
|
+
rm /tmp/gg.deb
|
|
17
|
+
|
|
18
|
+
WORKDIR /usr/app/host
|
|
19
|
+
|
|
20
|
+
RUN cp "$(command -v gg)" ./gg && chmod +x ./gg
|
|
21
|
+
|
|
22
|
+
# GG's native Ruby launcher requires an explicit path to the shared Ruby runtime.
|
|
23
|
+
ENV HYPERTUBE_RUBY_RUNTIME_PATH=/usr/local/lib/libruby.so
|
|
24
|
+
|
|
25
|
+
COPY . ./module/
|
|
26
|
+
|
|
27
|
+
EXPOSE 80
|
|
28
|
+
EXPOSE 81
|
|
29
|
+
|
|
30
|
+
CMD sh -c './gg --endpoint ${GG_ENDPOINT:-https://d.grft.dev} --modules /usr/app/host/module --runtime ruby ${GG_PROJECT_KEY:+--projectKey $GG_PROJECT_KEY}'
|
data/lib/simple_car.rb
CHANGED
|
@@ -15,7 +15,7 @@ class SimpleCar
|
|
|
15
15
|
# Default number of wheels for a SimpleCar.
|
|
16
16
|
DEFAULT_WHEELS = 4
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
@@total_cars_created = 0
|
|
19
19
|
|
|
20
20
|
class << self
|
|
21
21
|
# Returns how many SimpleCar instances have been constructed.
|
|
@@ -26,7 +26,9 @@ class SimpleCar
|
|
|
26
26
|
# @return [Integer] Total number of cars created since import.
|
|
27
27
|
# @author graftcode
|
|
28
28
|
# @since 0.2.1
|
|
29
|
-
|
|
29
|
+
def total_cars_created
|
|
30
|
+
@@total_cars_created
|
|
31
|
+
end
|
|
30
32
|
|
|
31
33
|
# Creates a car with placeholder make, model, and the current year.
|
|
32
34
|
#
|
|
@@ -77,7 +79,7 @@ class SimpleCar
|
|
|
77
79
|
@is_running = false
|
|
78
80
|
@mileage_history = []
|
|
79
81
|
@tags = []
|
|
80
|
-
|
|
82
|
+
@@total_cars_created += 1
|
|
81
83
|
end
|
|
82
84
|
|
|
83
85
|
# ── properties (Vehicle) ────────────────────────────────────
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdn_test_simple_car
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GraftCode
|
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
|
19
19
|
files:
|
|
20
20
|
- ".rspec"
|
|
21
21
|
- ".rubocop.yml"
|
|
22
|
+
- Dockerfile
|
|
22
23
|
- LICENSE.txt
|
|
23
24
|
- README.md
|
|
24
25
|
- Rakefile
|