Skip to content

Commit

Permalink
restructure to gem convention and cleanup with rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
olbrich committed Oct 2, 2016
1 parent e214ac5 commit a495fad
Show file tree
Hide file tree
Showing 973 changed files with 776 additions and 760 deletions.
4 changes: 1 addition & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ engines:
config:
languages:
- ruby
- javascript
- python
- php
fixme:
enabled: true
rubocop:
Expand All @@ -23,3 +20,4 @@ ratings:
- "**.rb"
exclude_paths:
- test/
- lib/fhir_models/fhir/
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.DS_Store
errors/**
**/coverage/**
fhir_models*log*
invariants.txt
Gemfile.lock
.ruby-version
.ruby-gemset

tmp/
61 changes: 28 additions & 33 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
AllCops:
DisabledByDefault: true
Exclude:
- 'bin/**/*'
- 'test/**/*'
- 'errors/**/*'
- 'lib/tasks/**/*'

Documentation:
Enabled: false

Metrics:
Enabled: false
- 'lib/fhir_models/fhir/**/*'

#################### Lint ################################

Expand Down Expand Up @@ -232,14 +224,14 @@ Metrics/BlockNesting:

Metrics/ClassLength:
Description: 'Avoid classes longer than 250 lines of code.'
Enabled: true
Enabled: false
Max: 250

Metrics/CyclomaticComplexity:
Description: >-
A complexity metric that is strongly correlated to the number
of test cases needed to validate a method.
Enabled: true
Enabled: false

Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
Expand All @@ -249,12 +241,12 @@ Metrics/LineLength:
Metrics/MethodLength:
Description: 'Avoid methods longer than 30 lines of code.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
Enabled: true
Enabled: false
Max: 30

Metrics/ModuleLength:
Description: 'Avoid modules longer than 250 lines of code.'
Enabled: true
Enabled: false
Max: 250

Metrics/ParameterLists:
Expand Down Expand Up @@ -486,7 +478,7 @@ Style/CharacterLiteral:
Style/ClassAndModuleCamelCase:
Description: 'Use CamelCase for classes and modules.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
Enabled: false
Enabled: true

Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
Expand Down Expand Up @@ -532,15 +524,15 @@ Style/CommentIndentation:
Style/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
Enabled: false
Enabled: true

Style/DefWithParentheses:
Description: 'Use def with parentheses when there are arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
Enabled: false

Style/DeprecatedHashMethods:
Description: 'Checks for use of deprecated Hash methods.'
Style/PreferredHashMethods:
Description: 'Checks for use of prefered Hash methods.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
Enabled: false

Expand Down Expand Up @@ -626,7 +618,7 @@ Style/ExtraSpacing:
Style/FileName:
Description: 'Use snake_case for source file names.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
Enabled: false
Enabled: true

Style/InitialIndentation:
Description: >-
Expand Down Expand Up @@ -668,7 +660,7 @@ Style/HashSyntax:
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
Enabled: false
Enabled: true

Style/IfUnlessModifier:
Description: >-
Expand All @@ -684,12 +676,12 @@ Style/IfWithSemicolon:

Style/IndentationConsistency:
Description: 'Keep indentation straight.'
Enabled: false
Enabled: true

Style/IndentationWidth:
Description: 'Use 2 spaces for indentation.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
Enabled: false
Enabled: true

Style/IndentArray:
Description: >-
Expand Down Expand Up @@ -732,6 +724,9 @@ Style/MethodCallParentheses:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
Enabled: false

Style/MutableConstant:
Enabled: true

Style/MethodDefParentheses:
Description: >-
Checks if the method definitions have or don't have
Expand All @@ -742,7 +737,7 @@ Style/MethodDefParentheses:
Style/MethodName:
Description: 'Use the configured style when naming methods.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
Enabled: false
Enabled: true

Style/ModuleFunction:
Description: 'Checks for usage of `extend self` in modules.'
Expand Down Expand Up @@ -954,12 +949,12 @@ Style/SpaceBeforeFirstArg:
Style/SpaceAfterColon:
Description: 'Use spaces after colons.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
Enabled: false
Enabled: true

Style/SpaceAfterComma:
Description: 'Use spaces after commas.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
Enabled: false
Enabled: true

Style/SpaceAroundKeyword:
Description: 'Use spaces around keywords.'
Expand All @@ -970,7 +965,7 @@ Style/SpaceAfterMethodName:
Do not put a space between a method name and the opening
parenthesis in a method definition.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
Enabled: false
Enabled: true

