export_to 1.1.0 → 1.1.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 +4 -4
- data/.github/workflows/ci.yml +51 -0
- data/Gemfile.lock +14 -10
- data/README.md +23 -0
- data/Rakefile +2 -1
- data/TESTING.md +103 -0
- data/bin/check_dependencies +58 -0
- data/bin/test_all +147 -0
- data/export_to.gemspec +6 -4
- data/gemfiles/ruby_2.7_rails_6.1.gemfile +10 -0
- data/gemfiles/ruby_2.7_rails_6.1.gemfile.lock +97 -0
- data/gemfiles/ruby_3.0_rails_6.1.gemfile +10 -0
- data/gemfiles/ruby_3.0_rails_6.1.gemfile.lock +97 -0
- data/gemfiles/ruby_3.0_rails_7.0.gemfile +10 -0
- data/gemfiles/ruby_3.0_rails_7.0.gemfile.lock +110 -0
- data/gemfiles/ruby_3.1_rails_6.1.gemfile +10 -0
- data/gemfiles/ruby_3.1_rails_6.1.gemfile.lock +98 -0
- data/gemfiles/ruby_3.1_rails_7.0.gemfile +10 -0
- data/gemfiles/ruby_3.1_rails_7.0.gemfile.lock +111 -0
- data/gemfiles/ruby_3.1_rails_7.1.gemfile +10 -0
- data/gemfiles/ruby_3.1_rails_7.1.gemfile.lock +147 -0
- data/lib/export_to/version.rb +1 -1
- data/lib/export_to.rb +2 -1
- metadata +38 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf9f0cd80c4fa564029d94c86d2df2cc7030c28b1305657a8c6efda5233de2f6
|
|
4
|
+
data.tar.gz: b40897b740a7b078ab5f85f66aa223144432b47243fd1ad134c8771f151cb398
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46f44c6c9159363c9480f1bed24a77dd95924f6350ea54c90cb918031649450becaa08e605fdfe1b4e35453688d94f760c6d2336d48e5983715c0a2c8ed3ec86
|
|
7
|
+
data.tar.gz: 8c3243652282cdf29152bb43885f194406697998343390e9f1d522b31208525f4baf6c9276abab5749d1305d75240571fdcbaa53bc0a4ff882186f56b0ef461d
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
include:
|
|
16
|
+
- ruby: '2.7'
|
|
17
|
+
rails: '6.1'
|
|
18
|
+
- ruby: '3.0'
|
|
19
|
+
rails: '6.1'
|
|
20
|
+
- ruby: '3.0'
|
|
21
|
+
rails: '7.0'
|
|
22
|
+
- ruby: '3.1'
|
|
23
|
+
rails: '6.1'
|
|
24
|
+
- ruby: '3.1'
|
|
25
|
+
rails: '7.0'
|
|
26
|
+
- ruby: '3.1'
|
|
27
|
+
rails: '7.1'
|
|
28
|
+
|
|
29
|
+
env:
|
|
30
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/ruby_${{ matrix.ruby }}_rails_${{ matrix.rails }}.gemfile
|
|
31
|
+
|
|
32
|
+
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
|
|
33
|
+
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
|
38
|
+
uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: ${{ matrix.ruby }}
|
|
41
|
+
bundler-cache: true
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: |
|
|
45
|
+
bundle install --jobs 4 --retry 3
|
|
46
|
+
|
|
47
|
+
- name: Run tests
|
|
48
|
+
run: bundle exec rake test
|
|
49
|
+
|
|
50
|
+
- name: Check dependency compatibility
|
|
51
|
+
run: bundle outdated --strict || true
|
data/Gemfile.lock
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
export_to (1.
|
|
5
|
-
activesupport (>= 6, <
|
|
6
|
-
fast_excel
|
|
7
|
-
iconv
|
|
8
|
-
spreadsheet
|
|
4
|
+
export_to (1.1.1)
|
|
5
|
+
activesupport (>= 6.0, < 8)
|
|
6
|
+
fast_excel (~> 0.4)
|
|
7
|
+
iconv (~> 1.0)
|
|
8
|
+
spreadsheet (~> 1.3)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
@@ -29,16 +29,18 @@ GEM
|
|
|
29
29
|
minitest (>= 5.1)
|
|
30
30
|
tzinfo (~> 2.0)
|
|
31
31
|
zeitwerk (~> 2.3)
|
|
32
|
+
bigdecimal (4.0.1)
|
|
32
33
|
builder (3.2.4)
|
|
33
34
|
concurrent-ruby (1.2.0)
|
|
34
35
|
crass (1.0.6)
|
|
35
36
|
erubi (1.12.0)
|
|
36
|
-
fast_excel (0.
|
|
37
|
+
fast_excel (0.5.0)
|
|
37
38
|
ffi (> 1.9, < 2)
|
|
38
|
-
ffi (1.
|
|
39
|
+
ffi (1.17.3)
|
|
39
40
|
i18n (1.12.0)
|
|
40
41
|
concurrent-ruby (~> 1.0)
|
|
41
|
-
iconv (1.
|
|
42
|
+
iconv (1.1.1)
|
|
43
|
+
logger (1.7.0)
|
|
42
44
|
loofah (2.19.1)
|
|
43
45
|
crass (~> 1.0.2)
|
|
44
46
|
nokogiri (>= 1.5.9)
|
|
@@ -64,9 +66,11 @@ GEM
|
|
|
64
66
|
rake (>= 12.2)
|
|
65
67
|
thor (~> 1.0)
|
|
66
68
|
rake (13.0.6)
|
|
67
|
-
ruby-ole (1.2.
|
|
69
|
+
ruby-ole (1.2.13.1)
|
|
68
70
|
shoulda-context (1.2.2)
|
|
69
|
-
spreadsheet (1.3.
|
|
71
|
+
spreadsheet (1.3.4)
|
|
72
|
+
bigdecimal
|
|
73
|
+
logger
|
|
70
74
|
ruby-ole
|
|
71
75
|
thor (1.2.1)
|
|
72
76
|
tzinfo (2.0.6)
|
data/README.md
CHANGED
|
@@ -24,10 +24,33 @@ Or install it yourself as:
|
|
|
24
24
|
|
|
25
25
|
TODO: Write usage instructions here
|
|
26
26
|
|
|
27
|
+
## Ruby & Rails Version Support
|
|
28
|
+
|
|
29
|
+
This gem supports:
|
|
30
|
+
- Ruby 2.7 with Rails 6.1
|
|
31
|
+
- Ruby 3.0 with Rails 6.1, 7.0
|
|
32
|
+
- Ruby 3.1 with Rails 6.1, 7.0, 7.1
|
|
33
|
+
|
|
27
34
|
## Development
|
|
28
35
|
|
|
29
36
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
37
|
|
|
38
|
+
### Testing Multiple Ruby Versions
|
|
39
|
+
|
|
40
|
+
To test against all supported Ruby versions at once:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bin/test_all
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
To check dependency compatibility:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bin/check_dependencies
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
For more detailed testing instructions, see [TESTING.md](TESTING.md).
|
|
53
|
+
|
|
31
54
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
55
|
|
|
33
56
|
## Contributing
|
data/Rakefile
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
require "bundler/gem_tasks"
|
|
2
2
|
require "rake/testtask"
|
|
3
3
|
|
|
4
|
-
Rake::TestTask.new(:
|
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
|
5
5
|
t.libs << "test"
|
|
6
6
|
t.libs << "lib"
|
|
7
7
|
t.test_files = FileList["test/**/*_test.rb"]
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
task :t => :test
|
|
10
11
|
task :default => :test
|
data/TESTING.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Testing Guide
|
|
2
|
+
|
|
3
|
+
This gem supports multiple Ruby and Rails versions:
|
|
4
|
+
- Ruby 2.7 with Rails 6.1
|
|
5
|
+
- Ruby 3.0 with Rails 6.1, 7.0
|
|
6
|
+
- Ruby 3.1 with Rails 6.1, 7.0, 7.1
|
|
7
|
+
|
|
8
|
+
## Multi-Version Testing
|
|
9
|
+
|
|
10
|
+
### Local Testing
|
|
11
|
+
|
|
12
|
+
#### Test all Ruby versions at once
|
|
13
|
+
|
|
14
|
+
Run the test suite against all supported Ruby versions:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bin/test_all
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This script will:
|
|
21
|
+
- Automatically switch between Ruby versions (requires rbenv or rvm)
|
|
22
|
+
- Install dependencies for each version
|
|
23
|
+
- Run the test suite for each version
|
|
24
|
+
- Display a summary of results
|
|
25
|
+
|
|
26
|
+
#### Test a specific Ruby/Rails version combination
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Ruby 2.7 with Rails 6.1
|
|
30
|
+
export BUNDLE_GEMFILE=gemfiles/ruby_2.7_rails_6.1.gemfile
|
|
31
|
+
bundle install
|
|
32
|
+
bundle exec rake test
|
|
33
|
+
|
|
34
|
+
# Ruby 3.0 with Rails 6.1
|
|
35
|
+
export BUNDLE_GEMFILE=gemfiles/ruby_3.0_rails_6.1.gemfile
|
|
36
|
+
bundle install
|
|
37
|
+
bundle exec rake test
|
|
38
|
+
|
|
39
|
+
# Ruby 3.0 with Rails 7.0
|
|
40
|
+
export BUNDLE_GEMFILE=gemfiles/ruby_3.0_rails_7.0.gemfile
|
|
41
|
+
bundle install
|
|
42
|
+
bundle exec rake test
|
|
43
|
+
|
|
44
|
+
# Ruby 3.1 with Rails 7.1
|
|
45
|
+
export BUNDLE_GEMFILE=gemfiles/ruby_3.1_rails_7.1.gemfile
|
|
46
|
+
bundle install
|
|
47
|
+
bundle exec rake test
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Dependency Checking
|
|
51
|
+
|
|
52
|
+
Check if all dependencies are compatible with all Ruby versions:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
bin/check_dependencies
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This script will verify that all dependencies can be installed and will report any outdated gems.
|
|
59
|
+
|
|
60
|
+
## CI/CD
|
|
61
|
+
|
|
62
|
+
The gem uses GitHub Actions for continuous integration. Every push and pull request will automatically test against all supported combinations:
|
|
63
|
+
- Ruby 2.7 / Rails 6.1
|
|
64
|
+
- Ruby 3.0 / Rails 6.1, 7.0
|
|
65
|
+
- Ruby 3.1 / Rails 6.1, 7.0, 7.1
|
|
66
|
+
|
|
67
|
+
See `.github/workflows/ci.yml` for the full configuration.
|
|
68
|
+
|
|
69
|
+
## Gemfiles Structure
|
|
70
|
+
|
|
71
|
+
The `gemfiles/` directory contains version-specific Gemfiles for each Ruby/Rails combination:
|
|
72
|
+
- `ruby_2.7_rails_6.1.gemfile` - Ruby 2.7 with Rails 6.1
|
|
73
|
+
- `ruby_3.0_rails_6.1.gemfile` - Ruby 3.0 with Rails 6.1
|
|
74
|
+
- `ruby_3.0_rails_7.0.gemfile` - Ruby 3.0 with Rails 7.0
|
|
75
|
+
- `ruby_3.1_rails_6.1.gemfile` - Ruby 3.1 with Rails 6.1
|
|
76
|
+
- `ruby_3.1_rails_7.0.gemfile` - Ruby 3.1 with Rails 7.0
|
|
77
|
+
- `ruby_3.1_rails_7.1.gemfile` - Ruby 3.1 with Rails 7.1
|
|
78
|
+
|
|
79
|
+
Each gemfile has its own lockfile committed to the repository to ensure consistent dependency versions across environments.
|
|
80
|
+
|
|
81
|
+
## Requirements
|
|
82
|
+
|
|
83
|
+
### For Local Multi-Version Testing
|
|
84
|
+
|
|
85
|
+
You need either:
|
|
86
|
+
- **rbenv** with Ruby 2.7, 3.0, and 3.1 installed
|
|
87
|
+
- **rvm** with Ruby 2.7, 3.0, and 3.1 installed
|
|
88
|
+
|
|
89
|
+
### Installing Ruby Versions
|
|
90
|
+
|
|
91
|
+
#### Using rbenv:
|
|
92
|
+
```bash
|
|
93
|
+
rbenv install 2.7.8
|
|
94
|
+
rbenv install 3.0.6
|
|
95
|
+
rbenv install 3.1.4
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Using rvm:
|
|
99
|
+
```bash
|
|
100
|
+
rvm install 2.7.8
|
|
101
|
+
rvm install 3.0.6
|
|
102
|
+
rvm install 3.1.4
|
|
103
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Script to check if all dependencies support multiple Ruby and Rails versions
|
|
4
|
+
|
|
5
|
+
require 'open3'
|
|
6
|
+
require 'json'
|
|
7
|
+
|
|
8
|
+
TEST_MATRIX = [
|
|
9
|
+
{ ruby: '2.7', rails: '6.1' },
|
|
10
|
+
{ ruby: '3.0', rails: '6.1' },
|
|
11
|
+
{ ruby: '3.0', rails: '7.0' },
|
|
12
|
+
{ ruby: '3.1', rails: '6.1' },
|
|
13
|
+
{ ruby: '3.1', rails: '7.0' },
|
|
14
|
+
{ ruby: '3.1', rails: '7.1' }
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
puts "=" * 80
|
|
18
|
+
puts "Checking dependency compatibility"
|
|
19
|
+
puts "=" * 80
|
|
20
|
+
puts
|
|
21
|
+
|
|
22
|
+
TEST_MATRIX.each do |test|
|
|
23
|
+
gemfile = "gemfiles/ruby_#{test[:ruby]}_rails_#{test[:rails]}.gemfile"
|
|
24
|
+
|
|
25
|
+
puts "\n#{'-' * 80}"
|
|
26
|
+
puts "Checking Ruby #{test[:ruby]} / Rails #{test[:rails]}"
|
|
27
|
+
puts "Gemfile: #{gemfile}"
|
|
28
|
+
puts '-' * 80
|
|
29
|
+
|
|
30
|
+
unless File.exist?(gemfile)
|
|
31
|
+
puts "✗ Gemfile not found"
|
|
32
|
+
next
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
36
|
+
|
|
37
|
+
stdout, stderr, status = Open3.capture3("bundle install --quiet")
|
|
38
|
+
|
|
39
|
+
if status.success?
|
|
40
|
+
puts "✓ Bundle install successful"
|
|
41
|
+
|
|
42
|
+
# Check for outdated dependencies
|
|
43
|
+
stdout, stderr, status = Open3.capture3("bundle outdated")
|
|
44
|
+
if stdout.strip.empty?
|
|
45
|
+
puts "✓ All dependencies are up to date"
|
|
46
|
+
else
|
|
47
|
+
puts "\nOutdated dependencies:"
|
|
48
|
+
puts stdout
|
|
49
|
+
end
|
|
50
|
+
else
|
|
51
|
+
puts "✗ Bundle install failed"
|
|
52
|
+
puts stderr
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
puts "\n" + "=" * 80
|
|
57
|
+
puts "Dependency check completed"
|
|
58
|
+
puts "=" * 80
|
data/bin/test_all
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Script to test the gem against multiple Ruby and Rails versions locally
|
|
4
|
+
# Requires: rbenv or rvm to switch Ruby versions
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Define test matrix: ruby_version:rails_version
|
|
9
|
+
TEST_MATRIX=(
|
|
10
|
+
"2.7.6:6.1"
|
|
11
|
+
"3.0.7:6.1"
|
|
12
|
+
"3.0.7:7.0"
|
|
13
|
+
"3.1.7:6.1"
|
|
14
|
+
"3.1.7:7.0"
|
|
15
|
+
"3.1.7:7.1"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
19
|
+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
20
|
+
|
|
21
|
+
# Color output
|
|
22
|
+
RED='\033[0;31m'
|
|
23
|
+
GREEN='\033[0;32m'
|
|
24
|
+
YELLOW='\033[1;33m'
|
|
25
|
+
BLUE='\033[0;34m'
|
|
26
|
+
NC='\033[0m' # No Color
|
|
27
|
+
|
|
28
|
+
echo "========================================================================"
|
|
29
|
+
echo "Testing export_to gem against multiple Ruby & Rails versions"
|
|
30
|
+
echo "========================================================================"
|
|
31
|
+
echo ""
|
|
32
|
+
|
|
33
|
+
# Check if rbenv or rvm is available
|
|
34
|
+
if command -v rbenv &> /dev/null; then
|
|
35
|
+
RUBY_MANAGER="rbenv"
|
|
36
|
+
echo "Using rbenv for Ruby version management"
|
|
37
|
+
elif command -v rvm &> /dev/null; then
|
|
38
|
+
RUBY_MANAGER="rvm"
|
|
39
|
+
echo "Using rvm for Ruby version management"
|
|
40
|
+
else
|
|
41
|
+
echo -e "${RED}Error: Neither rbenv nor rvm found. Please install one of them.${NC}"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo ""
|
|
46
|
+
|
|
47
|
+
# Track results
|
|
48
|
+
PASSED=0
|
|
49
|
+
FAILED=0
|
|
50
|
+
FAILED_TESTS=()
|
|
51
|
+
|
|
52
|
+
for test_case in "${TEST_MATRIX[@]}"; do
|
|
53
|
+
# Split ruby version and rails version
|
|
54
|
+
ruby_version="${test_case%%:*}"
|
|
55
|
+
rails_version="${test_case##*:}"
|
|
56
|
+
|
|
57
|
+
echo "------------------------------------------------------------------------"
|
|
58
|
+
echo -e "${YELLOW}Testing with Ruby ${ruby_version} / Rails ${rails_version}${NC}"
|
|
59
|
+
echo "------------------------------------------------------------------------"
|
|
60
|
+
|
|
61
|
+
# Set Ruby version
|
|
62
|
+
if [ "$RUBY_MANAGER" == "rbenv" ]; then
|
|
63
|
+
if ! rbenv versions | grep -q "^[* ]*${ruby_version}"; then
|
|
64
|
+
echo -e "${RED}Ruby ${ruby_version} not installed in rbenv. Skipping...${NC}"
|
|
65
|
+
FAILED=$((FAILED + 1))
|
|
66
|
+
FAILED_TESTS+=("Ruby ${ruby_version} / Rails ${rails_version} (Ruby not installed)")
|
|
67
|
+
continue
|
|
68
|
+
fi
|
|
69
|
+
export RBENV_VERSION="${ruby_version}"
|
|
70
|
+
elif [ "$RUBY_MANAGER" == "rvm" ]; then
|
|
71
|
+
if ! rvm list | grep -q "ruby-${ruby_version}"; then
|
|
72
|
+
echo -e "${RED}Ruby ${ruby_version} not installed in rvm. Skipping...${NC}"
|
|
73
|
+
FAILED=$((FAILED + 1))
|
|
74
|
+
FAILED_TESTS+=("Ruby ${ruby_version} / Rails ${rails_version} (Ruby not installed)")
|
|
75
|
+
continue
|
|
76
|
+
fi
|
|
77
|
+
source ~/.rvm/scripts/rvm
|
|
78
|
+
rvm use "${ruby_version}"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# Verify Ruby version
|
|
82
|
+
CURRENT_VERSION=$(ruby -v)
|
|
83
|
+
echo "Current Ruby version: ${CURRENT_VERSION}"
|
|
84
|
+
|
|
85
|
+
# Extract major.minor version for gemfile name
|
|
86
|
+
MAJOR_MINOR_VERSION=$(echo "${ruby_version}" | cut -d. -f1-2)
|
|
87
|
+
|
|
88
|
+
# Set BUNDLE_GEMFILE
|
|
89
|
+
export BUNDLE_GEMFILE="${PROJECT_ROOT}/gemfiles/ruby_${MAJOR_MINOR_VERSION}_rails_${rails_version}.gemfile"
|
|
90
|
+
|
|
91
|
+
echo "Using Gemfile: ${BUNDLE_GEMFILE}"
|
|
92
|
+
|
|
93
|
+
# Check if gemfile exists
|
|
94
|
+
if [ ! -f "${BUNDLE_GEMFILE}" ]; then
|
|
95
|
+
echo -e "${RED}✗ Gemfile not found: ${BUNDLE_GEMFILE}${NC}"
|
|
96
|
+
FAILED=$((FAILED + 1))
|
|
97
|
+
FAILED_TESTS+=("Ruby ${ruby_version} / Rails ${rails_version} (Gemfile not found)")
|
|
98
|
+
continue
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Install dependencies
|
|
102
|
+
echo ""
|
|
103
|
+
echo "Installing dependencies..."
|
|
104
|
+
if bundle install --quiet; then
|
|
105
|
+
echo -e "${GREEN}✓ Dependencies installed${NC}"
|
|
106
|
+
else
|
|
107
|
+
echo -e "${RED}✗ Failed to install dependencies${NC}"
|
|
108
|
+
FAILED=$((FAILED + 1))
|
|
109
|
+
FAILED_TESTS+=("Ruby ${ruby_version} / Rails ${rails_version} (bundle install failed)")
|
|
110
|
+
continue
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# Run tests
|
|
114
|
+
echo ""
|
|
115
|
+
echo "Running tests..."
|
|
116
|
+
if bundle exec rake test; then
|
|
117
|
+
echo -e "${GREEN}✓ Tests passed for Ruby ${ruby_version} / Rails ${rails_version}${NC}"
|
|
118
|
+
PASSED=$((PASSED + 1))
|
|
119
|
+
else
|
|
120
|
+
echo -e "${RED}✗ Tests failed for Ruby ${ruby_version} / Rails ${rails_version}${NC}"
|
|
121
|
+
FAILED=$((FAILED + 1))
|
|
122
|
+
FAILED_TESTS+=("Ruby ${ruby_version} / Rails ${rails_version}")
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
echo ""
|
|
126
|
+
done
|
|
127
|
+
|
|
128
|
+
# Summary
|
|
129
|
+
echo "========================================================================"
|
|
130
|
+
echo "Test Summary"
|
|
131
|
+
echo "========================================================================"
|
|
132
|
+
echo -e "Total: ${BLUE}$((PASSED + FAILED))${NC}"
|
|
133
|
+
echo -e "Passed: ${GREEN}${PASSED}${NC}"
|
|
134
|
+
echo -e "Failed: ${RED}${FAILED}${NC}"
|
|
135
|
+
|
|
136
|
+
if [ ${FAILED} -gt 0 ]; then
|
|
137
|
+
echo ""
|
|
138
|
+
echo "Failed tests:"
|
|
139
|
+
for test in "${FAILED_TESTS[@]}"; do
|
|
140
|
+
echo -e " ${RED}✗ ${test}${NC}"
|
|
141
|
+
done
|
|
142
|
+
exit 1
|
|
143
|
+
else
|
|
144
|
+
echo ""
|
|
145
|
+
echo -e "${GREEN}All tests passed! 🎉${NC}"
|
|
146
|
+
exit 0
|
|
147
|
+
fi
|
data/export_to.gemspec
CHANGED
|
@@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.homepage = "https://github.com/superlanding/export_to"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
|
+
spec.required_ruby_version = ">= 2.7.0", "< 3.2.0"
|
|
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
|
|
@@ -28,8 +30,8 @@ Gem::Specification.new do |spec|
|
|
|
28
30
|
spec.add_development_dependency "minitest", "~> 5.0"
|
|
29
31
|
spec.add_development_dependency "shoulda-context"
|
|
30
32
|
|
|
31
|
-
spec.add_dependency "fast_excel"
|
|
32
|
-
spec.add_dependency "spreadsheet"
|
|
33
|
-
spec.add_dependency "iconv"
|
|
34
|
-
spec.add_dependency "activesupport", ">= 6", "<
|
|
33
|
+
spec.add_dependency "fast_excel", "~> 0.4"
|
|
34
|
+
spec.add_dependency "spreadsheet", "~> 1.3"
|
|
35
|
+
spec.add_dependency "iconv", "~> 1.0"
|
|
36
|
+
spec.add_dependency "activesupport", ">= 6.0", "< 8"
|
|
35
37
|
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
export_to (1.1.0)
|
|
5
|
+
activesupport (>= 6.0, < 8)
|
|
6
|
+
fast_excel (~> 0.4)
|
|
7
|
+
iconv (~> 1.0)
|
|
8
|
+
spreadsheet (~> 1.3)
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
actionpack (6.1.7.10)
|
|
14
|
+
actionview (= 6.1.7.10)
|
|
15
|
+
activesupport (= 6.1.7.10)
|
|
16
|
+
rack (~> 2.0, >= 2.0.9)
|
|
17
|
+
rack-test (>= 0.6.3)
|
|
18
|
+
rails-dom-testing (~> 2.0)
|
|
19
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
20
|
+
actionview (6.1.7.10)
|
|
21
|
+
activesupport (= 6.1.7.10)
|
|
22
|
+
builder (~> 3.1)
|
|
23
|
+
erubi (~> 1.4)
|
|
24
|
+
rails-dom-testing (~> 2.0)
|
|
25
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
26
|
+
activesupport (6.1.7.10)
|
|
27
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
28
|
+
i18n (>= 1.6, < 2)
|
|
29
|
+
minitest (>= 5.1)
|
|
30
|
+
tzinfo (~> 2.0)
|
|
31
|
+
zeitwerk (~> 2.3)
|
|
32
|
+
bigdecimal (4.0.1)
|
|
33
|
+
builder (3.3.0)
|
|
34
|
+
concurrent-ruby (1.3.6)
|
|
35
|
+
crass (1.0.6)
|
|
36
|
+
erubi (1.13.1)
|
|
37
|
+
fast_excel (0.5.0)
|
|
38
|
+
ffi (> 1.9, < 2)
|
|
39
|
+
ffi (1.17.3)
|
|
40
|
+
i18n (1.14.8)
|
|
41
|
+
concurrent-ruby (~> 1.0)
|
|
42
|
+
iconv (1.1.1)
|
|
43
|
+
logger (1.7.0)
|
|
44
|
+
loofah (2.25.0)
|
|
45
|
+
crass (~> 1.0.2)
|
|
46
|
+
nokogiri (>= 1.12.0)
|
|
47
|
+
method_source (1.1.0)
|
|
48
|
+
minitest (5.26.1)
|
|
49
|
+
nokogiri (1.15.7-arm64-darwin)
|
|
50
|
+
racc (~> 1.4)
|
|
51
|
+
nokogiri (1.15.7-x86_64-linux)
|
|
52
|
+
racc (~> 1.4)
|
|
53
|
+
racc (1.8.1)
|
|
54
|
+
rack (2.2.21)
|
|
55
|
+
rack-test (2.2.0)
|
|
56
|
+
rack (>= 1.3)
|
|
57
|
+
rails-dom-testing (2.3.0)
|
|
58
|
+
activesupport (>= 5.0.0)
|
|
59
|
+
minitest
|
|
60
|
+
nokogiri (>= 1.6)
|
|
61
|
+
rails-html-sanitizer (1.6.2)
|
|
62
|
+
loofah (~> 2.21)
|
|
63
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
64
|
+
railties (6.1.7.10)
|
|
65
|
+
actionpack (= 6.1.7.10)
|
|
66
|
+
activesupport (= 6.1.7.10)
|
|
67
|
+
method_source
|
|
68
|
+
rake (>= 12.2)
|
|
69
|
+
thor (~> 1.0)
|
|
70
|
+
rake (13.3.1)
|
|
71
|
+
ruby-ole (1.2.13.1)
|
|
72
|
+
shoulda-context (2.0.0)
|
|
73
|
+
spreadsheet (1.3.4)
|
|
74
|
+
bigdecimal
|
|
75
|
+
logger
|
|
76
|
+
ruby-ole
|
|
77
|
+
thor (1.5.0)
|
|
78
|
+
tzinfo (2.0.6)
|
|
79
|
+
concurrent-ruby (~> 1.0)
|
|
80
|
+
zeitwerk (2.6.18)
|
|
81
|
+
|
|
82
|
+
PLATFORMS
|
|
83
|
+
arm64-darwin-21
|
|
84
|
+
x86_64-linux
|
|
85
|
+
|
|
86
|
+
DEPENDENCIES
|
|
87
|
+
activesupport (~> 6.1.0)
|
|
88
|
+
bundler (>= 2.0.0)
|
|
89
|
+
export_to!
|
|
90
|
+
logger (~> 1.5)
|
|
91
|
+
minitest (~> 5.0)
|
|
92
|
+
railties (~> 6.1.0)
|
|
93
|
+
rake (>= 13)
|
|
94
|
+
shoulda-context
|
|
95
|
+
|
|
96
|
+
BUNDLED WITH
|
|
97
|
+
2.3.14
|