activeadmin_settings_cached 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66b215e385891ca9912114999fb2f1503e0ea964
4
- data.tar.gz: 144d18fd399db01299913ffde456ba1d758dd875
3
+ metadata.gz: 3736a48cf8b4b7548d4910266581a3fc9eebcba3
4
+ data.tar.gz: de7634b92e52bbfa8b31e6e208d58a8400b8afe4
5
5
  SHA512:
6
- metadata.gz: 86461b1090024fbbd1be6754c99de2f3e8f31bffeb9bf80d099227063052db47f8a7fc36e996197cbcdb2622252b3c63cb7f7e1bb14cc1950f16229c46ae09ff
7
- data.tar.gz: bee99e56e562d814c492c1055052b9895bd37465b07780a52e662e275590568fd2bf995148d50fe1378937ebdd39f91b3438f17d24e5e7169f7447557c4598d5
6
+ metadata.gz: 6f4d640a6c4eed94608f5b8478bc81c40217b7c656d2db06571da6045f70a08c77e5e3c809b822a2353e3b734838d44f1bd7a01c6fa92883694e48f47a16db07
7
+ data.tar.gz: 25d94d5d0e3ed2ebb2384be24793a004b0d295df0eccf244d8ae2552ba63bd3dad1ceca9ce15b196653aeb74913d613c6e51107d10c291da240a7d9c55efce7d
data/.gitignore CHANGED
@@ -15,4 +15,4 @@
15
15
  .ruby-version
16
16
  .idea
17
17
  mkmf.log
