golden-setting 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +198 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/golden/setting/settings.js.coffee +8 -0
- data/app/assets/stylesheets/golden/setting/settings.css.sass +0 -0
- data/app/controllers/golden/setting/settings_controller.rb +65 -0
- data/app/helpers/golden/setting/settings_helper.rb +52 -0
- data/app/models/concerns/golden/setting/resourced.rb +48 -0
- data/app/views/golden/setting/settings/_batch_form.html.erb +24 -0
- data/app/views/golden/setting/settings/_form.html.erb +25 -0
- data/app/views/golden/setting/settings/_setting.html.erb +18 -0
- data/app/views/golden/setting/settings/_table.html.erb +34 -0
- data/app/views/golden/setting/settings/edit.html.erb +30 -0
- data/app/views/golden/setting/settings/index.html.erb +33 -0
- data/app/views/golden/setting/settings/list.html.erb +19 -0
- data/app/views/golden/setting/settings/new.html.erb +27 -0
- data/app/views/golden/setting/settings/show.html.erb +24 -0
- data/config/locales/settings.en.yml +52 -0
- data/config/locales/settings.zh-TW.yml +52 -0
- data/config/routes.rb +8 -0
- data/golden-setting.gemspec +28 -0
- data/lib/generators/golden/setting/USAGE +18 -0
- data/lib/generators/golden/setting/install_generator.rb +86 -0
- data/lib/generators/golden/setting/templates/create_golden_settings.rb +17 -0
- data/lib/generators/golden/setting/templates/golden_setting.rb +36 -0
- data/lib/generators/golden/setting/templates/setting.rb +3 -0
- data/lib/generators/golden/setting/templates/settings.en.yml +15 -0
- data/lib/generators/golden/setting/templates/settings.zh-TW.yml +15 -0
- data/lib/golden/setting/action.rb +58 -0
- data/lib/golden/setting/base.rb +47 -0
- data/lib/golden/setting/cache.rb +55 -0
- data/lib/golden/setting/engine.rb +16 -0
- data/lib/golden/setting/error.rb +38 -0
- data/lib/golden/setting/form_option.rb +69 -0
- data/lib/golden/setting/group.rb +17 -0
- data/lib/golden/setting/name.rb +30 -0
- data/lib/golden/setting/resource.rb +44 -0
- data/lib/golden/setting/value.rb +67 -0
- data/lib/golden/setting/version.rb +5 -0
- data/lib/golden/setting.rb +54 -0
- data/spec/base_spec.rb +125 -0
- data/spec/cache_spec.rb +40 -0
- data/spec/resource_spec.rb +72 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support/models.rb +15 -0
- data/spec/support/schema.rb +26 -0
- metadata +194 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
module Golden
|
2
|
+
module Setting
|
3
|
+
class Resource < Base
|
4
|
+
belongs_to :resource
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def bind resource
|
8
|
+
@resource = resource
|
9
|
+
self
|
10
|
+
end
|
11
|
+
|
12
|
+
def unbind
|
13
|
+
@resource = nil
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def with_resource resource = @resource
|
18
|
+
where(resource_type: resource.class.name).
|
19
|
+
where(resource_id: resource.id)
|
20
|
+
end
|
21
|
+
|
22
|
+
def named name, resource = @resource
|
23
|
+
with_resource(resource).where(name: name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def object name, resource = @resource
|
27
|
+
named(name, resource).first
|
28
|
+
end
|
29
|
+
|
30
|
+
def new_object name, resource = @resource
|
31
|
+
named(name, resource).new
|
32
|
+
end
|
33
|
+
|
34
|
+
def first_or_new_object name, resource = @resource
|
35
|
+
named(name, resource).first_or_initialize
|
36
|
+
end
|
37
|
+
|
38
|
+
def select_object fields = %w{name value}, resource = @resource
|
39
|
+
with_resource(resource).select(fields)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Golden
|
2
|
+
module Setting
|
3
|
+
module Value
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
included do
|
6
|
+
cattr_accessor :defaults
|
7
|
+
@@defaults = {}.with_indifferent_access
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
def object name
|
12
|
+
raise Error::SettingNoMethod, :object unless defined? super
|
13
|
+
super name
|
14
|
+
end
|
15
|
+
|
16
|
+
def new_object name
|
17
|
+
raise Error::SettingNoMethod, :new_object unless defined? super
|
18
|
+
super name
|
19
|
+
end
|
20
|
+
|
21
|
+
def first_or_new_object name
|
22
|
+
raise Error::SettingNoMethod, :first_or_new_object unless defined? super
|
23
|
+
super name
|
24
|
+
end
|
25
|
+
|
26
|
+
def [] name
|
27
|
+
record = object(name)
|
28
|
+
record ? record.value : defaults[name.to_sym]
|
29
|
+
end
|
30
|
+
|
31
|
+
def []= name, value
|
32
|
+
record = first_or_new_object(name)
|
33
|
+
if record.value != value
|
34
|
+
record.value = value
|
35
|
+
record.save!
|
36
|
+
end
|
37
|
+
value
|
38
|
+
end
|
39
|
+
|
40
|
+
def is_true? name
|
41
|
+
raise Error::SettingNoMethod, :is_true? unless defined? super
|
42
|
+
super
|
43
|
+
end
|
44
|
+
|
45
|
+
def save_default name, value
|
46
|
+
return unless self[name].nil?
|
47
|
+
record = first_or_new_object(name)
|
48
|
+
if record.value != value
|
49
|
+
record.group ||= Golden::Setting.default_group
|
50
|
+
record.value = value
|
51
|
+
record.save!
|
52
|
+
end
|
53
|
+
value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def value
|
58
|
+
return if self[:value].nil?
|
59
|
+
YAML::load self[:value]
|
60
|
+
end
|
61
|
+
|
62
|
+
def value= new_value
|
63
|
+
self[:value] = new_value.to_yaml
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'golden/setting/version'
|
2
|
+
|
3
|
+
module Golden
|
4
|
+
module Setting
|
5
|
+
mattr_accessor :setting_class
|
6
|
+
@@setting_class = 'Setting'
|
7
|
+
|
8
|
+
mattr_accessor :table_name
|
9
|
+
@@table_name = 'golden_settings'
|
10
|
+
|
11
|
+
mattr_accessor :field_types
|
12
|
+
@@field_types = [
|
13
|
+
['string', :string],
|
14
|
+
['boolean', :boolean],
|
15
|
+
['select', :select],
|
16
|
+
['radio_buttons', :radio_buttons],
|
17
|
+
['check_boxes', :check_boxes]
|
18
|
+
]
|
19
|
+
|
20
|
+
mattr_accessor :groups
|
21
|
+
@@groups = []
|
22
|
+
|
23
|
+
mattr_accessor :default_group
|
24
|
+
@@default_group = ''
|
25
|
+
|
26
|
+
mattr_accessor :group_delimiter
|
27
|
+
@@group_delimiter = '.'
|
28
|
+
|
29
|
+
mattr_accessor :skip_groups_method
|
30
|
+
@@skip_groups_method = nil
|
31
|
+
|
32
|
+
mattr_accessor :skip_settings
|
33
|
+
@@skip_settings = []
|
34
|
+
|
35
|
+
mattr_accessor :default_tab
|
36
|
+
@@default_tab = ''
|
37
|
+
|
38
|
+
def self.configure
|
39
|
+
yield self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
require 'golden/setting/error'
|
45
|
+
require 'golden/setting/group'
|
46
|
+
require 'golden/setting/name'
|
47
|
+
require 'golden/setting/value'
|
48
|
+
require 'golden/setting/form_option'
|
49
|
+
require 'golden/setting/action'
|
50
|
+
require 'golden/setting/base'
|
51
|
+
require 'golden/setting/cache'
|
52
|
+
require 'golden/setting/resource'
|
53
|
+
|
54
|
+
require 'golden/setting/engine'
|
data/spec/base_spec.rb
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Golden::Setting::Base do
|
4
|
+
let(:golden) { '#F2BE45' }
|
5
|
+
let(:red) { '#C83C23' }
|
6
|
+
let(:now) { Time.now }
|
7
|
+
let(:languages) { %w(ruby html css javascript) }
|
8
|
+
let(:cart) { {pencil: 5, rubber: 2, book: languages} }
|
9
|
+
let(:cart_item) { {icecream: 3} }
|
10
|
+
let(:layout) { {'layout.color' => red, 'layout.background-color' => golden} }
|
11
|
+
|
12
|
+
context 'Value Type' do
|
13
|
+
it 'can deal with String value' do
|
14
|
+
Setting.color = golden
|
15
|
+
Setting.color.should eq golden
|
16
|
+
Setting.color.class.should be String
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'can deal with true value' do
|
20
|
+
Setting.editable = true
|
21
|
+
Setting.editable.should eq true
|
22
|
+
Setting.editable.class.should be TrueClass
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'can deal with false value' do
|
26
|
+
Setting.editable = false
|
27
|
+
Setting.editable.should eq false
|
28
|
+
Setting.editable.class.should be FalseClass
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'can deal with Symbol value' do
|
32
|
+
Setting.background = :golden
|
33
|
+
Setting.background.should eq :golden
|
34
|
+
Setting.background.class.should be Symbol
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'can deal with Time value' do
|
38
|
+
Setting.booted_at = now
|
39
|
+
Setting.booted_at.should eq now
|
40
|
+
Setting.booted_at.class.should be Time
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'can deal with Array value' do
|
44
|
+
Setting.languages = languages
|
45
|
+
Setting.languages.should eq languages
|
46
|
+
Setting.languages.class.should be Array
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'can deal with Hash value' do
|
50
|
+
Setting.shopping = cart
|
51
|
+
Setting.shopping.should eq cart
|
52
|
+
Setting.shopping.class.should be Hash
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'Naming' do
|
57
|
+
it 'can deal with complex name' do
|
58
|
+
Setting['layout.color'] = red
|
59
|
+
Setting['layout.color'].should eq red
|
60
|
+
Setting['layout.background-color'] = golden
|
61
|
+
Setting['layout.background-color'].should eq golden
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'Action' do
|
66
|
+
before :each do
|
67
|
+
Setting.destroy_all
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'can merge hash values' do
|
71
|
+
Setting.shopping = cart
|
72
|
+
Setting.merge! 'shopping', cart_item
|
73
|
+
Setting.shopping.should_not eq cart
|
74
|
+
Setting.shopping.should eq cart.merge(cart_item)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'can list settings' do
|
78
|
+
Setting.count.should eq 0
|
79
|
+
Setting.languages = languages
|
80
|
+
Setting['layout.color'] = red
|
81
|
+
Setting['layout.background-color'] = golden
|
82
|
+
Setting.count.should eq 3
|
83
|
+
Setting.all.count.should eq 3
|
84
|
+
Setting.list('layout.').count.should eq 2
|
85
|
+
Setting.list('layout.').should eq layout
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'can destory a setting' do
|
89
|
+
Setting.languages = languages
|
90
|
+
Setting.count.should eq 1
|
91
|
+
Setting.destroy :languages
|
92
|
+
Setting.languages.should eq nil
|
93
|
+
Setting.count.should eq 0
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context 'Default' do
|
98
|
+
before :each do
|
99
|
+
Setting.destroy_all
|
100
|
+
end
|
101
|
+
|
102
|
+
after :each do
|
103
|
+
Setting.defaults = {}.with_indifferent_access
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'can deal with default value' do
|
107
|
+
Setting.respond_to?(:defaults).should be true
|
108
|
+
Setting.color.should eq nil
|
109
|
+
Setting.defaults[:color] = golden
|
110
|
+
Setting.color.should eq golden
|
111
|
+
Setting.count.should eq 0
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'can save default value with default group' do
|
115
|
+
# Golden::Setting.default_group = 'theme'
|
116
|
+
Setting.respond_to?(:save_default).should be true
|
117
|
+
Setting.color.should eq nil
|
118
|
+
Setting.save_default :color, golden
|
119
|
+
Setting.named(:color).count.should eq 1
|
120
|
+
Setting.object(:color).value.should eq golden
|
121
|
+
Setting.object(:color).group.should eq Golden::Setting.default_group
|
122
|
+
Setting.color.should eq golden
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
data/spec/cache_spec.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Golden::Setting::Base with Cache' do
|
4
|
+
let(:golden) { '#F2BE45' }
|
5
|
+
let(:red) { '#C83C23' }
|
6
|
+
|
7
|
+
context 'Default' do
|
8
|
+
before :each do
|
9
|
+
CachedSetting.destroy_all
|
10
|
+
Rails.cache.clear
|
11
|
+
end
|
12
|
+
|
13
|
+
after :each do
|
14
|
+
CachedSetting.defaults = {}.with_indifferent_access
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'can use default value, while cached value of setting is nil' do
|
18
|
+
CachedSetting.respond_to?(:defaults).should be true
|
19
|
+
CachedSetting.color.should eq nil
|
20
|
+
CachedSetting.defaults[:color] = golden
|
21
|
+
CachedSetting.color.should eq golden
|
22
|
+
CachedSetting.count.should eq 0
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'can save default values, while cached value of setting is nil' do
|
26
|
+
CachedSetting.respond_to?(:save_default).should be true
|
27
|
+
CachedSetting.named(:color).count.should eq 0
|
28
|
+
CachedSetting.color.should be nil
|
29
|
+
|
30
|
+
CachedSetting.save_default :color, red
|
31
|
+
CachedSetting.named(:color).count.should eq 1
|
32
|
+
CachedSetting.object(:color).value.should eq red
|
33
|
+
CachedSetting.color.should eq red
|
34
|
+
|
35
|
+
CachedSetting.save_default :color, golden
|
36
|
+
CachedSetting.object(:color).value.should eq red
|
37
|
+
CachedSetting.color.should eq red
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Golden::Setting::Resource do
|
4
|
+
let(:golden) { '#F2BE45' }
|
5
|
+
let(:red) { '#C83C23' }
|
6
|
+
let(:manager) { Manager.where(email: 'test@example.com').create }
|
7
|
+
|
8
|
+
context 'Without Cache' do
|
9
|
+
before :each do
|
10
|
+
Setting.destroy_all
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'can set values only belong to manager' do
|
14
|
+
manager.settings.color = golden
|
15
|
+
manager.settings.color.should eq golden
|
16
|
+
|
17
|
+
manager.settings.named(:color).count.should eq 1
|
18
|
+
Setting.count.should eq 1
|
19
|
+
Setting.named(:color).count.should eq 0
|
20
|
+
Setting.color = red
|
21
|
+
Setting.named(:color).count.should eq 1
|
22
|
+
Setting.count.should eq 2
|
23
|
+
manager.settings.named(:color).count.should eq 1
|
24
|
+
end
|
25
|
+
|
26
|
+
it '#object need to #bind user first' do
|
27
|
+
manager.settings.color = golden
|
28
|
+
manager.settings.color.should eq golden
|
29
|
+
|
30
|
+
Setting.color.should be nil
|
31
|
+
Setting.object(:color).should eq nil
|
32
|
+
|
33
|
+
# bind would cause such wrong thing
|
34
|
+
Golden::Setting::Resource.object(:color).should_not be nil
|
35
|
+
Golden::Setting::Resource.object(:color).value.should eq golden
|
36
|
+
|
37
|
+
Golden::Setting::Resource.bind(manager).color.should eq golden
|
38
|
+
Golden::Setting::Resource.bind(manager)[:color].should eq golden
|
39
|
+
|
40
|
+
Golden::Setting::Resource.object(:color, manager).should_not be nil
|
41
|
+
Golden::Setting::Resource.object(:color, manager).value.should eq golden
|
42
|
+
|
43
|
+
Golden::Setting::Resource.unbind
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'returns a scope of users having any setting' do
|
47
|
+
pending
|
48
|
+
User.with_settings
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'returns a scope of users having a color setting' do
|
52
|
+
pending
|
53
|
+
User.with_settings_for('color')
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'returns a scope of users having no setting at all (means user.settings.all == {})' do
|
57
|
+
pending
|
58
|
+
User.without_settings
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'returns a scope of users having no color setting (means user.settings.color == nil)' do
|
62
|
+
pending
|
63
|
+
User.without_settings_for('color')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'With Cache' do
|
68
|
+
before :each do
|
69
|
+
Setting.destroy_all
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
$LOAD_PATH.unshift File.dirname(__FILE__)
|
2
|
+
|
3
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
4
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
5
|
+
require 'active_support/concern'
|
6
|
+
require 'action_dispatch'
|
7
|
+
module Rails
|
8
|
+
class << self
|
9
|
+
def env
|
10
|
+
@_env ||= 'test'
|
11
|
+
end
|
12
|
+
|
13
|
+
def cache
|
14
|
+
@cache ||= ActiveSupport::Cache::MemoryStore.new
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
require 'rails/engine'
|
19
|
+
require 'rails/railtie'
|
20
|
+
require 'active_record'
|
21
|
+
|
22
|
+
require 'golden/setting'
|
23
|
+
Golden::Setting::Engine.config.autoload_paths.each do |path|
|
24
|
+
$LOAD_PATH.unshift path
|
25
|
+
end
|
26
|
+
require 'golden/setting/resourced'
|
27
|
+
|
28
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
config.order = 'random'
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
|
3
|
+
class ::Setting < Golden::Setting::Base
|
4
|
+
end
|
5
|
+
|
6
|
+
class ::CachedSetting < Golden::Setting::Base
|
7
|
+
include Golden::Setting::Cache
|
8
|
+
end
|
9
|
+
|
10
|
+
class User < ::ActiveRecord::Base
|
11
|
+
end
|
12
|
+
|
13
|
+
class Manager < User
|
14
|
+
include Golden::Setting::Resourced
|
15
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'active_support/core_ext/logger'
|
2
|
+
require 'active_record'
|
3
|
+
require 'sqlite3'
|
4
|
+
|
5
|
+
# ActiveRecord::Base.logger = Logger.new(STDOUT)
|
6
|
+
ActiveRecord::Base.configurations = true
|
7
|
+
ActiveRecord::Base.establish_connection(
|
8
|
+
adapter: 'sqlite3',
|
9
|
+
database: ':memory:'
|
10
|
+
)
|
11
|
+
|
12
|
+
ActiveRecord::Schema.verbose = false
|
13
|
+
ActiveRecord::Schema.define(version: 1) do
|
14
|
+
create_table :golden_settings do |t|
|
15
|
+
t.string :group
|
16
|
+
t.string :name, null: false
|
17
|
+
t.text :value
|
18
|
+
t.string :form_options
|
19
|
+
t.references :resource, polymorphic: true
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
|
23
|
+
create_table :users do |t|
|
24
|
+
t.string :email, null: false
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: golden-setting
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tse-Ching Ho
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.2.13
|
20
|
+
- - <
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.13
|
30
|
+
- - <
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: railties
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 3.2.13
|
40
|
+
- - <
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '5'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 3.2.13
|
50
|
+
- - <
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '5'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: bundler
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.3'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '1.3'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rake
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rspec
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 2.13.0
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.13.0
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: sqlite3
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
description: Golden Setting persists settings in database and keep alive in cache.
|
110
|
+
email:
|
111
|
+
- tsechingho@gmail.com
|
112
|
+
executables: []
|
113
|
+
extensions: []
|
114
|
+
extra_rdoc_files: []
|
115
|
+
files:
|
116
|
+
- .gitignore
|
117
|
+
- Gemfile
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.md
|
120
|
+
- Rakefile
|
121
|
+
- app/assets/javascripts/golden/setting/settings.js.coffee
|
122
|
+
- app/assets/stylesheets/golden/setting/settings.css.sass
|
123
|
+
- app/controllers/golden/setting/settings_controller.rb
|
124
|
+
- app/helpers/golden/setting/settings_helper.rb
|
125
|
+
- app/models/concerns/golden/setting/resourced.rb
|
126
|
+
- app/views/golden/setting/settings/_batch_form.html.erb
|
127
|
+
- app/views/golden/setting/settings/_form.html.erb
|
128
|
+
- app/views/golden/setting/settings/_setting.html.erb
|
129
|
+
- app/views/golden/setting/settings/_table.html.erb
|
130
|
+
- app/views/golden/setting/settings/edit.html.erb
|
131
|
+
- app/views/golden/setting/settings/index.html.erb
|
132
|
+
- app/views/golden/setting/settings/list.html.erb
|
133
|
+
- app/views/golden/setting/settings/new.html.erb
|
134
|
+
- app/views/golden/setting/settings/show.html.erb
|
135
|
+
- config/locales/settings.en.yml
|
136
|
+
- config/locales/settings.zh-TW.yml
|
137
|
+
- config/routes.rb
|
138
|
+
- golden-setting.gemspec
|
139
|
+
- lib/generators/golden/setting/USAGE
|
140
|
+
- lib/generators/golden/setting/install_generator.rb
|
141
|
+
- lib/generators/golden/setting/templates/create_golden_settings.rb
|
142
|
+
- lib/generators/golden/setting/templates/golden_setting.rb
|
143
|
+
- lib/generators/golden/setting/templates/setting.rb
|
144
|
+
- lib/generators/golden/setting/templates/settings.en.yml
|
145
|
+
- lib/generators/golden/setting/templates/settings.zh-TW.yml
|
146
|
+
- lib/golden/setting.rb
|
147
|
+
- lib/golden/setting/action.rb
|
148
|
+
- lib/golden/setting/base.rb
|
149
|
+
- lib/golden/setting/cache.rb
|
150
|
+
- lib/golden/setting/engine.rb
|
151
|
+
- lib/golden/setting/error.rb
|
152
|
+
- lib/golden/setting/form_option.rb
|
153
|
+
- lib/golden/setting/group.rb
|
154
|
+
- lib/golden/setting/name.rb
|
155
|
+
- lib/golden/setting/resource.rb
|
156
|
+
- lib/golden/setting/value.rb
|
157
|
+
- lib/golden/setting/version.rb
|
158
|
+
- spec/base_spec.rb
|
159
|
+
- spec/cache_spec.rb
|
160
|
+
- spec/resource_spec.rb
|
161
|
+
- spec/spec_helper.rb
|
162
|
+
- spec/support/models.rb
|
163
|
+
- spec/support/schema.rb
|
164
|
+
homepage: https://github.com/goldenio/golden-setting
|
165
|
+
licenses:
|
166
|
+
- MIT
|
167
|
+
metadata: {}
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - '>='
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
requirements: []
|
183
|
+
rubyforge_project:
|
184
|
+
rubygems_version: 2.0.0
|
185
|
+
signing_key:
|
186
|
+
specification_version: 4
|
187
|
+
summary: persists settings in database and keep alive in cache.
|
188
|
+
test_files:
|
189
|
+
- spec/base_spec.rb
|
190
|
+
- spec/cache_spec.rb
|
191
|
+
- spec/resource_spec.rb
|
192
|
+
- spec/spec_helper.rb
|
193
|
+
- spec/support/models.rb
|
194
|
+
- spec/support/schema.rb
|