record_loader 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/cops_and_specs.yml +39 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +51 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/.yardopts +4 -0
- data/CHANGELOG.md +16 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +70 -0
- data/LICENSE +24 -0
- data/README.md +182 -0
- data/Rakefile +36 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/generators/record_loader/USAGE +36 -0
- data/lib/generators/record_loader/record_loader_generator.rb +55 -0
- data/lib/generators/record_loader/static_files/application_record_loader.rb +13 -0
- data/lib/generators/record_loader/static_files/record_loader.rake +11 -0
- data/lib/generators/record_loader/templates/config/record_loader/%underscores%/default_records.yml +11 -0
- data/lib/generators/record_loader/templates/lib/record_loader/%underscore_loader%.rb.tt +16 -0
- data/lib/generators/record_loader/templates/lib/tasks/record_loader/%underscore%.rake.tt +13 -0
- data/lib/generators/record_loader/templates/spec/data/record_loader/%underscores%/two_entry_example.yml +5 -0
- data/lib/generators/record_loader/templates/spec/lib/record_loader/%underscore_loader%_spec.rb.tt +31 -0
- data/lib/record_loader/adapter/basic.rb +48 -0
- data/lib/record_loader/adapter/rails.rb +33 -0
- data/lib/record_loader/adapter.rb +58 -0
- data/lib/record_loader/base.rb +160 -0
- data/lib/record_loader/railtie.rb +9 -0
- data/lib/record_loader/record_file.rb +51 -0
- data/lib/record_loader/version.rb +6 -0
- data/lib/record_loader.rb +15 -0
- data/record_loader.gemspec +55 -0
- metadata +192 -0
data/lib/generators/record_loader/templates/spec/lib/record_loader/%underscore_loader%_spec.rb.tt
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
require 'record_loader/<%= underscore_loader %>'
|
5
|
+
|
6
|
+
# This file was initially generated via `rails g record_loader`
|
7
|
+
RSpec.describe RecordLoader::<%= loader_class_name %>, type: :model, loader: true do
|
8
|
+
subject(:record_loader) do
|
9
|
+
described_class.new(directory: test_directory, files: selected_files)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Tests use a separate directory to avoid coupling your specs to the data
|
13
|
+
let(:test_directory) { Rails.root.join('spec/data/record_loader/<%= underscores %>') }
|
14
|
+
|
15
|
+
context 'with two_entry_example selected' do
|
16
|
+
let(:selected_files) { 'two_entry_example' }
|
17
|
+
|
18
|
+
it 'creates two records' do
|
19
|
+
expect { record_loader.create! }.to change { <%= record_class %>.count }.by(2)
|
20
|
+
end
|
21
|
+
|
22
|
+
# It is important that multiple runs of a RecordLoader do not create additional
|
23
|
+
# copies of existing records.
|
24
|
+
it 'is idempotent' do
|
25
|
+
record_loader.create!
|
26
|
+
expect { record_loader.create! }.not_to change { <%= record_class %>.count }
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'sets attributes on the created records'
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'logger'
|
4
|
+
|
5
|
+
module RecordLoader
|
6
|
+
module Adapter
|
7
|
+
#
|
8
|
+
# A very basic {RecordLoader::Adapter} which provides limited logging
|
9
|
+
# functionality, environment is extracted from RACK_ENV
|
10
|
+
#
|
11
|
+
class Basic
|
12
|
+
# @return [Logger] The configured logger instance
|
13
|
+
attr_reader :logger
|
14
|
+
|
15
|
+
#
|
16
|
+
# Create a new {RecordLoader::Adapter::Basic}. Can pass in a pre-existing
|
17
|
+
# logger is required.
|
18
|
+
# @see https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html
|
19
|
+
#
|
20
|
+
# @param [#debug&#info&#warn#&error&#fatal] logger Optional logger object. Creates a new ruby Logger by default.
|
21
|
+
#
|
22
|
+
def initialize(logger: Logger.new(STDOUT))
|
23
|
+
@logger = logger
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Impliments the RecordLoader::Adapter interface by providing a transaction
|
28
|
+
# method. Used by {RecordLoader::Base.create!}. This implimentation
|
29
|
+
# yields immediately, but otherwise performs no other functions.
|
30
|
+
#
|
31
|
+
# @return [Void]
|
32
|
+
#
|
33
|
+
def transaction
|
34
|
+
yield
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Returns whether we are running in a development environment
|
39
|
+
# Determined by looking at RACK_ENV
|
40
|
+
#
|
41
|
+
# @return [Boolean] True if in development
|
42
|
+
#
|
43
|
+
def development?
|
44
|
+
ENV.fetch('RACK_ENV', 'unknown').casecmp?('development')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RecordLoader
|
4
|
+
module Adapter
|
5
|
+
# An adapter designed for use with Rails applications. Automatically wraps {RecordLoader::Base.create!} in an
|
6
|
+
# active record transaction, and directs logging to the configure rails logger. Environment is extracted
|
7
|
+
# from Rails.env
|
8
|
+
class Rails
|
9
|
+
# Wraps Rails.logger method
|
10
|
+
# @return [#debug&#info&#warn#&error&#fatal]
|
11
|
+
def logger
|
12
|
+
::Rails.logger
|
13
|
+
end
|
14
|
+
|
15
|
+
#
|
16
|
+
# Wraps the ActiveRecord::Base.transaction method.
|
17
|
+
# @see https://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html
|
18
|
+
# @return [Void]
|
19
|
+
def transaction(&block)
|
20
|
+
ActiveRecord::Base.transaction(&block)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Returns whether we are running in a development environment
|
25
|
+
#
|
26
|
+
# @return [Boolean] True is in development
|
27
|
+
#
|
28
|
+
def development?
|
29
|
+
::Rails.env.development?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'adapter/basic'
|
4
|
+
require_relative 'adapter/rails'
|
5
|
+
|
6
|
+
module RecordLoader
|
7
|
+
#
|
8
|
+
# {RecordLoader::Adapter}s provide a means of wrapping various framework
|
9
|
+
# methods in order to use {RecordLoader} outside of Rails and ActiveRecord.
|
10
|
+
#
|
11
|
+
# = Existing Adapters
|
12
|
+
# There are currently two adapters available
|
13
|
+
#
|
14
|
+
# - {RecordLoader::Adapter::Basic}
|
15
|
+
# A simple general purpose adapter which provides no support for transactions and only basic logging.
|
16
|
+
#
|
17
|
+
# - {RecordLoader::Adapter::Rails}
|
18
|
+
# An adapter designed for use with Rails applications. Automatically wraps {RecordLoader::Base.create!} in an
|
19
|
+
# active record transaction, and directs logging to the configure rails logger.
|
20
|
+
#
|
21
|
+
# = Custom Adapters
|
22
|
+
# It is possible to create custom adapters to use with your own frameworks. It is suggested that you inherit from
|
23
|
+
# {RecordLoader::Adapter::Basic} to provide forward compatibility with future versions of RecordLoader.
|
24
|
+
#
|
25
|
+
# Custom adapters should support three instance methods:
|
26
|
+
#
|
27
|
+
# - transaction(&block)
|
28
|
+
# Wraps the {RecordLoader::Base.create!} and allows you to handle transactional rollbacks in the event that
|
29
|
+
# something goes wrong. This method recieves a block and should be yielded to to generate the records.
|
30
|
+
#
|
31
|
+
# - logger
|
32
|
+
# Should return a logger object which impliments: debug, info, warn, error, fatal methods
|
33
|
+
#
|
34
|
+
# - development?
|
35
|
+
# Returns true if we are running in development mode.
|
36
|
+
#
|
37
|
+
# @example my_adapter.rb
|
38
|
+
# class MyAdapter < RecordLoader::Adapter::Basic
|
39
|
+
# def transaction
|
40
|
+
# Database.open_transaction
|
41
|
+
# yield
|
42
|
+
# Database.commit_transaction
|
43
|
+
# rescue StandardError
|
44
|
+
# Database.abort_transaction
|
45
|
+
# end
|
46
|
+
#
|
47
|
+
# def logger
|
48
|
+
# DistributedLoggingSystem.logger
|
49
|
+
# end
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @example application_record_loader.rb
|
53
|
+
# class ApplicationRecordLoader
|
54
|
+
# adapter MyAdapter.new
|
55
|
+
# end
|
56
|
+
module Adapter
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module RecordLoader
|
6
|
+
# Inherit from RecordLoader base to automatically load one or more yaml files
|
7
|
+
# into a @config hash. Config folders are found in config/default_records
|
8
|
+
# and each loader should specify its own subfolder by setting the config_folder
|
9
|
+
# class attribute.
|
10
|
+
class Base
|
11
|
+
# @return [Array] The default route to the yaml files containing the records
|
12
|
+
# path is relative to the root directory of your application
|
13
|
+
# and will contain a subfolder for each record loader.
|
14
|
+
BASE_CONFIG_PATH = %w[config default_records].freeze
|
15
|
+
|
16
|
+
class << self
|
17
|
+
# @overload config_folder(config_folder)
|
18
|
+
# Sets the folder, located under {BASE_CONFIG_PATH}, from which the records
|
19
|
+
# will be loaded.
|
20
|
+
#
|
21
|
+
# @param [String] config_folder Set the config folder for the class
|
22
|
+
#
|
23
|
+
# @return [String] The configured config folder
|
24
|
+
#
|
25
|
+
# @overload config_folder
|
26
|
+
# Returns the folder, located under {BASE_CONFIG_PATH}, from which the records
|
27
|
+
# will be loaded.
|
28
|
+
#
|
29
|
+
# @return [String] The configured config folder
|
30
|
+
#
|
31
|
+
def config_folder(config_folder = nil)
|
32
|
+
@config_folder = config_folder unless config_folder.nil?
|
33
|
+
@config_folder
|
34
|
+
end
|
35
|
+
|
36
|
+
# @overload adapter(adapter)
|
37
|
+
# Sets the {RecordLoader::Adapter adapter} to use for the record loader, see the {RecordLoader::Adapter adapter}
|
38
|
+
# for further information.
|
39
|
+
#
|
40
|
+
# @param [Object] adapter Set the adapter to use for the class
|
41
|
+
#
|
42
|
+
# @return [Object] The configured adapter
|
43
|
+
#
|
44
|
+
# @overload adapter
|
45
|
+
# Returns the configured adapter
|
46
|
+
#
|
47
|
+
# @return [Object] The configured adapter
|
48
|
+
#
|
49
|
+
def adapter(adapter = nil)
|
50
|
+
@adapter = adapter unless adapter.nil?
|
51
|
+
@adapter || superclass.adapter
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
adapter RecordLoader::Adapter::Basic.new
|
56
|
+
|
57
|
+
#
|
58
|
+
# Create a new config loader from yaml files
|
59
|
+
#
|
60
|
+
# @param files [Array<String>,NilClass] pass in an array of file names to load, or nil to load all files.
|
61
|
+
# Dev and wip flags will be ignored for files passed in explicitly
|
62
|
+
# @param directory [Pathname, String] The directory from which to load the files.
|
63
|
+
# defaults to config/default_records/plate_purposes
|
64
|
+
# @param dev [Boolean] Override the rails environment to generate (or not) data from dev.yml files.
|
65
|
+
#
|
66
|
+
def initialize(files: nil, directory: default_path, dev: adapter.development?)
|
67
|
+
@path = directory.is_a?(Pathname) ? directory : Pathname.new(directory)
|
68
|
+
@dev = dev
|
69
|
+
@files = @path.glob("*#{RecordFile::EXTENSION}")
|
70
|
+
.select { |child| load_file?(files, RecordFile.new(child)) }
|
71
|
+
load_config
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Opens a transaction and creates or updates each of the records in the yml files
|
76
|
+
# via the #create_or_update! method
|
77
|
+
#
|
78
|
+
# @return [Void]
|
79
|
+
def create!
|
80
|
+
adapter.transaction do
|
81
|
+
@config.each do |key, config|
|
82
|
+
create_or_update!(key, config)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
# Returns the configured adapter
|
90
|
+
#
|
91
|
+
# @return [Object] The configured adapter
|
92
|
+
#
|
93
|
+
def adapter
|
94
|
+
self.class.adapter
|
95
|
+
end
|
96
|
+
|
97
|
+
#
|
98
|
+
# Returns the default route to the yaml files containing the records path
|
99
|
+
# is relative to the root directory of your application and will contain a
|
100
|
+
# subfolder for each record loader.
|
101
|
+
#
|
102
|
+
# Redefine this method in ApplicationRecordLoader to overide the default
|
103
|
+
# configuration.
|
104
|
+
#
|
105
|
+
# @example
|
106
|
+
# RecordLoader::Base.base_config_path # => ['config', 'default_records']
|
107
|
+
#
|
108
|
+
# @return [Array] base path for record loader record
|
109
|
+
#
|
110
|
+
def base_config_path
|
111
|
+
BASE_CONFIG_PATH
|
112
|
+
end
|
113
|
+
|
114
|
+
# Returns an array of WIP flags
|
115
|
+
def wip_list
|
116
|
+
ENV.fetch('WIP', '').split(',')
|
117
|
+
end
|
118
|
+
|
119
|
+
#
|
120
|
+
# The default path to load config files from
|
121
|
+
#
|
122
|
+
# @return [Pathname] The directory containing the yml files
|
123
|
+
#
|
124
|
+
def default_path
|
125
|
+
Pathname.pwd.join(*base_config_path, self.class.config_folder)
|
126
|
+
end
|
127
|
+
|
128
|
+
#
|
129
|
+
# Indicates that a file should be loaded
|
130
|
+
#
|
131
|
+
# @param [Array] list provides an array of files (minus extenstions) to load
|
132
|
+
# @param [Pathname] file The file to check
|
133
|
+
#
|
134
|
+
# @return [Boolean] returns true if the file should be loaded
|
135
|
+
#
|
136
|
+
def load_file?(list, file)
|
137
|
+
if list.nil?
|
138
|
+
return @dev if file.dev?
|
139
|
+
return wip_list.include?(file.basename) if file.wip?
|
140
|
+
|
141
|
+
true
|
142
|
+
else
|
143
|
+
# If we've provided a list, that's all that matters
|
144
|
+
list.include?(file.basename)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# Load the appropriate configuration files into @config
|
150
|
+
#
|
151
|
+
def load_config
|
152
|
+
@config = @files.each_with_object({}) do |file, store|
|
153
|
+
latest_file = YAML.load_file(file)
|
154
|
+
duplicate_keys = store.keys & latest_file.keys
|
155
|
+
adapter.logger.warn "Duplicate keys in #{@path}: #{duplicate_keys}" unless duplicate_keys.empty?
|
156
|
+
store.merge!(latest_file)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RecordLoader
|
4
|
+
# A RecordFile is a wrapper to handle categorization of the yaml files
|
5
|
+
# used by RecordLoader
|
6
|
+
class RecordFile
|
7
|
+
# @return [String] Extension of the yaml files to load.
|
8
|
+
EXTENSION = '.yml'
|
9
|
+
# @return [String] The tag immediately prior to the extension that flags a
|
10
|
+
# file as being development specific. For example a file
|
11
|
+
# names users.dev.yaml
|
12
|
+
DEV_IDENTIFIER = '.dev'
|
13
|
+
# @return [String] The tag immediately prior to the extension that flags a
|
14
|
+
# file as being work-in-progress. For example a file
|
15
|
+
# names new_feature.wip.yaml
|
16
|
+
WIP_IDENTIFIER = '.wip'
|
17
|
+
|
18
|
+
# Create a RecordFile wrapper for a given file
|
19
|
+
# @param record_file [Pathname] The path of the file to wrap
|
20
|
+
def initialize(record_file)
|
21
|
+
@record_file = record_file
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns the name of the file, minus the extension and dev/wip flags
|
25
|
+
# @return [String] The name of the file eg. "000_purpose"
|
26
|
+
def basename
|
27
|
+
without_extension.delete_suffix(WIP_IDENTIFIER)
|
28
|
+
.delete_suffix(DEV_IDENTIFIER)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns true if the file is development environment specific
|
32
|
+
# ie. ends in .dev.yml
|
33
|
+
# @return [Boolean] True if the file is a dev file
|
34
|
+
def dev?
|
35
|
+
without_extension.end_with?(DEV_IDENTIFIER)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns true if the file is flagged as WIP
|
39
|
+
# ie. ends in .wip.yml
|
40
|
+
# @return [Boolean] True if the file is a wip file
|
41
|
+
def wip?
|
42
|
+
without_extension.end_with?(WIP_IDENTIFIER)
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def without_extension
|
48
|
+
@record_file.basename(EXTENSION).to_s
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'record_loader/version'
|
4
|
+
require 'record_loader/adapter'
|
5
|
+
require 'record_loader/base'
|
6
|
+
require 'record_loader/record_file'
|
7
|
+
|
8
|
+
# Only load the railtie is we detect rails
|
9
|
+
require 'record_loader/railtie' if defined?(Rails)
|
10
|
+
|
11
|
+
# Root namespace of RecordLoader
|
12
|
+
module RecordLoader
|
13
|
+
# Raised when it appears RecordLoader is improperly configured
|
14
|
+
ConfigurationError = Class.new(StandardError)
|
15
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'record_loader/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'record_loader'
|
9
|
+
spec.version = RecordLoader::VERSION
|
10
|
+
spec.authors = ['James Glover']
|
11
|
+
spec.email = ['james.glover@sanger.ac.uk']
|
12
|
+
|
13
|
+
spec.summary = 'Easily manage seeding and updating data from simple yml files'
|
14
|
+
spec.description = 'Provides a simple interface for generating and maintaining database
|
15
|
+
records across multiple environments in a simple and reproducible manner.'
|
16
|
+
spec.homepage = 'https://www.github.com/sanger/record_loader'
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.required_ruby_version = '>= 2.5.0'
|
20
|
+
|
21
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
22
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
23
|
+
if spec.respond_to?(:metadata)
|
24
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
25
|
+
|
26
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
27
|
+
spec.metadata['source_code_uri'] = 'https://www.github.com/sanger/record_loader'
|
28
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
29
|
+
else
|
30
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
31
|
+
'public gem pushes.'
|
32
|
+
end
|
33
|
+
|
34
|
+
# Specify which files should be added to the gem when it is released.
|
35
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
36
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
37
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
38
|
+
end
|
39
|
+
spec.bindir = 'exe'
|
40
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
41
|
+
spec.require_paths = ['lib']
|
42
|
+
|
43
|
+
# Development dependencies
|
44
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
45
|
+
spec.add_development_dependency 'pry', '~> 0.13'
|
46
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
47
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
48
|
+
spec.add_development_dependency 'rubocop', '~> 0.82'
|
49
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
|
50
|
+
spec.add_development_dependency 'yard', '~> 0.9'
|
51
|
+
# Pin simplecov to ~> 0.17 until CodeClimate compatibility
|
52
|
+
# issues resolved:
|
53
|
+
# https://github.com/codeclimate/test-reporter/issues/413
|
54
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.0'
|
55
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: record_loader
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Glover
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.82'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.82'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.39'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.39'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.9'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.9'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.17.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.17.0
|
125
|
+
description: |-
|
126
|
+
Provides a simple interface for generating and maintaining database
|
127
|
+
records across multiple environments in a simple and reproducible manner.
|
128
|
+
email:
|
129
|
+
- james.glover@sanger.ac.uk
|
130
|
+
executables: []
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- ".github/workflows/cops_and_specs.yml"
|
135
|
+
- ".gitignore"
|
136
|
+
- ".rspec"
|
137
|
+
- ".rubocop.yml"
|
138
|
+
- ".ruby-version"
|
139
|
+
- ".travis.yml"
|
140
|
+
- ".yardopts"
|
141
|
+
- CHANGELOG.md
|
142
|
+
- Gemfile
|
143
|
+
- Gemfile.lock
|
144
|
+
- LICENSE
|
145
|
+
- README.md
|
146
|
+
- Rakefile
|
147
|
+
- bin/console
|
148
|
+
- bin/setup
|
149
|
+
- lib/generators/record_loader/USAGE
|
150
|
+
- lib/generators/record_loader/record_loader_generator.rb
|
151
|
+
- lib/generators/record_loader/static_files/application_record_loader.rb
|
152
|
+
- lib/generators/record_loader/static_files/record_loader.rake
|
153
|
+
- lib/generators/record_loader/templates/config/record_loader/%underscores%/default_records.yml
|
154
|
+
- lib/generators/record_loader/templates/lib/record_loader/%underscore_loader%.rb.tt
|
155
|
+
- lib/generators/record_loader/templates/lib/tasks/record_loader/%underscore%.rake.tt
|
156
|
+
- lib/generators/record_loader/templates/spec/data/record_loader/%underscores%/two_entry_example.yml
|
157
|
+
- lib/generators/record_loader/templates/spec/lib/record_loader/%underscore_loader%_spec.rb.tt
|
158
|
+
- lib/record_loader.rb
|
159
|
+
- lib/record_loader/adapter.rb
|
160
|
+
- lib/record_loader/adapter/basic.rb
|
161
|
+
- lib/record_loader/adapter/rails.rb
|
162
|
+
- lib/record_loader/base.rb
|
163
|
+
- lib/record_loader/railtie.rb
|
164
|
+
- lib/record_loader/record_file.rb
|
165
|
+
- lib/record_loader/version.rb
|
166
|
+
- record_loader.gemspec
|
167
|
+
homepage: https://www.github.com/sanger/record_loader
|
168
|
+
licenses:
|
169
|
+
- MIT
|
170
|
+
metadata:
|
171
|
+
homepage_uri: https://www.github.com/sanger/record_loader
|
172
|
+
source_code_uri: https://www.github.com/sanger/record_loader
|
173
|
+
post_install_message:
|
174
|
+
rdoc_options: []
|
175
|
+
require_paths:
|
176
|
+
- lib
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 2.5.0
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
requirements: []
|
188
|
+
rubygems_version: 3.0.3
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
191
|
+
summary: Easily manage seeding and updating data from simple yml files
|
192
|
+
test_files: []
|