Merge branch 'master' of github.com:internetee/registry into dnssec-refactor

This commit is contained in:
Martin Lensment 2014-10-14 10:57:37 +03:00
commit 22a3f3c1a7
4 changed files with 14 additions and 5 deletions

View file

@ -44,6 +44,11 @@ Void:
Exclude:
- 'spec/**/*'
# allow should == nil in spec
Style/NilComparison:
Exclude:
- 'spec/**/*'
# No need to force reduce to use |a, e| as parameters.
# Configuration parameters: Methods.
Style/SingleLineBlockParams:

View file

@ -1,5 +1,5 @@
group :red_green_refactor, halt_on_fail:true do
guard :rspec, cmd: 'bundle exec rspec' do
group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: 'bundle exec rspec', notification: false do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
@ -26,7 +26,7 @@ group :red_green_refactor, halt_on_fail:true do
# Martin does not want rubocop
unless Socket.gethostname == 'martin'
guard :rubocop, cli: '--display-cop-names -c .rubocop-guard.yml' do
guard :rubocop, cli: '--display-cop-names -c .rubocop-guard.yml', notification: false do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
watch(%r{(?:.+/)?\.rubocop-guard\.yml$}) { |m| File.dirname(m[0]) }

View file

@ -1,9 +1,13 @@
class EppSession < ActiveRecord::Base
before_save :marshal_data!
# rubocop: disable Rails/ReadWriteAttribute
# Turned back to read_attribute, thus in Rails 4
# there is differences between self[:data] and read_attribute.
def data
@data ||= self.class.unmarshal(self[:data]) || {}
@data ||= self.class.unmarshal(read_attribute(:data)) || {}
end
# rubocop: enable Rails/ReadWriteAttribute
def [](key)
data[key.to_sym]

View file

@ -22,7 +22,7 @@ git log origin/master -n 10 --pretty=oneline | sed -r '/^.{40} Merge branch/d' |
echo "END_OF_GIT_LAST_COMMITS"
echo "RUBOCOP_RESULTS"
bundle exec rubocop
bundle exec rubocop -D
RCODE=$?
echo "END_OF_RUBOCOP_RESULTS"