Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ Style/BlockDelimiters:
- 'spec/comma/data_extractor_spec.rb'
- 'spec/comma/header_extractor_spec.rb'

# Offense count: 11
# Offense count: 12
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/comma/array.rb'
- 'lib/comma/collection_export.rb'
- 'lib/comma/data_extractor.rb'
- 'lib/comma/data_mapper_collection.rb'
- 'lib/comma/extractor.rb'
Expand Down
4 changes: 2 additions & 2 deletions lib/comma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module Comma
}.freeze
end

require 'comma/data_mapper_collection' if defined? DataMapper

require 'comma/options'
require 'comma/generator'
require 'comma/collection_export'
require 'comma/data_mapper_collection' if defined? DataMapper
require 'comma/array'
require 'comma/object'

Expand Down
4 changes: 1 addition & 3 deletions lib/comma/array.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

class Array
def to_comma(style = :default)
Comma::Generator.new(self, style).run(:each)
end
include Comma::CollectionExport
end
9 changes: 9 additions & 0 deletions lib/comma/collection_export.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Comma
module CollectionExport
def to_comma(style = :default)
Comma::Generator.new(self, style).run(:each)
end
end
end
4 changes: 1 addition & 3 deletions lib/comma/data_mapper_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
if defined?(DataMapper)
module DataMapper
class Collection
def to_comma(style = :default)
Comma::Generator.new(self, style).run(:each)
end
include Comma::CollectionExport
end
end
end
4 changes: 1 addition & 3 deletions lib/comma/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

module Mongoid
class Criteria
def to_comma(style = :default)
Comma::Generator.new(self, style).run(:each)
end
include Comma::CollectionExport
end
end
rescue LoadError => e
Expand Down
Loading