18
- /gemfiles
18
+ /gemfiles/*.lock
data/.travis.yml CHANGED
@@ -1,10 +1,16 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
 
4
+ gemfile:
5
+ - gemfiles/rails4.2.gemfile
6
+ - gemfiles/rails5.0.gemfile
7
+
8
+ before_script:
9
+ - bundle exec rake setup
10
+
4
11
  script:
5
- - make
12
+ - bundle exec rake
6
13
 
7
14
  rvm:
8
- #- 2.1.5
9
- #- 2.2.0
10
- - 2.3.0
15
+ - 2.2.6
16
+ - 2.3.3
data/Appraisals CHANGED
@@ -2,10 +2,8 @@ appraise "rails4.2" do
2
2
  gem "rails", "~> 4.2.0"
3
3
  end
4
4
 
5
- #appraise "rails5.0" do
6
- #gem "rails", "~> 5.0.0"
7
- #gem 'inherited_resources', github: 'activeadmin/inherited_resources'
8
- #gem 'ransack', github: 'activerecord-hackery/ransack'
9
- #gem 'draper', '> 3.x'
10
- #gem 'sass-rails', github: 'rails/sass-rails' # For Sprockets 4
11
- #end
5
+ appraise "rails5.0" do
6
+ gem "rails", "~> 5.0.1"
7
+ gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources.git'
8
+ gem 'listen'
9
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,94 @@
1
+ # v2.1.1 2017-08-07
2
+
3
+ ## Fixed
4
+
5
+ - Fix generator (Alexander Merkulov)
6
+ - Fix i18n label content and 'for' attribute (Tom Richards)
7
+
8
+ # v2.1.0 2016-12-16
9
+
10
+ ## Added
11
+
12
+ - Allow to use key option to configure `starting_with` option name (Alexander Merkulov)
13
+ - German translation (Flyte222)
14
+
15
+ ## Changed
16
+
17
+ - Default model name is `Setting` instead `Settings`
18
+
19
+ # v2.0.1 2016-04-25
20
+
21
+ - Freeze right border for `rails-settings-cached` to `< 0.5.5`
22
+
23
+ # v2.0.0 2016-04-25
24
+
25
+ ## Added
26
+
27
+ - Added DSL and multiply settings panels functionality (Alexander Merkulov)
28
+
29
+ ## Changed
30
+
31
+ - Simplify localization, example
32
+
33
+ ```
34
+ en:
35
+ settings:
36
+ attributes:
37
+ my_awesome_settings: 'My Awesome Lolaized Setting'
38
+ ```
39
+
40
+ # v1.0.1 2015-10-25
41
+
42
+ ## Fixed
43
+
44
+ - Fix show settings in admin
45
+
46
+ # v1.0.0 2015-09-29
47
+
48
+ ## Added
49
+
50
+ - Allow to configure how display options
51
+
52
+ # v0.1.0 2015-08-31
53
+
54
+ ## Added
55
+
56
+ - Added labels to form fields (Derek Kniffin)
57
+
58
+ # v0.1.0 2015-08-03
59
+
60
+ ## Added
61
+
62
+ - Show flash message after save settings
63
+
64
+ ## Fixed
65
+
66
+ - Use proc for display settings name (Dmitry Krakosevich)
67
+
68
+ # v0.0.5 2015-06-04
69
+
70
+ ## Fixed
71
+
72
+ - Display settings name if translation is missing (Lunar Farside)
73
+
74
+ # v0.0.4 2015-05-17
75
+
76
+ ## Added
77
+
78
+ - Added en local (dixalex)
79
+
80
+ # v0.0.3 2015-04-30
81
+
82
+ ## Fixed
83
+
84
+ - Unlock Active Admin dependency
85
+
86
+ # v0.0.2 2014-11-30
87
+
88
+ ## Fixed
89
+
90
+ - Fix Active Admin version
91
+
92
+ # v0.0.1 2014-11-30
93
+
94
+ First public release
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  group :test do
4
4
  gem 'pry-byebug'
5
5
  gem 'therubyracer'
6
- gem 'activeadmin', github: 'activeadmin/activeadmin'
6
+ gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin.git'
7
7
  end
8
8
 
9
9
  gemspec
data/Makefile CHANGED
@@ -1,5 +1,8 @@
1
1
  default: test
2
2
 
3
+ rake:
4
+ bundle exec rake ${T}
5
+
3
6
  test: appraisals
4
7
  bundle exec appraisal rspec ${T}
5
8
 
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/activeadmin_settings_cached.svg)](http://badge.fury.io/rb/activeadmin_settings_cached)
4
4
  [![Build Status](https://travis-ci.org/artofhuman/activeadmin_settings_cached.svg?branch=master)](https://travis-ci.org/artofhuman/activeadmin_settings_cached)
5
5
  [![Dependency Status](https://gemnasium.com/badges/github.com/artofhuman/activeadmin_settings_cached.svg)](https://gemnasium.com/github.com/artofhuman/activeadmin_settings_cached)
6
+ [![Coverage Status](https://coveralls.io/repos/github/artofhuman/activeadmin_settings_cached/badge.svg?branch=master)](https://coveralls.io/github/artofhuman/activeadmin_settings_cached?branch=master)
6
7
 
7
8
  Provides a nice UI interface for [rails-settings-cached](https://github.com/huacnlee/rails-settings-cached) gem in [Active Admin](http://activeadmin.info/).
8
9
 
@@ -25,13 +26,28 @@ Create your settings model:
25
26
 
26
27
  Create your settings page:
27
28
 
28
- $ rails g active_admin:settings Settings
29
+ # From generators
30
+ $ rails g active_admin:settings Setting
31
+
32
+ # Or manual
33
+
34
+ ``` ruby
35
+ # app/admin/setting.rb
36
+ ActiveAdmin.register_page 'Setting' do
37
+ title = 'Settings'
38
+ menu label: title
39
+
40
+ active_admin_settings_page(
41
+ title: title
42
+ )
43
+ end
44
+ ```
29
45
 
30
46
  And configure your default values in your Settings model:
31
47
 
32
48
  ``` ruby
33
49
  class Settings < RailsSettings::CachedSettings
34
- defaults[:my_awesome_settings] = 'This is my settings'
50
+ defaults[:my_awesome_settings] = 'This is my settings'
35
51
  end
36
52
  ```
37
53
 
@@ -71,7 +87,7 @@ en:
71
87
  ```
72
88
  ## Model name
73
89
 
74
- By default the name of the mode is `Settings`. If you want to use a different name for the model, you can specify your that in `config/initializers/active_admin_settings_cached.rb`:
90
+ By default the name of the mode is `Setting`. If you want to use a different name for the model, you can specify your that in `config/initializers/active_admin_settings_cached.rb`:
75
91
 
76
92
  ``` ruby
77
93
  ActiveadminSettingsCached.configure do |config|
data/Rakefile CHANGED
@@ -5,3 +5,14 @@ Bundler::GemHelper.install_tasks
5
5
 
6
6
  # Import all our rake tasks
7
7
  FileList['tasks/**/*.rake'].each { |task| import task }
8
+
9
+ require 'rspec/core/rake_task'
10
+
11
+ RSpec::Core::RakeTask.new do |t|
12
+ t.pattern = 'spec/**/*_spec.rb'
13
+ t.ruby_opts = %w[]
14
+ t.verbose = false
15
+ end
16
+
17
+ desc 'Default: run the rspec examples'
18
+ task :default => [:spec]
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency 'activeadmin'
21
+ s.add_dependency 'activeadmin', '>= 1.0.0.pre4', '< 1.2.0'
22
22
  s.add_dependency 'rails-settings-cached', '>= 0.5.3', '< 0.6.6'
23
23
  s.add_dependency 'dry-types', '>= 0.8.1'
24
24
 
@@ -11,7 +11,7 @@
11
11
  <% settings_model.settings.each_pair do |name, _| %>
12
12
  <% field_name = settings_model.field_name(name) %>
13
13
  <tr class="odd">
