Skip to content

Commit

Permalink
Merge pull request #29 from careo/fix-polymorphic-rendering
Browse files Browse the repository at this point in the history
Fix polymorphic rendering
  • Loading branch information
blanquer committed May 31, 2016
2 parents 3654dc3 + ebafc6f commit b74c821
Show file tree
Hide file tree
Showing 23 changed files with 425 additions and 458 deletions.
35 changes: 35 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
AllCops:
TargetRubyVersion: 2.3
Style/Documentation:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/LineLength:
Max: 200
Style/RedundantSelf:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Lint/Debugger:
Enabled: false
Metrics/AbcSize:
Enabled: false
Style/CaseEquality:
Enabled: false
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
Style/FileName:
Exclude:
- 'lib/praxis-blueprints.rb'
Style/ClassVars:
Exclude:
- 'lib/praxis-blueprints/blueprint.rb'

# Offense count: 5
Metrics/CyclomaticComplexity:
Max: 8
# Offense count: 5
Metrics/PerceivedComplexity:
Max: 12
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: ruby
cache: bundler
sudo: false
rvm:
- 2.1.2
- 2.2.2
script: bundle exec rspec spec
- 2.2.3
- 2.3.1
script:
- bundle exec rspec spec
- bundle exec rubocop --format=clang
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## next

* Include Attributor::Dumpable in Blueprint, so it renders (semi) correctly if
rendered with just `true` specified for fields.

## 3.2

* Ensure we call `object.dump` in Renderer when fully dumping an instance (or array of instances) that have the Attributor::Dumpable module (i.e., when no subfields were selected)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec
20 changes: 13 additions & 7 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# frozen_string_literal: true
# Config file for Guard
# More info at https://github.com/guard/guard#readme
group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/praxis-blueprints/(.+)\.rb$}) { |m| "spec/praxis-blueprints/#{m[1]}_spec.rb" }
watch('spec/*.rb') { 'spec' }
watch('lib/praxis-blueprints.rb') { 'spec' }
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
end

guard :rspec, cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/praxis-blueprints/(.+)\.rb$}) { |m| "spec/praxis-blueprints/#{m[1]}_spec.rb" }
watch('spec/*.rb') { 'spec' }
watch('lib/praxis-blueprints.rb') { 'spec' }
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
guard :rubocop, cli: '--auto-correct --display-cop-names' do
watch(/.+\.rb$/)
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
end

7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# frozen_string_literal: true
require 'bundler/setup'

require "bundler/gem_tasks"
require 'bundler/gem_tasks'

require 'rspec/core'
require 'rspec/core/rake_task'
require 'bundler/gem_tasks'

desc "Run RSpec code examples with simplecov"
desc 'Run RSpec code examples with simplecov'
RSpec::Core::RakeTask.new do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

task :default => :spec
task default: :spec

require 'yard'
YARD::Rake::YardocTask.new
3 changes: 2 additions & 1 deletion lib/praxis-blueprints.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true
require 'json'
require 'yaml'
require 'logger'

require 'attributor'

require "praxis-blueprints/version"
require 'praxis-blueprints/version'

require 'praxis-blueprints/finalizable'
require 'praxis-blueprints/config_hash'
Expand Down

0 comments on commit b74c821

Please sign in to comment.