Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gem_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bump:
file: "lib/spree_i18n/version.rb"
14 changes: 9 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: "bundler" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Tests (${{ matrix.db }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [postgres, mysql]
include:
- db: postgres
database_url: postgres://postgres:password@localhost:5432/spree_test
- db: mysql
database_url: mysql2://root:password@127.0.0.1:3306/spree_test
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: spree_test
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: spree_test
ports: ['3306:3306']
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB: ${{ matrix.db }}
DATABASE_URL: ${{ matrix.database_url }}
RAILS_ENV: test
CI: true
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install libvips
run: sudo apt-get update && sudo apt-get install -y libvips
- name: Create test app
run: bundle exec rake test_app
- name: Run specs
run: bundle exec rspec --format progress --format RspecJunitFormatter --out tmp/test-results/rspec.xml

brakeman:
name: Brakeman
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Run Brakeman
run: bundle exec brakeman --force --exit-on-warn --exit-on-error
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.idea
.localeapp/locales
.project
.vscode
coverage
default
Gemfile.lock
Expand All @@ -18,5 +19,6 @@ spec/dummy
public/spree
.ruby-version
.ruby-gemset
gemfiles/*.gemfile.lock
*.gem
*/*.gem
.env
1 change: 0 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--color
-r spec_helper
-f documentation
24 changes: 19 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
---
inherit_from: .hound.yml

AllCops:
DisplayCopNames: true
TargetRubyVersion: 3.2
Include:
- '**/Gemfile'
- '**/Rakefile'
Exclude:
- spec/dummy/**/*
- bin/*
- 'spec/dummy/**/*'
- 'lib/generators/**/*'
- 'bin/*'

Layout/LineLength:
Max: 150

# DISABLED

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

9 changes: 0 additions & 9 deletions Appraisals

This file was deleted.

27 changes: 25 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
source 'https://rubygems.org'

gem "rails-controller-testing"
gem 'spree', github: 'spree/spree', branch: 'main'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
"https://github.com/#{repo_name}.git"
end

gem 'rails-controller-testing'

spree_opts = if ENV['SPREE_PATH']
{ 'path': ENV['SPREE_PATH'] }
else
{ 'github': 'spree/spree', 'branch': 'main' }
end
gem 'spree', spree_opts

gem 'spree_dev_tools', '>= 0.6.0.rc1'

if ENV['DB'] == 'mysql'
gem 'mysql2'
elsif ENV['DB'] == 'postgres'
gem 'pg'
else
gem 'sqlite3'
end

gem 'propshaft'

gemspec
60 changes: 28 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Spree Internationalization

[![Build Status](https://travis-ci.org/spree-contrib/spree_i18n.svg?branch=master)](https://travis-ci.org/spree-contrib/spree_i18n)
[![Code Climate](https://codeclimate.com/github/spree-contrib/spree_i18n/badges/gpa.svg)](https://codeclimate.com/github/spree-contrib/spree_i18n)
[![CI](https://github.com/spree/spree_i18n/actions/workflows/ci.yml/badge.svg)](https://github.com/spree/spree_i18n/actions/workflows/ci.yml)

This is the Internationalization project for [Spree Commerce][1]

Expand All @@ -24,59 +23,56 @@ Spree is developed and maintained by
1. Add this extension to your Gemfile with this line:

```ruby
gem 'spree_i18n'
bundle add spree_i18n
```

2. Install the gem using Bundler:
```ruby
bundle install
```
2. Run the install generator

3. Copy & run migrations
```ruby
bundle exec rails g spree_i18n:install
```

4. Restart your server
3. Restart your server

If your server was running, restart it so that it can find the assets properly.

## Upgrading to 5.0 (only Spree 4.2+)
## Developing

### 1. Remove Asset references
1. Create a dummy app

From `vendor/assets/javascripts/spree/backend/all.js`
```
//= require spree/backend/spree_i18n
```
```bash
bundle update
bundle exec rake test_app
```

and from `vendor/assets/javascripts/spree/frontend/all.js`
```
//= require spree/frontend/spree_i18n
```
2. Add your new code
3. Run tests

and from `vendor/assets/stylesheets/spree/backend/all.css`
```
*= require spree/backend/spree_i18n
```
```bash
bundle exec rspec
```

and from `vendor/assets/stylesheets/spree/frontend/all.css`
```
*= require spree/backend/spree_i18n
## Releasing a new version

```shell
bundle exec gem bump -p -t
bundle exec gem release
```

---
For more options please see [gem-release README](https://github.com/svenfuchs/gem-release)

## Contributing

[See corresponding guidelines][7]
If you'd like to contribute, please take a look at the
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
pull request.

---

Copyright (c) 2010-2015 [Spree Commerce Inc.][1] and other [contributors][5]. released under the [New BSD License][6]
Copyright (c) 2010-2026 [Spree Commerce Inc.][1] and other [contributors][5], released under the [New BSD License][6]

[1]: https://spreecommerce.org
[2]: https://spreecommerce.org/docs/developer/core-concepts/i18n#internationalization
[5]: https://github.com/spree-contrib/spree_i18n/graphs/contributors
[6]: https://github.com/spree-contrib/spree_i18n/blob/master/LICENSE.md
[7]: https://github.com/spree-contrib/spree_i18n/blob/master/CONTRIBUTING.md
[5]: https://github.com/spree/spree_i18n/graphs/contributors
[6]: https://github.com/spree/spree_i18n/blob/main/LICENSE.md
[7]: https://github.com/spree/spree_i18n/blob/main/CONTRIBUTING.md
27 changes: 11 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
require 'rubygems'
require 'bundler/setup'
require 'rake'
require 'rake/testtask'
require 'rake/packagetask'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
require 'spree/testing_support/common_rake'
require 'spree_i18n'

require 'bundler'
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new

task default: :spec
require 'rspec/core/rake_task'
require 'spree/testing_support/extension_rake'

spec = eval(File.read('spree_i18n.gemspec'))
RSpec::Core::RakeTask.new

Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
task :default do
if Dir['spec/dummy'].empty?
Rake::Task[:test_app].invoke
Dir.chdir('../../')
end
Rake::Task[:spec].invoke
end

desc 'Generates a dummy app for testing'
task :test_app do
ENV['LIB_NAME'] = 'spree_i18n'
Rake::Task['common:test_app'].invoke
Rake::Task['extension:test_app'].execute
end

namespace :spree_i18n do
Expand Down
1 change: 1 addition & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" from the root of your extension

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/spree_i18n/engine', __FILE__)
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/spree_4_2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/spree_master.gemfile

This file was deleted.

Loading
Loading