feature_setting 1.4.0 → 1.5.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: 6687c023f1275645ce2b345fadfde38336bb20e8
4
- data.tar.gz: f4cdd18d578ac303cac874fa09faeb0db41033bf
3
+ metadata.gz: d4fcf406cfb27d34af0b6fcac49894568ae0645d
4
+ data.tar.gz: 40899bb8ffcdf7ff43b7272878e2ba1995eddbca
5
5
  SHA512:
6
- metadata.gz: 53e55b5bf5d1586ec556b0be1f73492038aadb62cc970d1353f7feaf545747c388cb8990c70e60e25faae3c8871c3686fdae9dc316af46bf0bdecbae4074b5f1
7
- data.tar.gz: 3b3819bb3c31274a749b30fd5c9caa3476e19767a7b269ca1813706a4da16b55b447a4e3630c851db7c539d9fda3275dd91a16e183d283ad3deccbad48133b63
6
+ metadata.gz: a5e62e3c6459c8c5fc767cae6cc197566382af656dd8194e8c2a588b6e8f570510c88c1fba9c89a7fa60ed4db21f8b25a8701e3e737cb9fd1ef96a1c3f0c3e16
7
+ data.tar.gz: ea64f89f51f738a55e85b32d09cd1892e0d34e80449e4967ede00bdc058da5b952169d93744550cab8ff2bc22644b4889d0d417f34458b14614a7c701d2189cd
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  This gem introduces the concept of "features" and "settings" to your Rails app. It provides an easy way to define such features and settings with default values right in your code and will persist them in the database.
6
6
 
7
7
  - a feature is a key that can either be enabled or disabled
8
- - a setting is a key that has a value (of type String, Fixnum, Float, or Array)
8
+ - a setting is a key that has a value (of type String, Fixnum, Float, Array, or Hash)
9
9
 
10
10
  In practice, features can be used to switch certain functionality in your code on or off. This can be used to roll out functionality without the need to deploy. Settings are very flexible in that they can hold any value. The possibilities are endless. They should not be used to store application secrets, such as tokens, passwords, and keys. Those type of settings should rather be stored in environment variables using tools like [https://github.com/bkeepers/dotenv](dotenv).
11
11
 
@@ -116,7 +116,7 @@ Settings.set!(:setting_one, 1000)
116
116
  Settings.set!('setting_one', 1000)
117
117
  ```
118
118
 
119
- Default values for settings are defined in your class and current values are persisted in the database.
119
+ Default values for settings are defined in your class and current values are persisted in the database.
120
120
 
121
121
  Settings support the following datatypes:
122
122
 
@@ -171,7 +171,7 @@ Notes:
171
171
 
172
172
  The MIT License (MIT)
173
173
 
174
- Copyright (c) 2015 Indro De ([http://indrode.com](http://indrode.com))
174
+ Copyright (c) 2015, 2016 Indro De ([http://indrode.com](http://indrode.com))
175
175
 
176
176
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
177
177
 
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_runtime_dependency 'activesupport', '>= 4.0'
21
21
  spec.add_runtime_dependency 'activerecord', '>= 4.0'
22
+ spec.add_runtime_dependency 'hashie', '>= 3.4.3'
22
23
  spec.add_development_dependency 'bundler', '>= 1.9'
23
24
  spec.add_development_dependency 'rake', '>= 10.0'
24
25
  spec.add_development_dependency 'rspec', '>= 3.0'
@@ -104,7 +104,7 @@ module FeatureSetting
104
104
  when 'Array'
105
105
  value.split('|||')
106
106
  when 'Hash'
107
- JSON.parse(value).try(:with_indifferent_access)
107
+ Hashie::Mash.new(JSON.parse(value))
108
108
  end
109
109
  end
110
110
 
@@ -114,6 +114,8 @@ module FeatureSetting
114
114
  value.to_json
115
115
  when 'Array'
116
116
  value.join('|||')
117
+ when 'Hash'
118
+ value.to_json
117
119
  else
118
120
  value.to_s
119
121
  end
@@ -1,3 +1,3 @@
1
1
  module FeatureSetting
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_setting
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indro De
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.4.3
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.4.3
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
182
  version: '0'
169
183
  requirements: []
170
184
  rubyforge_project:
171
- rubygems_version: 2.5.1
185
+ rubygems_version: 2.4.5
172
186
  signing_key:
173
187
  specification_version: 4
174
188
  summary: A lightweight feature/setting DSL for Rails applications.