14
- <td><strong><%= f.label t("settings.attributes.#{field_name}", default: field_name) %></strong></td>
14
+ <td><strong><%= f.label field_name, t("settings.attributes.#{field_name}", default: field_name) %></strong></td>
15
15
  <td>
16
16
  <div class='form'>
17
17
  <ol><%= f.input field_name, settings_model.field_options(field_name, name) %></ol>
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2.0"
6
+
7
+ group :test do
8
+ gem "pry-byebug"
9
+ gem "therubyracer"
10
+ gem "activeadmin", :git => "https://github.com/activeadmin/activeadmin.git"
11
+ end
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.0.1"
6
+ gem "inherited_resources", :git => "https://github.com/activeadmin/inherited_resources.git"
7
+ gem "listen"
8
+
9
+ group :test do
10
+ gem "pry-byebug"
11
+ gem "therubyracer"
12
+ gem "activeadmin", :git => "https://github.com/activeadmin/activeadmin.git"
13
+ end
14
+
15
+ gemspec :path => "../"
@@ -13,7 +13,7 @@ module ActiveadminSettingsCached
13
13
  end
14
14
 
15
15
  def cast_params(params)
16
- coerced_params = params.map do |name, value|
16
+ coerced_params = params.to_unsafe_h.map do |name, value|
17
17
  [name, cast_value(name, value)]
18
18
  end
19
19
 
@@ -31,7 +31,7 @@ module ActiveadminSettingsCached
31
31
  end
32
32
 
33
33
  flash[:success] = t('activeadmin_settings_cached.settings.update.success'.freeze)
34
- redirect_to :back
34
+ Rails.version.to_i >= 5 ? redirect_back(fallback_location: admin_root_path) : redirect_to(:back)
35
35
  end
36
36
 
37
37
  instance_eval(&block) if block_given?
@@ -1,3 +1,3 @@
1
1
  module ActiveadminSettingsCached
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
@@ -5,4 +5,4 @@ Example:
5
5
  rails generate active_admin:settings Thing
6
6
 
7
7
  This will create:
8
- app/admin/thing.rb
8
+ app/admin/thing.rb
@@ -1,4 +1,4 @@
1
- module ActiveadminSettingsCached
1
+ module ActiveAdmin
2
2
  module Generators
3
3
  class SettingsGenerator < Rails::Generators::NamedBase
4
4
  source_root File.expand_path('../templates', __FILE__)
data/spec/spec_helper.rb CHANGED
@@ -16,7 +16,7 @@ require 'rails'
16
16
  ENV['RAILS'] = Rails.version
17
17
  ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV['RAILS']}", __FILE__)
18
18
  # Create the test app if it doesn't exists
19
- unless File.exists?(ENV['RAILS_ROOT'])
19
+ unless File.exist?(ENV['RAILS_ROOT'])
20
20
  system 'rake setup'
21
21
  end
22
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_settings_cached
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Semyon Pupkov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.0.0.pre4
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '0'
29
+ version: 1.0.0.pre4
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 1.2.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rails-settings-cached
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -209,6 +215,7 @@ files:
209
215
  - ".rspec"
210
216
  - ".travis.yml"
211
217
  - Appraisals
218
+ - CHANGELOG.md
212
219
  - Dockerfile
213
220
  - Gemfile
214
221
  - LICENSE.txt
@@ -221,6 +228,8 @@ files:
221
228
  - config/locales/en.yml
222
229
  - config/locales/ru.yml
223
230
  - docker-compose.yml
231
+ - gemfiles/rails4.2.gemfile
232
+ - gemfiles/rails5.0.gemfile
224
233
  - lib/activeadmin_settings_cached.rb
225
234
  - lib/activeadmin_settings_cached/coercions.rb
226
235
  - lib/activeadmin_settings_cached/dsl.rb
@@ -228,9 +237,9 @@ files:
228
237
  - lib/activeadmin_settings_cached/model.rb
229
238
  - lib/activeadmin_settings_cached/options.rb
230
239
  - lib/activeadmin_settings_cached/version.rb
231
- - lib/generators/active_admin/settings/USAGE
232
- - lib/generators/active_admin/settings/settings_generator.rb
233
- - lib/generators/active_admin/settings/templates/settings.rb
240
+ - lib/generators/active_admin/USAGE
241
+ - lib/generators/active_admin/settings_generator.rb
242
+ - lib/generators/active_admin/templates/settings.rb
234
243
  - spec/coercions_spec.rb
235
244
  - spec/model_spec.rb
236
245
  - spec/settings_spec.rb
@@ -258,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
267
  version: '0'
259
268
  requirements: []
260
269
  rubyforge_project:
261
- rubygems_version: 2.5.1
270
+ rubygems_version: 2.6.8
262
271
  signing_key:
263
272
  specification_version: 4
264
273
  summary: UI interface for rails-settings-cached in active admin