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 25a4377 commit e214ac5
Show file tree
Hide file tree
Showing 173 changed files with 155 additions and 102 deletions.
14 changes: 3 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
source "http://rubygems.org"
gemspec
source 'https://rubygems.org'

group :test do
gem 'codeclimate-test-reporter', require: nil
gem 'rubocop', '~> 0.43.0', require: false
gem 'simplecov'
gem 'minitest', "~> 4.0"
gem 'turn'
gem 'awesome_print', :require => 'ap'
gem 'nokogiri-diff'
end
# Specify your gem's dependencies in fhir_models.gemspec
gemspec
12 changes: 12 additions & 0 deletions Gemfile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source "http://rubygems.org"
gemspec

group :test do
gem 'codeclimate-test-reporter', require: nil
gem 'rubocop', '~> 0.43.0', require: false
gem 'simplecov'
gem 'minitest', "~> 4.0"
gem 'turn'
gem 'awesome_print', :require => 'ap'
gem 'nokogiri-diff'
end
33 changes: 2 additions & 31 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,2 @@
require 'rake'
require 'rake/testtask'
require 'fileutils'
require 'pry'
require 'rubocop/rake_task'

require_relative 'lib/fhir_models'

# Pull in any rake task defined in lib/tasks
Dir['lib/tasks/**/*.rake'].sort.each do |ext|
load ext
end

desc "Run basic tests"
Rake::TestTask.new(:test_unit) 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 test: [:test_unit, :rubocop] do
system('open coverage/index.html')
end

task default: [:test]
require "bundler/gem_tasks"
task :default => :spec
31 changes: 31 additions & 0 deletions Rakefile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require 'rake'
require 'rake/testtask'
require 'fileutils'
require 'pry'
require 'rubocop/rake_task'

require_relative 'lib/fhir_models'

# Pull in any rake task defined in lib/tasks
Dir['lib/tasks/**/*.rake'].sort.each do |ext|
load ext
end

desc "Run basic tests"
Rake::TestTask.new(:test_unit) 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 test: [:test_unit, :rubocop] do
system('open coverage/index.html')
end

task default: [:test]
14 changes: 14 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby

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.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
51 changes: 33 additions & 18 deletions fhir_models.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# -*- encoding: utf-8 -*-
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fhir_models/version'

Gem::Specification.new do |s|
s.name = "fhir_models"
s.summary = "A Gem for handling FHIR models in ruby"
s.description = "A Gem for handling FHIR models in ruby"
s.email = "[email protected]"
s.homepage = "https://github.com/fhir-crucible/fhir_models"
s.authors = ["Jason Walonoski", "Andre Quina", "Michael O'Keefe"]
s.version = '1.6.3'
s.files = s.files = `git ls-files`.split("\n")
s.add_development_dependency 'pry'
s.add_development_dependency 'minitest'
s.add_development_dependency 'test-unit'
s.add_dependency 'rake', '>= 0.8.7'
s.add_dependency 'nokogiri', '>= 1.6'
s.add_dependency 'date_time_precision', '>= 0.8'
s.add_dependency 'bcp47', '>= 0.3'
s.add_dependency 'mime-types', '>= 1.16', '< 3'
Gem::Specification.new do |spec|
spec.name = "fhir_models"
spec.version = FHIR::Models::VERSION
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.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency 'nokogiri', '>= 1.6'
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 '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'
end
44 changes: 44 additions & 0 deletions lib/fhir_models.old.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Top level include file that brings in all the necessary code
require 'bundler/setup'
require 'yaml'
require 'nokogiri'
require 'date_time_precision'
require 'date_time_precision/format/iso8601'
require 'mime/types'
require 'bcp47'
require 'bigdecimal'
require 'logger'
require 'tempfile'

root = File.expand_path '..', File.dirname(File.absolute_path(__FILE__))

# Need to require Hashable first
require File.join(root,'lib','bootstrap','hashable.rb')
require File.join(root,'lib','bootstrap','json.rb')

Dir.glob(File.join(root, 'lib','bootstrap','*.rb')).each do |file|
require file
end
Dir.glob(File.join(root, 'lib','bootstrap','**','*.rb')).each do |file|
require file
end

require File.join(root, 'lib','fhir.rb')

# Require the generated code
Dir.glob(File.join(root, 'lib','fhir','*.rb')).each do |file|
require file
end
Dir.glob(File.join(root, 'lib','fhir','**','*.rb')).each do |file|
require file
end

# Require the fluentpath code
Dir.glob(File.join(root, 'lib','fluentpath','*.rb')).each do |file|
require file
end

# Require the fhir_ext code
Dir.glob(File.join(root, 'lib','fhir_ext','*.rb')).each do |file|
require file
end
45 changes: 3 additions & 42 deletions lib/fhir_models.rb
Original file line number Diff line number Diff line change
@@ -1,44 +1,5 @@
# Top level include file that brings in all the necessary code
require 'bundler/setup'
require 'yaml'
require 'nokogiri'
require 'date_time_precision'
require 'date_time_precision/format/iso8601'
require 'mime/types'
require 'bcp47'
require 'bigdecimal'
require 'logger'
require 'tempfile'
require "fhir_models/version"

root = File.expand_path '..', File.dirname(File.absolute_path(__FILE__))

# Need to require Hashable first
require File.join(root,'lib','bootstrap','hashable.rb')
require File.join(root,'lib','bootstrap','json.rb')

Dir.glob(File.join(root, 'lib','bootstrap','*.rb')).each do |file|
require file
end
Dir.glob(File.join(root, 'lib','bootstrap','**','*.rb')).each do |file|
require file
end

require File.join(root, 'lib','fhir.rb')

# Require the generated code
Dir.glob(File.join(root, 'lib','fhir','*.rb')).each do |file|
require file
end
Dir.glob(File.join(root, 'lib','fhir','**','*.rb')).each do |file|
require file
end

# Require the fluentpath code
Dir.glob(File.join(root, 'lib','fluentpath','*.rb')).each do |file|
require file
end

# Require the fhir_ext code
Dir.glob(File.join(root, 'lib','fhir_ext','*.rb')).each do |file|
require file
module FhirModels
# Your code goes here...
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions lib/fhir_models/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module FHIR
module Models
VERSION = "1.6.3"
end
end
File renamed without changes.

0 comments on commit e214ac5

Please sign in to comment.