kinetic_cafe_error 1.10 → 1.11

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: ed2b06cb85a613bdd8ac56aa6e8216188f257395
4
- data.tar.gz: 7077a564338ef9bb8f885c51e86c36033b975671
3
+ metadata.gz: 3e59520ae4c59e3bd05ea5222fd800317d735457
4
+ data.tar.gz: f7e38457bc7b25ec96c4201a7859b55169100a4d
5
5
  SHA512:
6
- metadata.gz: 94f9b44dbd23fe6ac116dae799503402231d89d7ceb76fdec18cd781c6933d09e7ad471626bc515cfdd324275b25d11cd05981f6a1edb71dde6f530e8ab3840b
7
- data.tar.gz: c0c6d9491699c4b9f184774552688b35c8fe0b21514e865d26811a4e488b7c5239329335850ab4fc6c4b42b3ddc26ac8ec1874e4f21ececbf9c0d2489c3b59b2
6
+ metadata.gz: 2653e7d7e1e214028c91eb1e4ed9ab9249b1cf06f6a24f3fd8f831f07aa942c9259db0a121ac114939705c8eaa0ef21fd752300fd14e1b03109f4018591a09a8
7
+ data.tar.gz: 398211ce16cfa01a58dd9a105d025ac7c96b4011d9f0caf2b1451afc3a12240da7cfa31367c76d7b38a02dc8bf1b0a08331bbe562f730c27601a86e737945996
@@ -0,0 +1,72 @@
1
+ ## Contributing
2
+
3
+ We value any contribution to kinetic_cafe_error you can provide: a bug report,
4
+ a feature request, or code contributions. kinetic_cafe_error is reasonably
5
+ complex code, so there are a few code guidelines:
6
+
7
+ * Changes *will not* be accepted without tests. The test suite is written
8
+ with [Minitest][].
9
+ * Match our coding style.
10
+ * Use a thoughtfully-named topic branch that contains your change. Rebase
11
+ your commits into logical chunks as necessary.
12
+ * Use [quality commit messages][].
13
+ * Do not change the version number; when your patch is accepted and a release
14
+ is made, the version will be updated at that point.
15
+ * Submit a GitHub pull request with your changes.
16
+ * New behaviours require new or updated documentation.
17
+
18
+ ### Test Dependencies
19
+
20
+ kinetic_cafe_error uses Ryan Davis’s [Hoe][] to manage the release process,
21
+ which adds a number of rake tasks. You will mostly be interested in:
22
+
23
+ $ rake
24
+
25
+ which runs the tests the same way that:
26
+
27
+ $ rake test
28
+ $ rake travis
29
+
30
+ will do.
31
+
32
+ To assist with the installation of the development dependencies for
33
+ kinetic_cafe_error, I have provided the simplest possible Gemfile pointing to
34
+ the (generated) `kinetic_cafe_error.gemspec` file. This will permit you to do:
35
+
36
+ $ bundle install
37
+
38
+ to get the development dependencies. If you aleady have `hoe` installed, you
39
+ can accomplish the same thing with:
40
+
41
+ $ rake newb
42
+
43
+ This task will install any missing dependencies, run the tests/specs, and
44
+ generate the RDoc.
45
+
46
+ ### Workflow
47
+
48
+ Here's the most direct way to get your work merged into the project:
49
+
50
+ * Fork the project.
51
+ * Clone down your fork (`git clone
52
+ git://github.com/<username>/kinetic_cafe_error.git`).
53
+ * Create a topic branch to contain your change (`git checkout -b
54
+ my_awesome_feature`).
55
+ * Hack away, add tests. Not necessarily in that order.
56
+ * Make sure everything still passes by running `rake`.
57
+ * If necessary, rebase your commits into logical chunks, without errors.
58
+ * Push the branch up (`git push origin my_awesome_feature`).
59
+ * Create a pull request against halostatue/kinetic_cafe_error and describe
60
+ what your change does and the why you think it should be merged.
61
+
62
+ ### Contributors
63
+
64
+ * Austin Ziegler [@halostatue](https://github.com/halostatue) created
65
+ kinetic_cafe_error.
66
+ * Jero Sutlovic [@jsutlovic](https://github.com/jsutlovic)
67
+ * Ravi Desai [@ravster](https://github.com/ravster)
68
+
69
+ [Minitest]: https://github.com/seattlerb/minitest
70
+ [quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
71
+ [Hoe]: https://github.com/seattlerb/hoe
72
+ [kccoc]: https://github.com/KineticCafe/code-of-conduct
@@ -0,0 +1,226 @@
1
+ ### 1.11 / 2016-05-24
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * If the controller instance does not respond to the 'respond_to' method,
6
+ then we want to default to rendering a JSON response.
7
+
8
+ * 2 minor configuration changes:
9
+
10
+ * Add a .hoerc file so that we don't have errors on Travis CI.
11
+
12
+ * Add dependency_decisions.yml to whitelist dependencies by license.
13
+
14
+ * 1 governance change:
15
+
16
+ * kinetic_cafe_error is now governed under the Kinetic Cafe Open Source
17
+ [Code of Conduct][kccoc].
18
+
19
+ ### 1.10 / 2016-03-25
20
+
21
+ * 1 bug fix:
22
+
23
+ * Protect against names with punctuation in them.
24
+
25
+ * 1 testing change:
26
+
27
+ * Add Appraisals to test against both Rack 1.6 and Rack 2.0.
28
+
29
+ ### 1.9 / 2015-11-30
30
+
31
+ * 2 bug fixes:
32
+
33
+ * The #stringify method needed to be moved to KineticCafe::ErrorModule so
34
+ that hierarchies *not* built from KineticCafe::Error can properly use
35
+ query parameter parsing.
36
+
37
+ * kinetic_cafe_error has required Ruby 2.1 or higher since version 1.5
38
+ because of the inclusion of i18n-tasks as a dependency. This is now
39
+ reflected in the dependencies.
40
+
41
+ ### 1.8.1 / 2015-10-26
42
+
43
+ * Re-release because 1.8 was yanked
44
+
45
+ ### 1.8 / 2015-10-26
46
+
47
+ * 1 minor enhancement:
48
+
49
+ * Add `kinetic_cafe_error_handle_post_error` to allow for capturing or
50
+ post-processing of errors after logging and handling.
51
+
52
+ ### 1.7 / 2015-08-05
53
+
54
+ * 1 minor enhancement:
55
+
56
+ * Add a `params` parameter to the `kcerror:defined` task that
57
+ will show the parameter names the exception expects.
58
+
59
+ * 1 bug fix:
60
+
61
+ * RubyMine does not fully initialize the project when running RSpec,
62
+ meaning that while Rake is defined, Rake::DSL is not. As such, we need
63
+ to prevent the Rake task from loading unless Rake::DSL is present.
64
+
65
+ ### 1.6 / 2015-07-30
66
+
67
+ * 2 minor enhancements:
68
+
69
+ * Improve the Minitest and RSpec test helpers so that they ignore the
70
+ error `cause` if it is not included as part of the assertion. The
71
+ specification of the `cause` is recommended if you have specific values
72
+ you want to compare.
73
+
74
+ * Improve `kinetic_cafe_error_handler` so that if it is called with an
75
+ error class instead of an instance of an error, it will construct the
76
+ error instance with the provided parameters. This makes custom
77
+ `rescue_from` constructions cleaner.
78
+
79
+ ### 1.5 / 2015-07-29
80
+
81
+ * 2 bug fixes:
82
+
83
+ * Handle error causes correctly for Ruby 2.1 or later, where `raise
84
+ Exception, cause: RuntimeError.new` does not pass the `cause` the
85
+ exception constructor, but it still sets the cause correctly on the
86
+ exception. These changes make this correct for both `raise`
87
+ construction and normal construction.
88
+
89
+ * The RSpec helpers did not work because they spelled the class `Rspec`,
90
+ not `RSpec`. This has been fixed.
91
+
92
+ * 2 development changes:
93
+
94
+ * Fixed some test typos.
95
+
96
+ * Add i18n-tasks for CSV exports.
97
+
98
+ ### 1.4.1 / 2015-07-08
99
+
100
+ * 1 bug fix
101
+
102
+ * Fixed an error with loading error_tasks.rake from the Rails engine.
103
+
104
+ ### 1.4 / 2015-07-07
105
+
106
+ * 2 minor enhancements
107
+
108
+ * Changed how kcerror:translations generates the translation YAML for
109
+ consistent comparison (it no longer uses the YAML library to do this).
110
+ The file generated will always be for language `kc` so that this can be
111
+ used with i18n-tasks.
112
+
113
+ * 4 bug fixes
114
+
115
+ * Task kcerror:defined would error out if there were no defined
116
+ descendants.
117
+ * Task kcerror:translations would error out if there were no defined
118
+ descendants.
119
+ * Made task loading more reliable and automatic.
120
+ * Removed some defaulted, unused parameters for
121
+ `assert_response_kc_error_html` (Minitest) and `be_kc_error_html`
122
+ (RSpec).
123
+
124
+ * Notes:
125
+
126
+ * Applied Rubocop to enforce the KineticCafe house style.
127
+
128
+ ### 1.3 / 2015-06-18
129
+
130
+ * 3 minor enhancements
131
+
132
+ * Added a controller method, `kinetic_cafe_error_handler_log_error`, in
133
+ KineticCafe::ErrorHandler that will log the given error in the default
134
+ logging language, and its cause, if any.
135
+
136
+ * Added a controller class method to change the default logging language
137
+ for `kinetic_cafe_error_handler_log_error`. A locale may be provided
138
+ with `kinetic_cafe_error_handler_log_locale`. Fixes
139
+ [#2]{https://github.com/KineticCafe/kinetic_cafe_error/issues/2}.
140
+
141
+ * Added an optional `locale` parameter to
142
+ KineticCafe::ErrorModule#message and
143
+ KineticCafe::ErrorModule::#i18n_message. If I18n is present and
144
+ `locale` is provided, the translation will *not* be cached and the
145
+ translation will be performed using the provided locale.
146
+
147
+ * 1 bug fixed
148
+
149
+ * The Minitest assertion, `assert_kc_error`, could not work because it
150
+ was looking for descendants of KineticCafe::ErrorDSL, not
151
+ KineticCafe::ErrorModule. Reported by @richardsondx as
152
+ [#3]{https://github.com/KineticCafe/kinetic_cafe_error/issues/3} during
153
+ a pairing session.
154
+
155
+ ### 1.2 / 2015-06-08
156
+
157
+ * 1 major enhancement
158
+
159
+ * Changed the preferred way of creating an error hierarchy from just
160
+ extending the error class with KineticCafe::ErrorDSL to calling
161
+ KineticCafe.create_hierarchy. Among other options this provides, the
162
+ automatic creation of helper methods and errors based on Rack::Utils
163
+ status codes can be controlled.
164
+
165
+ * 5 minor enhancements
166
+
167
+ * Renamed KineticCafe#header_only? to KineticCafe#header? The old version
168
+ is still present but deprecated. Similarly, the option to
169
+ KineticCafe::ErrorDSL#define_error is now called `header`, but
170
+ `header_only` also works.
171
+
172
+ * Added an option, `i18n_params` to KineticCafe::ErrorDSL#define_error,
173
+ used to describe the I18n parameters that are expected to be provided
174
+ to the error for translations. This gets defined as a class method on
175
+ the new error. This should be passed as an array.
176
+
177
+ * Extracted most of the 'magic' functionality to KineticCafe::ErrorModule
178
+ so that useful hierarchies can be generated without inheriting directly
179
+ from KineticCafe::Error.
180
+
181
+ * Added a class method to the Rails controller concern to generate a new
182
+ rescue_from for a non-KineticCafe::Error-derived exception.
183
+
184
+ * Added a pair of rake tasks, kcerror:defined (shows defined errors) and
185
+ kcerror:translations (generates a sample translation key file).
186
+ Automatically inserted for Rails applications.
187
+
188
+ ### 1.1 / 2015-06-05
189
+
190
+ * 7 minor enhancements
191
+
192
+ * Added Minitest assertions and expectations.
193
+ * Added Rspec expectation matchers.
194
+ * Changed the error table to be a partial and renamed keys to support
195
+ this change (kinetic_cafe_error/_table.html.*). Removed the previous
196
+ key. Now an error is nominally embeddable in your own views without
197
+ being a full page.
198
+ * Added HAML templates.
199
+ * Added Slim templates.
200
+ * Move error page to `kinetic_cafe_error/page.html.*` instead of
201
+ `kinetic_cafe/error/page.html.*`. This could be a breaking change, but
202
+ I consider it low risk.
203
+ * Added KineticCafe::Error#code as an alias for KineticCafe::Error#i18n_key.
204
+
205
+ * 2 minor bugfixes:
206
+
207
+ * The en and fr translation files were reporting en-CA and fr-CA as their
208
+ locales, which is incorrect.
209
+
210
+ * Renamed locale files to better match their names to their locales. The
211
+ locale is not en_ca, but en-CA.
212
+
213
+ ### 1.0.1 / 2015-05-27
214
+
215
+ * 1 minor bugfix
216
+
217
+ * Mac OS X is not case-sensitive and I do not currently have
218
+ Rails-specific tests.
219
+
220
+ ### 1.0.0 / 2015-05-27
221
+
222
+ * 1 major enhancement
223
+
224
+ * Birthday!
225
+
226
+ [kccoc]: https://github.com/KineticCafe/code-of-conduct
@@ -1,8 +1,8 @@
1
- == Licence
1
+ ## Licence
2
2
 
3
3
  This software is available under an MIT-style licence.
4
4
 
5
- * Copyright 2015 Austin Ziegler &amp; Kinetic Cafe
5
+ * Copyright 2015–2016 Austin Ziegler &amp; Kinetic Cafe
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy of
8
8
  this software and associated documentation files (the "Software"), to deal in
@@ -11,9 +11,9 @@ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11
11
  of the Software, and to permit persons to whom the Software is furnished to do
12
12
  so, subject to the following conditions:
13
13
 
14
- * The names of its contributors may not be used to endorse or promote
15
- products derived from this software without specific prior written
16
- permission.
14
+ * The names of its contributors may not be used to endorse or promote
15
+ products derived from this software without specific prior written
16
+ permission.
17
17
 
18
18
  The above copyright notice and this permission notice shall be included in all
19
19
  copies or substantial portions of the Software.
@@ -1,12 +1,6 @@
1
- .autotest
2
- .gemtest
3
- .rubocop.yml
4
- .travis.yml
5
- Appraisals
6
- Contributing.rdoc
7
- Gemfile
8
- History.rdoc
9
- Licence.rdoc
1
+ Contributing.md
2
+ History.md
3
+ Licence.md
10
4
  Manifest.txt
11
5
  README.rdoc
12
6
  Rakefile
@@ -24,8 +18,6 @@ config/locales/kinetic_cafe_error.en-US.yml
24
18
  config/locales/kinetic_cafe_error.en.yml
25
19
  config/locales/kinetic_cafe_error.fr-CA.yml
26
20
  config/locales/kinetic_cafe_error.fr.yml
27
- gemfiles/rack_1.6.gemfile
28
- gemfiles/rack_2.gemfile
29
21
  lib/kinetic_cafe/error.rb
30
22
  lib/kinetic_cafe/error/minitest.rb
31
23
  lib/kinetic_cafe/error_dsl.rb
@@ -133,5 +133,10 @@ And require where needed in your application:
133
133
 
134
134
  require 'kinetic_cafe_error'
135
135
 
136
- :include: Contributing.rdoc
137
- :include: Licence.rdoc
136
+ == Community and Contributing
137
+
138
+ kinetic_cafe_error welcomes your contributions as described in
139
+ {Contributing.md}[https://github.com/KineticCafe/kinetic_cafe_error/blob/master/Contributing.md].
140
+ This project, like all Kinetic Cafe {open source
141
+ projects}[https://github.com/KineticCafe], is under the Kinetic Cafe Open
142
+ Source {Code of Conduct}[https://github.com/KineticCafe/code-of-conduct].
data/Rakefile CHANGED
@@ -1,28 +1,30 @@
1
- # -*- ruby encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
  require 'rake/clean'
6
6
 
7
7
  Hoe.plugin :doofus
8
+ Hoe.plugin :email unless ENV['CI'] || ENV['TRAVIS']
8
9
  Hoe.plugin :gemspec2
9
10
  Hoe.plugin :git
10
11
  Hoe.plugin :minitest
12
+ Hoe.plugin :rubygems
11
13
  Hoe.plugin :travis
12
- Hoe.plugin :email unless ENV['CI'] || ENV['TRAVIS']
13
14
 
14
15
  spec = Hoe.spec 'kinetic_cafe_error' do
15
16
  developer('Austin Ziegler', 'aziegler@kineticcafe.com')
16
17
  developer('Jero Sutlovic', 'jsutlovic@kineticcafe.com')
18
+ developer('Ravi Desai', 'rdesai@kineticcafe.com')
17
19
 
18
- require_ruby_version '>= 2.1'
19
-
20
- self.history_file = 'History.rdoc'
20
+ self.history_file = 'History.md'
21
21
  self.readme_file = 'README.rdoc'
22
- self.extra_rdoc_files = FileList['*.rdoc'].to_a
23
22
 
24
23
  license 'MIT'
25
24
 
25
+ ruby21!
26
+
27
+
26
28
  extra_dev_deps << ['appraisal', '~> 2.1']
27
29
  extra_dev_deps << ['hoe-doofus', '~> 1.0']
28
30
  extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
@@ -36,7 +38,7 @@ spec = Hoe.spec 'kinetic_cafe_error' do
36
38
  extra_dev_deps << ['minitest-moar', '~> 0.0']
37
39
  extra_dev_deps << ['minitest-stub-const', '~> 0.4']
38
40
  extra_dev_deps << ['rack-test', '~> 0.6']
39
- extra_dev_deps << ['rake', '~> 10.0']
41
+ extra_dev_deps << ['rake', '>= 10.0', '< 12']
40
42
  extra_dev_deps << ['i18n-tasks', '~> 0.8']
41
43
  extra_dev_deps << ['i18n-tasks-csv', '~> 1.0']
42
44
  extra_dev_deps << ['rubocop', '~> 0.32']
@@ -44,27 +46,31 @@ spec = Hoe.spec 'kinetic_cafe_error' do
44
46
  extra_dev_deps << ['coveralls', '~> 0.8']
45
47
  end
46
48
 
49
+ ENV['RUBYOPT'] = '-W0'
50
+
51
+ module Hoe::Publish #:nodoc:
52
+ alias __make_rdoc_cmd__errhead__ make_rdoc_cmd
53
+
54
+ def make_rdoc_cmd(*extra_args) # :nodoc:
55
+ spec.extra_rdoc_files.delete_if { |f| f == 'Manifest.txt' }
56
+ __make_rdoc_cmd__errhead__(*extra_args)
57
+ end
58
+ end
59
+
47
60
  namespace :test do
48
- task :coverage do
49
- spec.test_prelude = [
50
- 'require "simplecov"',
51
- 'SimpleCov.start("test_frameworks") { command_name "Minitest" }',
52
- 'gem "minitest"'
53
- ].join('; ')
54
- Rake::Task['test'].execute
61
+ if File.exist?('.simplecov-prelude.rb')
62
+ task :coverage do
63
+ spec.test_prelude = 'load ".simplecov-prelude.rb"'
64
+ Rake::Task['test'].execute
65
+ end
55
66
  end
56
67
 
57
68
  task :coveralls do
58
- spec.test_prelude = [
59
- 'require "psych"',
60
- 'require "simplecov"',
61
- 'require "coveralls"',
62
- 'SimpleCov.formatter = Coveralls::SimpleCov::Formatter',
63
- 'SimpleCov.start("test_frameworks") { command_name "Minitest" }',
64
- 'gem "minitest"'
65
- ].join('; ')
66
- Rake::Task['test'].execute
69
+ ENV['coveralls'] = '1'
70
+ Rake::Task['test:coverage'].execute
67
71
  end
72
+
73
+ CLOBBER << 'coverage'
68
74
  end
69
75
 
70
- # vim: syntax=ruby
76
+ CLOBBER << 'tmp'