Skip to content

Commit

Permalink
Merge branch 'main' into version-2
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed Nov 19, 2024
2 parents 42aabb1 + cfc639a commit ab40c07
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
10 changes: 0 additions & 10 deletions lib/datagrid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require "datagrid/configuration"
require "datagrid/engine"

# @main README.md
module Datagrid
# @!visibility private
def self.included(base)
Expand All @@ -19,15 +18,6 @@ def self.included(base)
end
end

def self.configuration
@configuration ||= Configuration.new
end

# Configure
def self.configure(&block)
block.call(configuration)
end

class ConfigurationError < StandardError; end
class ArgumentError < ::ArgumentError; end
class ColumnUnavailableError < StandardError; end
Expand Down
16 changes: 15 additions & 1 deletion lib/datagrid/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# frozen_string_literal: true

module Datagrid
# @return [Configuration] current Datagrid configuration
def self.configuration
@configuration ||= Configuration.new
end

# @yield block to configure
# @yieldparam [Configuration] configuration
# @yieldreturn [void]
# @return [void] configure datagrid
# @see Datagrid::Configuration
def self.configure(&block)
block.call(configuration)
end

# ## Configuration
#
# Datagrid provides several configuration options.
Expand All @@ -12,7 +26,7 @@ module Datagrid
# # Defines date formats that can be used to parse dates.
# # Note: Multiple formats can be specified. The first format is used to format dates as strings,
# # while other formats are used only for parsing dates from strings (e.g., if your app supports multiple formats).
# config.date_formats = ["%m/%d/%Y", "%Y-%m-%d"]
# config.date_formats = "%m/%d/%Y", "%Y-%m-%d"
#
# # Defines timestamp formats that can be used to parse timestamps.
# # Note: Multiple formats can be specified. The first format is used to format timestamps as strings,
Expand Down
1 change: 0 additions & 1 deletion lib/datagrid/filters/base_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class FilteringError < StandardError
end
end

# @!visibility private
module Datagrid
module Filters
class BaseFilter
Expand Down
1 change: 0 additions & 1 deletion lib/datagrid/filters/extended_boolean_filter.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

# @!visibility private
module Datagrid
module Filters
class ExtendedBooleanFilter < Datagrid::Filters::EnumFilter
Expand Down
1 change: 0 additions & 1 deletion lib/datagrid/generators/scaffold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "rails/generators"

# @!visibility private
module Datagrid
# @!visibility private
module Generators
Expand Down

0 comments on commit ab40c07

Please sign in to comment.