-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Stex/release/1.0
Release/1.0
- Loading branch information
Showing
109 changed files
with
2,525 additions
and
2,294 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.3 | ||
Exclude: | ||
- tmp/**/* | ||
- gemfiles/**/* | ||
|
||
#--------------------------------------------- | ||
# Layout | ||
#--------------------------------------------- | ||
|
||
# Hashes do not need padding | ||
Layout/SpaceInsideHashLiteralBraces: | ||
Enabled: false | ||
|
||
# Allow 2 space indentation for when inside a case | ||
Layout/CaseIndentation: | ||
Enabled: false | ||
|
||
# Allow empty lines in classes | ||
Layout/EmptyLinesAroundClassBody: | ||
Enabled: false | ||
|
||
# Allow multiple spaces before first argument | ||
Layout/SpaceBeforeFirstArg: | ||
Enabled: false | ||
|
||
# Allow extra spacing, e.g. to align components | ||
Layout/ExtraSpacing: | ||
Enabled: false | ||
|
||
# Usually good, but in some cases not possible | ||
Layout/AlignHash: | ||
Enabled: false | ||
|
||
# Allow an empty line after do / before end | ||
Layout/EmptyLinesAroundBlockBody: | ||
Enabled: false | ||
|
||
# Again, generally a good idea, but it has problems with multiline operations in | ||
# combination with assignments | ||
Layout/MultilineOperationIndentation: | ||
Enabled: false | ||
|
||
# See the corresponding other cops | ||
Layout/EmptyLinesAroundModuleBody: | ||
Enabled: false | ||
|
||
Layout/SpaceInLambdaLiteral: | ||
Enabled: false | ||
|
||
#--------------------------------------------- | ||
# Metrics | ||
#--------------------------------------------- | ||
|
||
# Allow bigger classes | ||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
Max: 120 | ||
|
||
# To make it possible to copy or click on URIs in the code, we allow lines | ||
# containing a URI to be longer than Max. | ||
AllowHeredoc: true | ||
AllowURI: true | ||
|
||
Metrics/BlockLength: | ||
Max: 75 | ||
Exclude: | ||
- spec/**/*.rb | ||
|
||
# Allow longer methods | ||
Metrics/MethodLength: | ||
Enabled: false | ||
|
||
# Allow bigger modules | ||
Metrics/ModuleLength: | ||
Enabled: false | ||
|
||
#--------------------------------------------- | ||
# Naming | ||
#--------------------------------------------- | ||
|
||
Naming/HeredocDelimiterNaming: | ||
Enabled: false | ||
|
||
#--------------------------------------------- | ||
# Style | ||
#--------------------------------------------- | ||
|
||
# Allow fail() for initial exception, raise() for re-raise | ||
# It seems that the cop decision was mainly based on "more people use raise than fail"... | ||
Style/SignalException: | ||
Enabled: false | ||
|
||
# Allow assigning multiple variables in one line. | ||
# This should not be overused, but comes in handy when assigning initializer values to instance variables | ||
Style/ParallelAssignment: | ||
Enabled: false | ||
|
||
# Depending on the situation, it might make more sense to use | ||
# [:symbol1, :symbol2] over %i[symbol1 symbol2], e.g. for multiline aligning reasons. | ||
Style/SymbolArray: | ||
Enabled: false | ||
|
||
# Not all modules have to have top level comments | ||
Style/Documentation: | ||
Enabled: false | ||
|
||
# Allow class variable usage | ||
Style/ClassVars: | ||
Enabled: false | ||
|
||
# Allow block comments | ||
Style/BlockComments: | ||
Enabled: false | ||
|
||
# Allow the use of !! (conversion of nil/object to true/false) | ||
Style/DoubleNegation: | ||
Enabled: false | ||
|
||
# Allow unless/if blocks even for one-liners | ||
Style/IfUnlessModifier: | ||
Enabled: false | ||
|
||
Style/GuardClause: | ||
Enabled: false | ||
|
||
Style/MissingRespondToMissing: | ||
Exclude: | ||
- lib/setting_accessors/setting_scaffold.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,23 @@ language: ruby | |
cache: bundler | ||
|
||
rvm: | ||
- 2.2 | ||
- 2.3.1 | ||
- 2.3.0 | ||
- 2.3.3 | ||
- 2.4.0 | ||
- 2.4.4 | ||
- 2.5.0 | ||
- 2.5.3 | ||
|
||
env: | ||
- DISABLE_DATABASE_ENVIRONMENT_CHECK=1 | ||
gemfile: | ||
- gemfiles/rails_4.2.gemfile | ||
- gemfiles/rails_5.0.gemfile | ||
- gemfiles/rails_5.1.gemfile | ||
- gemfiles/rails_5.2.gemfile | ||
|
||
before_install: 'gem install bundler' | ||
script: 'bundle exec rake' | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_failure: change | ||
on_success: never | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
appraise 'rails-4.2' do | ||
gem 'rails', '~> 4.2.0' | ||
end | ||
|
||
appraise 'rails-5.0' do | ||
gem 'rails', '~> 5.0.0' | ||
end | ||
|
||
appraise 'rails-5.1' do | ||
gem 'rails', '~> 5.1.0' | ||
end | ||
|
||
appraise 'rails-5.2' do | ||
gem 'rails', '~> 5.2.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
# Changelog | ||
|
||
## 1.0.0 | ||
|
||
This is almost a complete refactoring of the gem which also removes some not really needed functionality. | ||
It is the first release fully compatible with Rails 5. | ||
|
||
New minimum versions: | ||
|
||
* Ruby: 2.3 | ||
* Rails: 4.2 | ||
|
||
#### General | ||
|
||
* Removed globally defined settings (`config/settings.yml`) and therefore also global validations and type conversions. | ||
It is still possible to create global Settings, but each developer has to make sure that the assigned | ||
value is valid and correctly typed. | ||
* Type conversion follows AR's type conversions more strictly now. | ||
This means that e.g. assigning `1.0` to a boolean setting will result in `true` instead of `nil` as before. | ||
* Updating an attribute created through `setting_accessor` now leads to the record being touched, | ||
similar to what would happen when a normal database attribute was changed. (#4) | ||
* Setting a new value for an attribute created through `attribute_accessor` will now mark | ||
the record as "dirty", meaning `changed?` returns true. (#9) | ||
This was especially needed for Rails 5 as it only even performs a database operation in this case. | ||
|
||
#### Tests | ||
|
||
* Tests are now written in RSpec | ||
* The dummy Rails application has been removed and replaced with `with_model` | ||
* Appraisal was added to test against multiple Rails versions | ||
|
||
#### API Changes | ||
|
||
* `method_missing` is now part of the SettingScaffold and therefore no longer needed in the actual Setting model. | ||
You should remove `method_missing` from your model. | ||
* Setting.create_or_update was renamed to Setting.set and now uses a keyword argument for `assignable` | ||
* `setting_accessor` no longer supports the `fallback` option. | ||
If a `default` option is given, it is automatically used as fallback. | ||
|
||
## 0.3.0 | ||
|
||
* Fixed a bug that caused setting accessors not being initialized when being called as part of a rake task chain (#6) | ||
* Fixed a bug that caused setting accessors not being initialized when being called as part of a rake task chain (#6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.