From 7a79b27970c86c6a7a0e911e0b9847246eb9cce7 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:00:29 -0400 Subject: [PATCH 1/7] add border mixins and remove deprecated activeadmin methods --- README.md | 7 ++++- .../active_admin/active_admin_globalize.sass | 28 +++++++++++++++++++ lib/active_admin/globalize/engine.rb | 7 ----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a16eabdf..1faa1845 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ As soon as ActiveAdmin 1.x is released to rubygems, I'll release the gem with no Previous version with support for Rails 3 is maintained in branch [support/0.6.x](https://github.com/fabn/activeadmin-globalize/tree/support/0.6.x) +## Require Assets + +- active_admin.js: `//= require active_admin/active_admin_globalize.js` +- active_admin.scss: `@import "active_admin/active_admin_globalize.css";` + ## Your model ```ruby @@ -68,7 +73,7 @@ form do |f| end # You can also set locales to show in tabs -# For example we want to show English translation fields without tab, and want to show other languages within tabs +# For example we want to show English translation fields without tab, and want to show other languages within tabs form do |f| # ... f.inputs do diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize.sass b/app/assets/stylesheets/active_admin/active_admin_globalize.sass index 59871443..5566dc64 100644 --- a/app/assets/stylesheets/active_admin/active_admin_globalize.sass +++ b/app/assets/stylesheets/active_admin/active_admin_globalize.sass @@ -2,6 +2,34 @@ @import "active_admin_globalize_flags" +@mixin border-top-radius($radius) + -webkit-border-top-right-radius: $radius + border-top-right-radius: $radius + -webkit-border-top-left-radius: $radius + border-top-left-radius: $radius + background-clip: padding-box + +@mixin border-right-radius($radius) + -webkit-border-bottom-right-radius: $radius + border-bottom-right-radius: $radius + -webkit-border-top-right-radius: $radius + border-top-right-radius: $radius + background-clip: padding-box + +@mixin border-bottom-radius($radius) + -webkit-border-bottom-right-radius: $radius + border-bottom-right-radius: $radius + -webkit-border-bottom-left-radius: $radius + border-bottom-left-radius: $radius + background-clip: padding-box + +@mixin border-left-radius($radius) + -webkit-border-bottom-left-radius: $radius + border-bottom-left-radius: $radius + -webkit-border-top-left-radius: $radius + border-top-left-radius: $radius + background-clip: padding-box + .active_admin .activeadmin-translations margin-bottom: 20px diff --git a/lib/active_admin/globalize/engine.rb b/lib/active_admin/globalize/engine.rb index 8dd58f6b..f1ef9037 100644 --- a/lib/active_admin/globalize/engine.rb +++ b/lib/active_admin/globalize/engine.rb @@ -7,13 +7,6 @@ class Engine < ::Rails::Engine "active_admin/active_admin_globalize.js" ] end - - initializer "add assets" do - ActiveAdmin.application.register_stylesheet "active_admin/active_admin_globalize.css", :media => :screen - ActiveAdmin.application.register_javascript "active_admin/active_admin_globalize.js" - end - end end end - From 33bd87458ea3291b330dbe20d1b79fb59718bbf0 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:03:14 -0400 Subject: [PATCH 2/7] remove 1.0.0.pre requirement --- activeadmin-globalize.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activeadmin-globalize.gemspec b/activeadmin-globalize.gemspec index 22867161..d8073b01 100644 --- a/activeadmin-globalize.gemspec +++ b/activeadmin-globalize.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*'] + %w(MIT-LICENSE README.md) - s.add_dependency 'activeadmin', '~> 1.0.0.pre' + s.add_dependency 'activeadmin' # Try to support rails from 3.2 up to 4.2.x s.add_dependency 'globalize', '>= 3.1.0', '< 6.0' @@ -25,4 +25,3 @@ Gem::Specification.new do |s| # Other development dependencies moved into Gemfile end - From b5ff7459979879e108dff4144876d54433ed5591 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:08:10 -0400 Subject: [PATCH 3/7] move mixins to separate file before flags import --- .../active_admin/active_admin_globalize.sass | 30 +------------------ .../active_admin_globalize_mixins.sass | 27 +++++++++++++++++ 2 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize.sass b/app/assets/stylesheets/active_admin/active_admin_globalize.sass index 5566dc64..ef59114f 100644 --- a/app/assets/stylesheets/active_admin/active_admin_globalize.sass +++ b/app/assets/stylesheets/active_admin/active_admin_globalize.sass @@ -1,35 +1,7 @@ @import "active_admin/mixins" - +@import "active_admin_globalize_mixins" @import "active_admin_globalize_flags" -@mixin border-top-radius($radius) - -webkit-border-top-right-radius: $radius - border-top-right-radius: $radius - -webkit-border-top-left-radius: $radius - border-top-left-radius: $radius - background-clip: padding-box - -@mixin border-right-radius($radius) - -webkit-border-bottom-right-radius: $radius - border-bottom-right-radius: $radius - -webkit-border-top-right-radius: $radius - border-top-right-radius: $radius - background-clip: padding-box - -@mixin border-bottom-radius($radius) - -webkit-border-bottom-right-radius: $radius - border-bottom-right-radius: $radius - -webkit-border-bottom-left-radius: $radius - border-bottom-left-radius: $radius - background-clip: padding-box - -@mixin border-left-radius($radius) - -webkit-border-bottom-left-radius: $radius - border-bottom-left-radius: $radius - -webkit-border-top-left-radius: $radius - border-top-left-radius: $radius - background-clip: padding-box - .active_admin .activeadmin-translations margin-bottom: 20px diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass b/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass new file mode 100644 index 00000000..51cb1d2c --- /dev/null +++ b/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass @@ -0,0 +1,27 @@ +@mixin border-top-radius($radius) + -webkit-border-top-right-radius: $radius + border-top-right-radius: $radius + -webkit-border-top-left-radius: $radius + border-top-left-radius: $radius + background-clip: padding-box + +@mixin border-right-radius($radius) + -webkit-border-bottom-right-radius: $radius + border-bottom-right-radius: $radius + -webkit-border-top-right-radius: $radius + border-top-right-radius: $radius + background-clip: padding-box + +@mixin border-bottom-radius($radius) + -webkit-border-bottom-right-radius: $radius + border-bottom-right-radius: $radius + -webkit-border-bottom-left-radius: $radius + border-bottom-left-radius: $radius + background-clip: padding-box + +@mixin border-left-radius($radius) + -webkit-border-bottom-left-radius: $radius + border-bottom-left-radius: $radius + -webkit-border-top-left-radius: $radius + border-top-left-radius: $radius + background-clip: padding-box From ac703c726b8b6bde88762589ebd5a70d3862fedf Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:20:31 -0400 Subject: [PATCH 4/7] update version to match activeadmin --- lib/active_admin/globalize/version.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/active_admin/globalize/version.rb b/lib/active_admin/globalize/version.rb index 05a94b8a..0854d0a6 100644 --- a/lib/active_admin/globalize/version.rb +++ b/lib/active_admin/globalize/version.rb @@ -1,6 +1,5 @@ module ActiveAdmin module Globalize - VERSION = '1.0.0.pre' + VERSION = '1.1.0' end end - From 2a92bb596868a8d51ea74357bb86a0695a46754f Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Wed, 9 Aug 2017 09:14:37 -0400 Subject: [PATCH 5/7] css file needs to be required, not imported --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1faa1845..1ba9b886 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Previous version with support for Rails 3 is maintained in branch [support/0.6.x ## Require Assets - active_admin.js: `//= require active_admin/active_admin_globalize.js` -- active_admin.scss: `@import "active_admin/active_admin_globalize.css";` +- active_admin.css: `*= require active_admin/active_admin_globalize` ## Your model From 4101fdd787e508764d9ec691b9ae1b739b28c118 Mon Sep 17 00:00:00 2001 From: Lawrence Oluyede Date: Mon, 28 Aug 2017 15:41:38 +0200 Subject: [PATCH 6/7] Update dependencies, test against ActiveAdmin 1.0 and add Rails 5.0 and 5.1 --- .travis.yml | 12 +++++------ Appraisals | 18 ++++++++--------- Gemfile | 6 +++--- README.md | 2 +- activeadmin-globalize.gemspec | 4 ++-- gemfiles/rails4_2.gemfile | 16 +++++++-------- .../{rails4_1.gemfile => rails5_0.gemfile} | 18 ++++++++--------- ...eadmin_master.gemfile => rails5_1.gemfile} | 20 +++++++++---------- lib/active_admin/globalize/version.rb | 2 +- 9 files changed, 48 insertions(+), 50 deletions(-) rename gemfiles/{rails4_1.gemfile => rails5_0.gemfile} (58%) rename gemfiles/{activeadmin_master.gemfile => rails5_1.gemfile} (52%) diff --git a/.travis.yml b/.travis.yml index cd2afcb4..773e409d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,13 @@ sudo: false language: ruby # Limit ruby versions to currently supported versions to avoid a big build matrix rvm: - - 2.2 - - 2.3.0 -# Update bundler on travis, since current one is broken, see https://github.com/rubygems/rubygems/issues/1419 -before_install: - - gem install bundler + - 2.2.7 + - 2.3.4 + - 2.4.1 # Load database schema before rake before_script: bundle exec rake db:schema:load # Test on all supported rails versions gemfile: - - gemfiles/activeadmin_master.gemfile - - gemfiles/rails4_1.gemfile - gemfiles/rails4_2.gemfile + - gemfiles/rails5_0.gemfile + - gemfiles/rails5_1.gemfile diff --git a/Appraisals b/Appraisals index 5ff3e2fd..2cd73a66 100644 --- a/Appraisals +++ b/Appraisals @@ -1,15 +1,15 @@ -appraise 'rails4_1' do - gem 'rails', '~> 4.1.12' - gem 'globalize', '~> 4.0.3' +appraise 'rails4_2' do + gem 'rails', '~> 4.2.9' + gem 'globalize', '~> 5.0.0' end -appraise 'rails4_2' do - gem 'rails', '~> 4.2.3' +appraise 'rails5_0' do + gem 'rails', '~> 4.2.9' gem 'globalize', '~> 5.0.0' end -# Run tests on latest github version of ActiveAdmin -appraise 'activeadmin_master' do - gem 'rails', '~> 4.2.0' - gem 'activeadmin', github: 'activeadmin/activeadmin' +appraise 'rails5_1' do + gem 'devise', '~> 4.3' + gem 'rails', '~> 5.1.3' + gem 'globalize', '~> 5.1.0.beta2' end diff --git a/Gemfile b/Gemfile index aaa1189b..f09f859a 100644 --- a/Gemfile +++ b/Gemfile @@ -29,15 +29,15 @@ gem 'devise', '~> 3.2' group :test do gem 'sqlite3', '~> 1.3.5' - gem 'rspec-rails', '~> 2.14.0' + gem 'rspec-rails', '~> 3.6.1' gem 'factory_girl_rails', '~> 4.2.1' gem 'database_cleaner', '~> 1.0.1' gem 'spring', require: false gem 'spring-commands-rspec', require: false - gem 'capybara', '~> 2.1.0' + gem 'capybara', '~> 2.15' gem 'capybara-screenshot' gem 'poltergeist' - gem 'fuubar' + gem 'fuubar', '~> 2.2' gem 'appraisal' # Useful to debug tests gem 'awesome_print' diff --git a/README.md b/README.md index 1ba9b886..9588b0f1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Makes it easy to translate your resource fields. This version targets Rails 4 and greater and ActiveAdmin >= 1.0.0.pre. ```ruby -gem 'activeadmin-globalize', '~> 1.0.0.pre', github: 'fabn/activeadmin-globalize', branch: 'develop' +gem 'activeadmin-globalize', '~> 1.0.0', github: 'fabn/activeadmin-globalize', branch: 'develop' ``` As soon as ActiveAdmin 1.x is released to rubygems, I'll release the gem with no need for github dependency. See diff --git a/activeadmin-globalize.gemspec b/activeadmin-globalize.gemspec index d8073b01..d61d0801 100644 --- a/activeadmin-globalize.gemspec +++ b/activeadmin-globalize.gemspec @@ -11,11 +11,11 @@ Gem::Specification.new do |s| s.email = ['stefano.verna@gmail.com', 'f.napoleoni@gmail.com'] s.homepage = 'http://github.com/fabn/activeadmin-globalize' s.summary = 'Handles globalize translations' - s.description = 'Handles globalize translations in ActiveAdmin 0.6.3 and Rails 3.2.x' + s.description = 'Handles globalize translations in ActiveAdmin 1.0 and Rails 4.x-5.x' s.files = Dir['{app,config,db,lib}/**/*'] + %w(MIT-LICENSE README.md) - s.add_dependency 'activeadmin' + s.add_dependency 'activeadmin', '>= 1.0', '< 1.1' # Try to support rails from 3.2 up to 4.2.x s.add_dependency 'globalize', '>= 3.1.0', '< 6.0' diff --git a/gemfiles/rails4_2.gemfile b/gemfiles/rails4_2.gemfile index 95eae508..4f6e65a0 100644 --- a/gemfiles/rails4_2.gemfile +++ b/gemfiles/rails4_2.gemfile @@ -4,27 +4,27 @@ source "https://rubygems.org" gem "sass-rails" gem "coffee-rails" -gem "therubyracer", :platforms => :ruby +gem "therubyracer", platforms: :ruby gem "uglifier" gem "jquery-rails" gem "devise", "~> 3.2" -gem "rails", "~> 4.2.3" +gem "rails", "~> 4.2.9" gem "globalize", "~> 5.0.0" group :test do gem "sqlite3", "~> 1.3.5" - gem "rspec-rails", "~> 2.14.0" + gem "rspec-rails", "~> 3.6.1" gem "factory_girl_rails", "~> 4.2.1" gem "database_cleaner", "~> 1.0.1" - gem "spring", :require => false - gem "spring-commands-rspec", :require => false - gem "capybara", "~> 2.1.0" + gem "spring", require: false + gem "spring-commands-rspec", require: false + gem "capybara", "~> 2.15" gem "capybara-screenshot" gem "poltergeist" - gem "fuubar" + gem "fuubar", "~> 2.2" gem "appraisal" gem "awesome_print" gem "pry" end -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails4_1.gemfile b/gemfiles/rails5_0.gemfile similarity index 58% rename from gemfiles/rails4_1.gemfile rename to gemfiles/rails5_0.gemfile index 9d023afa..4f6e65a0 100644 --- a/gemfiles/rails4_1.gemfile +++ b/gemfiles/rails5_0.gemfile @@ -4,27 +4,27 @@ source "https://rubygems.org" gem "sass-rails" gem "coffee-rails" -gem "therubyracer", :platforms => :ruby +gem "therubyracer", platforms: :ruby gem "uglifier" gem "jquery-rails" gem "devise", "~> 3.2" -gem "rails", "~> 4.1.12" -gem "globalize", "~> 4.0.3" +gem "rails", "~> 4.2.9" +gem "globalize", "~> 5.0.0" group :test do gem "sqlite3", "~> 1.3.5" - gem "rspec-rails", "~> 2.14.0" + gem "rspec-rails", "~> 3.6.1" gem "factory_girl_rails", "~> 4.2.1" gem "database_cleaner", "~> 1.0.1" - gem "spring", :require => false - gem "spring-commands-rspec", :require => false - gem "capybara", "~> 2.1.0" + gem "spring", require: false + gem "spring-commands-rspec", require: false + gem "capybara", "~> 2.15" gem "capybara-screenshot" gem "poltergeist" - gem "fuubar" + gem "fuubar", "~> 2.2" gem "appraisal" gem "awesome_print" gem "pry" end -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/activeadmin_master.gemfile b/gemfiles/rails5_1.gemfile similarity index 52% rename from gemfiles/activeadmin_master.gemfile rename to gemfiles/rails5_1.gemfile index f998d30f..c48e8de5 100644 --- a/gemfiles/activeadmin_master.gemfile +++ b/gemfiles/rails5_1.gemfile @@ -4,27 +4,27 @@ source "https://rubygems.org" gem "sass-rails" gem "coffee-rails" -gem "therubyracer", :platforms => :ruby +gem "therubyracer", platforms: :ruby gem "uglifier" gem "jquery-rails" -gem "devise", "~> 3.2" -gem "rails", "~> 4.2.0" -gem "activeadmin", :github => "activeadmin/activeadmin" +gem "devise", "~> 4.3" +gem "rails", "~> 5.1.3" +gem "globalize", "~> 5.1.0.beta2" group :test do gem "sqlite3", "~> 1.3.5" - gem "rspec-rails", "~> 2.14.0" + gem "rspec-rails", "~> 3.6.1" gem "factory_girl_rails", "~> 4.2.1" gem "database_cleaner", "~> 1.0.1" - gem "spring", :require => false - gem "spring-commands-rspec", :require => false - gem "capybara", "~> 2.1.0" + gem "spring", require: false + gem "spring-commands-rspec", require: false + gem "capybara", "~> 2.15" gem "capybara-screenshot" gem "poltergeist" - gem "fuubar" + gem "fuubar", "~> 2.2" gem "appraisal" gem "awesome_print" gem "pry" end -gemspec :path => "../" +gemspec path: "../" diff --git a/lib/active_admin/globalize/version.rb b/lib/active_admin/globalize/version.rb index 0854d0a6..13702a9d 100644 --- a/lib/active_admin/globalize/version.rb +++ b/lib/active_admin/globalize/version.rb @@ -1,5 +1,5 @@ module ActiveAdmin module Globalize - VERSION = '1.1.0' + VERSION = '1.0.0' end end From 1d9d553afd6a7910bc0c4461656616174a9e193c Mon Sep 17 00:00:00 2001 From: rhymes Date: Tue, 3 Oct 2017 09:39:50 +0200 Subject: [PATCH 7/7] Allow ActiveAdmin 1.1 --- activeadmin-globalize.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activeadmin-globalize.gemspec b/activeadmin-globalize.gemspec index d61d0801..ca5a02ab 100644 --- a/activeadmin-globalize.gemspec +++ b/activeadmin-globalize.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*'] + %w(MIT-LICENSE README.md) - s.add_dependency 'activeadmin', '>= 1.0', '< 1.1' + s.add_dependency 'activeadmin', '>= 1.0', '< 1.2' # Try to support rails from 3.2 up to 4.2.x s.add_dependency 'globalize', '>= 3.1.0', '< 6.0'