Style/SpaceAfterNot:
Description: Tracks redundant space after the ! operator.
Expand Down Expand Up @@ -1034,7 +1029,7 @@ Style/SpaceInsideBrackets:
Style/SpaceInsideHashLiteralBraces:
Description: "Use spaces inside hash literal braces - or don't."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
Enabled: false
Enabled: true

Style/SpaceInsideParens:
Description: 'No spaces after ( or before ).'
Expand All @@ -1059,13 +1054,13 @@ Style/SpecialGlobalVars:
Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
Enabled: false
Enabled: true

Style/StringLiteralsInInterpolation:
Description: >-
Checks if uses of quotes inside expressions in interpolated
strings match the configured preference.
Enabled: false
Enabled: true

Style/StructInheritance:
Description: 'Checks for inheritance from Struct.new.'
Expand All @@ -1088,12 +1083,12 @@ Style/Tab:
Style/TrailingBlankLines:
Description: 'Checks trailing blank lines and final newline.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
Enabled: false
Enabled: true

Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in parameter lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
Enabled: false
Enabled: true

Style/TrailingCommaInLiteral:
Description: 'Checks for trailing comma in literals.'
Expand All @@ -1103,7 +1098,7 @@ Style/TrailingCommaInLiteral:
Style/TrailingWhitespace:
Description: 'Avoid trailing whitespace.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
Enabled: false
Enabled: true

Style/TrivialAccessors:
Description: 'Prefer attr_* methods to trivial readers/writers.'
Expand All @@ -1115,7 +1110,7 @@ Style/UnlessElse:
Do not use unless with else. Rewrite these with the positive
case first.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
Enabled: false
Enabled: true

Style/UnneededCapitalW:
Description: 'Checks for %W when interpolation is not needed.'
Expand All @@ -1142,7 +1137,7 @@ Style/VariableInterpolation:
Style/VariableName:
Description: 'Use the configured style when naming variables.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
Enabled: false
Enabled: true

Style/WhenThen:
Description: 'Use when x then ... for one-line cases.'
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: ruby
rvm:
- "2.0.0"
- "2.1.10"
- "2.2.5"
- "2.3.1"
script:
- bundle exec rake test
notifications:
Expand Down
12 changes: 0 additions & 12 deletions Gemfile.old

This file was deleted.

26 changes: 24 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
require "bundler/gem_tasks"
task :default => :spec
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rubocop/rake_task'

Dir['lib/fhir_models/tasks/**/*.rake'].each do |file|
load file
end

desc 'Run basic tests'
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.test_files = FileList['test/**/*_test.rb']
t.verbose = true
t.warning = false
end

desc 'Run rubocop'
task :rubocop do
RuboCop::RakeTask.new
end

task default: [:test, :rubocop] do
system('open coverage/index.html')
end
31 changes: 0 additions & 31 deletions Rakefile.old

This file was deleted.

6 changes: 3 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "fhir_models"
require 'bundler/setup'
require 'fhir_models'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand All @@ -10,5 +10,5 @@ require "fhir_models"
# require "pry"
# Pry.start

require "irb"
require 'irb'
IRB.start
27 changes: 14 additions & 13 deletions fhir_models.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fhir_models/version'

Gem::Specification.new do |spec|
spec.name = "fhir_models"
spec.name = 'fhir_models'
spec.version = FHIR::Models::VERSION
spec.authors = ["Jason Walonoski", "Andre Quina", "Michael O'Keefe"]
spec.email = ["[email protected]"]
spec.authors = ['Jason Walonoski', 'Andre Quina', "Michael O'Keefe"]
spec.email = ['[email protected]']

spec.summary = %q{A Gem for handling FHIR models in ruby}
spec.description = %q{A Gem for handling FHIR models in ruby}
spec.homepage = "https://github.com/fhir-crucible/fhir_models"
spec.homepage = 'https://github.com/fhir-crucible/fhir_models'

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_dependency 'nokogiri', '>= 1.6'
spec.add_dependency 'date_time_precision', ">= 0.8"
spec.add_dependency 'date_time_precision', '>= 0.8'
spec.add_dependency 'bcp47', '>= 0.3'
spec.add_dependency 'mime-types', '>= 1.16', '< 3'

spec.add_development_dependency "bundler", "~> 1.13"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency 'bundler', '~> 1.13'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'pry'
spec.add_development_dependency "test-unit"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "nokogiri-diff"
spec.add_development_dependency "rubocop", '~> 0.43.0'
spec.add_development_dependency 'test-unit'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'nokogiri-diff'
spec.add_development_dependency 'rubocop', '~> 0.43.0'
spec.add_development_dependency 'codeclimate-test-reporter'
end
Loading

0 comments on commit a495fad

Please sign in to comment.