warehouse_items 0.3.0 → 1.0.1
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 +5 -5
- data/.github/workflows/publish.yml +121 -0
- data/.github/workflows/test.yml +33 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/CLAUDE.md +9 -0
- data/README.md +8 -8
- data/Rakefile +1 -1
- data/gemfiles/rails_7.2.gemfile +12 -0
- data/gemfiles/rails_7.2.gemfile.lock +55 -0
- data/gemfiles/rails_8.0.gemfile +13 -0
- data/gemfiles/rails_8.0.gemfile.lock +57 -0
- data/lib/warehouse/item/code.rb +17 -3
- data/lib/warehouse/item/random.rb +2 -1
- data/lib/warehouse/version.rb +1 -1
- data/lib/warehouse.rb +6 -4
- data/warehouse_items.gemspec +4 -2
- metadata +16 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2bc9efc00c01a774335a99b71a4c8504436e34a9e5303449484dc269b23de895
|
|
4
|
+
data.tar.gz: 2409ae7f2a164086b1ca78c90550349c685770a9778117589d2fc9e7538f38b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 683817a4ca8139d942aa01ba216640c10604295535720fd21579021f1c9bc77d3151507635f8260eb76875a2ca3a93303aaeb1bea71d13a9f459fe7459f6ef0d
|
|
7
|
+
data.tar.gz: 89f50d9fe3e5af884b58419cd317f243c5e6bc6909fa1b8f6e93cd18d8ec3c79177e3f582adbc0750f37d81ced8052d2a2748e07746949c230c218d9cb6aef50
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Publish gem
|
|
2
|
+
|
|
3
|
+
# master 上 gemspec 版本號尚未發佈到 rubygems.org 時,自動以 Trusted Publishing (OIDC) 發佈。
|
|
4
|
+
# 版本已存在則跳過;不使用任何儲存的 RubyGems API key。
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- master
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: publish-gem-${{ github.repository }}
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
env:
|
|
19
|
+
# 與 test.yml 矩陣中最新的 Ruby 3.4.11 / Rails 8.0 組合一致
|
|
20
|
+
RUBY_VERSION: '3.4.11'
|
|
21
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_8.0.gemfile
|
|
22
|
+
GEM_NAME: warehouse_items
|
|
23
|
+
GEMSPEC: warehouse_items.gemspec
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
check:
|
|
27
|
+
name: Check version on rubygems.org
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
outputs:
|
|
30
|
+
should_publish: ${{ steps.check.outputs.should_publish }}
|
|
31
|
+
gem_name: ${{ steps.spec.outputs.name }}
|
|
32
|
+
gem_version: ${{ steps.spec.outputs.version }}
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
35
|
+
with:
|
|
36
|
+
persist-credentials: false
|
|
37
|
+
|
|
38
|
+
- uses: ruby/setup-ruby@b1da4809b005e0178fe08a1d57317bffc00b7b4c # v1.332.0
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: ${{ env.RUBY_VERSION }}
|
|
41
|
+
|
|
42
|
+
- name: Read gem name and version from gemspec
|
|
43
|
+
id: spec
|
|
44
|
+
run: |
|
|
45
|
+
ruby -e 'spec = Gem::Specification.load(ENV.fetch("GEMSPEC")) or abort("cannot load #{ENV["GEMSPEC"]}"); abort("gemspec name #{spec.name} != #{ENV["GEM_NAME"]}") unless spec.name == ENV["GEM_NAME"]; puts "name=#{spec.name}"; puts "version=#{spec.version}"' >> "$GITHUB_OUTPUT"
|
|
46
|
+
cat "$GITHUB_OUTPUT"
|
|
47
|
+
|
|
48
|
+
- name: Check whether this version already exists on rubygems.org
|
|
49
|
+
id: check
|
|
50
|
+
env:
|
|
51
|
+
GEM_NAME: ${{ steps.spec.outputs.name }}
|
|
52
|
+
GEM_VERSION: ${{ steps.spec.outputs.version }}
|
|
53
|
+
run: |
|
|
54
|
+
set -euo pipefail
|
|
55
|
+
status=$(curl -sS -o versions.json -w '%{http_code}' "https://rubygems.org/api/v1/versions/${GEM_NAME}.json")
|
|
56
|
+
if [ "$status" = "404" ]; then
|
|
57
|
+
echo "Gem ${GEM_NAME} not found on rubygems.org; will publish."
|
|
58
|
+
echo "should_publish=true" >> "$GITHUB_OUTPUT"
|
|
59
|
+
exit 0
|
|
60
|
+
fi
|
|
61
|
+
if [ "$status" != "200" ]; then
|
|
62
|
+
echo "::error::rubygems.org API returned HTTP ${status}"
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
if jq -e --arg v "$GEM_VERSION" 'any(.[]; .number == $v)' versions.json > /dev/null; then
|
|
66
|
+
echo "${GEM_NAME} ${GEM_VERSION} already on rubygems.org; skip publish."
|
|
67
|
+
echo "should_publish=false" >> "$GITHUB_OUTPUT"
|
|
68
|
+
else
|
|
69
|
+
echo "${GEM_NAME} ${GEM_VERSION} not on rubygems.org yet; will publish."
|
|
70
|
+
echo "should_publish=true" >> "$GITHUB_OUTPUT"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
test:
|
|
74
|
+
name: Test (Ruby 3.4 / Rails 8.0)
|
|
75
|
+
needs: check
|
|
76
|
+
if: needs.check.outputs.should_publish == 'true'
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
80
|
+
with:
|
|
81
|
+
persist-credentials: false
|
|
82
|
+
|
|
83
|
+
- uses: ruby/setup-ruby@b1da4809b005e0178fe08a1d57317bffc00b7b4c # v1.332.0
|
|
84
|
+
with:
|
|
85
|
+
ruby-version: ${{ env.RUBY_VERSION }}
|
|
86
|
+
bundler-cache: true
|
|
87
|
+
|
|
88
|
+
- run: bundle exec rake t
|
|
89
|
+
|
|
90
|
+
publish:
|
|
91
|
+
name: Publish ${{ needs.check.outputs.gem_name }} ${{ needs.check.outputs.gem_version }}
|
|
92
|
+
needs: [check, test]
|
|
93
|
+
if: needs.check.outputs.should_publish == 'true' && github.ref == 'refs/heads/master'
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
environment: gem-publish
|
|
96
|
+
permissions:
|
|
97
|
+
id-token: write # Trusted Publishing (OIDC)
|
|
98
|
+
contents: write # rake release 推送 vX.Y.Z tag
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
101
|
+
with:
|
|
102
|
+
persist-credentials: false
|
|
103
|
+
|
|
104
|
+
- uses: ruby/setup-ruby@b1da4809b005e0178fe08a1d57317bffc00b7b4c # v1.332.0
|
|
105
|
+
with:
|
|
106
|
+
ruby-version: ${{ env.RUBY_VERSION }}
|
|
107
|
+
bundler-cache: true
|
|
108
|
+
|
|
109
|
+
# setup-ruby 的 bundler-cache 會把 BUNDLE_PATH 等設定寫進 .bundle/config,
|
|
110
|
+
# 若該檔被 git 追蹤,rake release 的 guard_clean 會判定工作目錄不乾淨。
|
|
111
|
+
# 目前此 repo 沒有追蹤任何 .bundle/config;這一步對「有追蹤才標記」做容錯處理,
|
|
112
|
+
# 日後若加入 gemfiles/.bundle/config 或 .bundle/config 也不會讓發佈失敗。
|
|
113
|
+
- name: Ignore CI-only bundler config change
|
|
114
|
+
run: |
|
|
115
|
+
git status --porcelain
|
|
116
|
+
git ls-files -z '*.bundle/config' | xargs -0 -r git update-index --assume-unchanged
|
|
117
|
+
git status --porcelain
|
|
118
|
+
|
|
119
|
+
# 透過 rubygems/configure-rubygems-credentials 取得短效 OIDC token,
|
|
120
|
+
# 再執行 bundle exec rake release(build、建立並推送 vX.Y.Z tag、push gem)
|
|
121
|
+
- uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master, main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
include:
|
|
16
|
+
- ruby: "3.3.12"
|
|
17
|
+
gemfile: gemfiles/rails_7.2.gemfile
|
|
18
|
+
- ruby: "3.3.12"
|
|
19
|
+
gemfile: gemfiles/rails_8.0.gemfile
|
|
20
|
+
- ruby: "3.4.11"
|
|
21
|
+
gemfile: gemfiles/rails_7.2.gemfile
|
|
22
|
+
- ruby: "3.4.11"
|
|
23
|
+
gemfile: gemfiles/rails_8.0.gemfile
|
|
24
|
+
env:
|
|
25
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: ruby/setup-ruby@v1
|
|
29
|
+
with:
|
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
|
31
|
+
bundler-cache: true
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: bundle exec rake t
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.6.7
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## 發版規則(Ruby gem)
|
|
4
|
+
|
|
5
|
+
- 這個 gem(`warehouse_items`,gemspec:`warehouse_items.gemspec`)在 master 收到「新版本號」時,由 GitHub Actions(`.github/workflows/publish.yml`)自動發佈到 rubygems.org(Trusted Publishing,不使用 API key)。
|
|
6
|
+
- **每一個 PR 都必須跳版號**(改 `lib/warehouse/version.rb`),除非這個 PR 只改文件、CI 或 CLAUDE.md 且明確不需要發版。沒跳版號的 PR 合進 master 後不會發佈。
|
|
7
|
+
- 跳版規則(Semantic Versioning):修 bug 跳 patch(x.y.Z);新增相容功能跳 minor(x.Y.0);不相容變更跳 major(X.0.0)。
|
|
8
|
+
- 版號只改在 PR 裡。AI 帳號只能開 branch 與 PR,不得合併到 master;只有真人帳號可以合併。合併就等於批准發佈。
|
|
9
|
+
- 不得為了讓測試通過而改變程式原本的行為。
|
data/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# Warehouse::Item
|
|
2
2
|
|
|
3
3
|
```ruby
|
|
4
|
-
@item1 = Warehouse::Item.new('迷黑', '迷黑', 3, 250)
|
|
4
|
+
@item1 = Warehouse::Item::Code.new('迷黑', '迷黑', 3, 250)
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
# Warehouse::Random
|
|
8
8
|
|
|
9
9
|
```ruby
|
|
10
|
-
@item1 = Warehouse::Item.new('迷黑', '迷黑', nil, 250)
|
|
11
|
-
@item2 = Warehouse::Item.new('迷黃', '迷黃', nil, 250)
|
|
12
|
-
@item3 = Warehouse::Item.new('迷綠', '迷綠', nil, 250)
|
|
13
|
-
@random_item = Warehouse::Random.new([@item1, @item2, @item3], 4)
|
|
10
|
+
@item1 = Warehouse::Item::Code.new('迷黑', '迷黑', nil, 250)
|
|
11
|
+
@item2 = Warehouse::Item::Code.new('迷黃', '迷黃', nil, 250)
|
|
12
|
+
@item3 = Warehouse::Item::Code.new('迷綠', '迷綠', nil, 250)
|
|
13
|
+
@random_item = Warehouse::Item::Random.new([@item1, @item2, @item3], 4)
|
|
14
14
|
@list = @random_item.fetch! # (Warehouse::List)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
# Warehouse::List
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
@item1 = Warehouse::Item.new('迷黑', '迷黑', 1, 250)
|
|
21
|
-
@item2 = Warehouse::Item.new('迷黃', '迷黃', 1, 250)
|
|
22
|
-
@item3 = Warehouse::Item.new('迷綠', '迷綠', 1, 250)
|
|
20
|
+
@item1 = Warehouse::Item::Code.new('迷黑', '迷黑', 1, 250)
|
|
21
|
+
@item2 = Warehouse::Item::Code.new('迷黃', '迷黃', 1, 250)
|
|
22
|
+
@item3 = Warehouse::Item::Code.new('迷綠', '迷綠', 1, 250)
|
|
23
23
|
@list = Warehouse::List.new([@item1, @item2, @item3])
|
|
24
24
|
|
|
25
25
|
# 所有數量變兩倍 (會解壓縮 RandomItem)
|
data/Rakefile
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
warehouse_items (1.0.1)
|
|
5
|
+
activesupport
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activesupport (7.2.3.2)
|
|
11
|
+
base64
|
|
12
|
+
benchmark (>= 0.3)
|
|
13
|
+
bigdecimal
|
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
15
|
+
connection_pool (>= 2.2.5)
|
|
16
|
+
drb
|
|
17
|
+
i18n (>= 1.6, < 2)
|
|
18
|
+
logger (>= 1.4.2)
|
|
19
|
+
minitest (>= 5.1, < 6)
|
|
20
|
+
securerandom (>= 0.3)
|
|
21
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
22
|
+
base64 (0.3.0)
|
|
23
|
+
benchmark (0.5.0)
|
|
24
|
+
bigdecimal (4.1.3)
|
|
25
|
+
concurrent-ruby (1.3.8)
|
|
26
|
+
connection_pool (3.0.2)
|
|
27
|
+
drb (2.2.3)
|
|
28
|
+
i18n (1.15.2)
|
|
29
|
+
concurrent-ruby (~> 1.0)
|
|
30
|
+
logger (1.7.0)
|
|
31
|
+
minitest (5.27.0)
|
|
32
|
+
mutex_m (0.3.0)
|
|
33
|
+
rake (13.4.2)
|
|
34
|
+
securerandom (0.4.1)
|
|
35
|
+
shoulda-context (2.0.0)
|
|
36
|
+
tzinfo (2.0.6)
|
|
37
|
+
concurrent-ruby (~> 1.0)
|
|
38
|
+
|
|
39
|
+
PLATFORMS
|
|
40
|
+
ruby
|
|
41
|
+
x86_64-linux
|
|
42
|
+
|
|
43
|
+
DEPENDENCIES
|
|
44
|
+
activesupport (~> 7.2.0)
|
|
45
|
+
bigdecimal
|
|
46
|
+
bundler (>= 1.16)
|
|
47
|
+
logger
|
|
48
|
+
minitest (~> 5.0)
|
|
49
|
+
mutex_m
|
|
50
|
+
rake (>= 13, >= 10.0)
|
|
51
|
+
shoulda-context
|
|
52
|
+
warehouse_items!
|
|
53
|
+
|
|
54
|
+
BUNDLED WITH
|
|
55
|
+
2.7.2
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
source "https://rubygems.org"
|
|
3
|
+
|
|
4
|
+
gemspec path: ".."
|
|
5
|
+
|
|
6
|
+
# Target Rails 8.0.5.1 ActiveSupport (8.1.3.1 also exists on RubyGems)
|
|
7
|
+
gem "activesupport", "8.0.5.1"
|
|
8
|
+
gem "rake", ">= 13"
|
|
9
|
+
gem "minitest", "~> 5.0"
|
|
10
|
+
gem "shoulda-context"
|
|
11
|
+
gem "logger"
|
|
12
|
+
gem "mutex_m"
|
|
13
|
+
gem "bigdecimal"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
warehouse_items (1.0.1)
|
|
5
|
+
activesupport
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activesupport (8.0.5.1)
|
|
11
|
+
base64
|
|
12
|
+
benchmark (>= 0.3)
|
|
13
|
+
bigdecimal
|
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
15
|
+
connection_pool (>= 2.2.5)
|
|
16
|
+
drb
|
|
17
|
+
i18n (>= 1.6, < 2)
|
|
18
|
+
logger (>= 1.4.2)
|
|
19
|
+
minitest (>= 5.1)
|
|
20
|
+
securerandom (>= 0.3)
|
|
21
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
22
|
+
uri (>= 0.13.1)
|
|
23
|
+
base64 (0.3.0)
|
|
24
|
+
benchmark (0.5.0)
|
|
25
|
+
bigdecimal (4.1.3)
|
|
26
|
+
concurrent-ruby (1.3.8)
|
|
27
|
+
connection_pool (3.0.2)
|
|
28
|
+
drb (2.2.3)
|
|
29
|
+
i18n (1.15.2)
|
|
30
|
+
concurrent-ruby (~> 1.0)
|
|
31
|
+
logger (1.7.0)
|
|
32
|
+
minitest (5.27.0)
|
|
33
|
+
mutex_m (0.3.0)
|
|
34
|
+
rake (13.4.2)
|
|
35
|
+
securerandom (0.4.1)
|
|
36
|
+
shoulda-context (2.0.0)
|
|
37
|
+
tzinfo (2.0.6)
|
|
38
|
+
concurrent-ruby (~> 1.0)
|
|
39
|
+
uri (1.1.1)
|
|
40
|
+
|
|
41
|
+
PLATFORMS
|
|
42
|
+
ruby
|
|
43
|
+
x86_64-linux
|
|
44
|
+
|
|
45
|
+
DEPENDENCIES
|
|
46
|
+
activesupport (= 8.0.5.1)
|
|
47
|
+
bigdecimal
|
|
48
|
+
bundler (>= 1.16)
|
|
49
|
+
logger
|
|
50
|
+
minitest (~> 5.0)
|
|
51
|
+
mutex_m
|
|
52
|
+
rake (>= 13, >= 10.0)
|
|
53
|
+
shoulda-context
|
|
54
|
+
warehouse_items!
|
|
55
|
+
|
|
56
|
+
BUNDLED WITH
|
|
57
|
+
2.7.2
|
data/lib/warehouse/item/code.rb
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
module Warehouse
|
|
2
2
|
module Item
|
|
3
|
-
Code = Struct.new(:code, :title, :qty, :price) do
|
|
3
|
+
Code = Struct.new(:code, :title, :qty, :price, :barcode, :code_2, :title_en) do
|
|
4
|
+
|
|
5
|
+
def self.build(fragment)
|
|
6
|
+
qty = fragment["qty"].nil? ? 0 : fragment["qty"].to_i
|
|
7
|
+
Code.new(fragment["code"], fragment["title"], qty, fragment["price"].to_i,
|
|
8
|
+
fragment["barcode"], fragment["code_2"], fragment["title_en"])
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def is_free?
|
|
12
|
+
price == 0
|
|
13
|
+
end
|
|
4
14
|
|
|
5
15
|
def barcode?
|
|
6
16
|
false
|
|
@@ -26,12 +36,16 @@ module Warehouse
|
|
|
26
36
|
{
|
|
27
37
|
'code' => code,
|
|
28
38
|
'title' => title,
|
|
29
|
-
'qty' => qty
|
|
39
|
+
'qty' => qty,
|
|
40
|
+
'price' => price,
|
|
41
|
+
'barcode' => barcode,
|
|
42
|
+
'code_2' => code_2,
|
|
43
|
+
'title_en' => title_en
|
|
30
44
|
}
|
|
31
45
|
end
|
|
32
46
|
|
|
33
47
|
def deep_dup
|
|
34
|
-
self.class.new(code, title, qty, price)
|
|
48
|
+
self.class.new(code, title, qty, price, barcode, code_2, title_en)
|
|
35
49
|
end
|
|
36
50
|
|
|
37
51
|
# 給 form 用的
|
|
@@ -23,7 +23,8 @@ module Warehouse
|
|
|
23
23
|
random_items = {}
|
|
24
24
|
(1..qty).each do
|
|
25
25
|
item = items.sample
|
|
26
|
-
random_items[item.code] ||= Warehouse::Item::Code.new(item.code, item.title, 0, item.price
|
|
26
|
+
random_items[item.code] ||= Warehouse::Item::Code.new(item.code, item.title, 0, item.price,
|
|
27
|
+
item.barcode, item.code_2, item.title_en)
|
|
27
28
|
random_items[item.code].qty += 1
|
|
28
29
|
end
|
|
29
30
|
Warehouse::List.new(random_items.values)
|
data/lib/warehouse/version.rb
CHANGED
data/lib/warehouse.rb
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
require "warehouse/version"
|
|
2
|
-
require
|
|
3
|
-
require
|
|
4
|
-
require
|
|
2
|
+
require "active_support"
|
|
3
|
+
require "active_support/core_ext/object"
|
|
4
|
+
require "active_support/core_ext/object/blank"
|
|
5
|
+
require "active_support/core_ext/module/delegation"
|
|
6
|
+
require "active_support/core_ext/class"
|
|
5
7
|
require "warehouse/item/code"
|
|
6
8
|
require "warehouse/item/barcode"
|
|
7
9
|
require "warehouse/item/random"
|
|
8
10
|
require "warehouse/list"
|
|
9
11
|
|
|
10
12
|
module Warehouse
|
|
11
|
-
|
|
13
|
+
|
|
12
14
|
end
|
data/warehouse_items.gemspec
CHANGED
|
@@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.homepage = "https://github.com/superlanding/warehouse_items"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
|
+
spec.required_ruby_version = ">= 2.7"
|
|
18
|
+
|
|
17
19
|
# Specify which files should be added to the gem when it is released.
|
|
18
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
19
21
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
@@ -23,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
|
23
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
26
|
spec.require_paths = ["lib"]
|
|
25
27
|
|
|
26
|
-
spec.add_development_dependency "bundler", "
|
|
27
|
-
spec.add_development_dependency "rake", "
|
|
28
|
+
spec.add_development_dependency "bundler", ">= 1.16"
|
|
29
|
+
spec.add_development_dependency "rake", ">= 10.0"
|
|
28
30
|
spec.add_development_dependency "minitest", "~> 5.0"
|
|
29
31
|
spec.add_development_dependency "shoulda-context"
|
|
30
32
|
|
metadata
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: warehouse_items
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eddie Li
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
18
|
version: '1.16'
|
|
20
19
|
type: :development
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
|
-
- - "
|
|
23
|
+
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '1.16'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: rake
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
|
-
- - "
|
|
30
|
+
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
32
|
version: '10.0'
|
|
34
33
|
type: :development
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
|
-
- - "
|
|
37
|
+
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '10.0'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
@@ -87,8 +86,12 @@ executables: []
|
|
|
87
86
|
extensions: []
|
|
88
87
|
extra_rdoc_files: []
|
|
89
88
|
files:
|
|
89
|
+
- ".github/workflows/publish.yml"
|
|
90
|
+
- ".github/workflows/test.yml"
|
|
90
91
|
- ".gitignore"
|
|
92
|
+
- ".ruby-version"
|
|
91
93
|
- ".travis.yml"
|
|
94
|
+
- CLAUDE.md
|
|
92
95
|
- Gemfile
|
|
93
96
|
- Gemfile.lock
|
|
94
97
|
- LICENSE.txt
|
|
@@ -96,6 +99,10 @@ files:
|
|
|
96
99
|
- Rakefile
|
|
97
100
|
- bin/console
|
|
98
101
|
- bin/setup
|
|
102
|
+
- gemfiles/rails_7.2.gemfile
|
|
103
|
+
- gemfiles/rails_7.2.gemfile.lock
|
|
104
|
+
- gemfiles/rails_8.0.gemfile
|
|
105
|
+
- gemfiles/rails_8.0.gemfile.lock
|
|
99
106
|
- lib/warehouse.rb
|
|
100
107
|
- lib/warehouse/item/barcode.rb
|
|
101
108
|
- lib/warehouse/item/code.rb
|
|
@@ -107,7 +114,6 @@ homepage: https://github.com/superlanding/warehouse_items
|
|
|
107
114
|
licenses:
|
|
108
115
|
- MIT
|
|
109
116
|
metadata: {}
|
|
110
|
-
post_install_message:
|
|
111
117
|
rdoc_options: []
|
|
112
118
|
require_paths:
|
|
113
119
|
- lib
|
|
@@ -115,16 +121,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
121
|
requirements:
|
|
116
122
|
- - ">="
|
|
117
123
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: '
|
|
124
|
+
version: '2.7'
|
|
119
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
126
|
requirements:
|
|
121
127
|
- - ">="
|
|
122
128
|
- !ruby/object:Gem::Version
|
|
123
129
|
version: '0'
|
|
124
130
|
requirements: []
|
|
125
|
-
|
|
126
|
-
rubygems_version: 2.4.8
|
|
127
|
-
signing_key:
|
|
131
|
+
rubygems_version: 3.6.9
|
|
128
132
|
specification_version: 4
|
|
129
133
|
summary: warehouse_items wrapper & value objects
|
|
130
134
|
test_files: []
|