Skip to content
Open
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
19 changes: 16 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ AllCops:
- gemfiles/vendor/bundle/**/*
- vendor/bundle/**/*
- Guardfile
- test/dummy/**/*
- vendor/**/*

Layout/LineLength:
Expand Down Expand Up @@ -97,9 +98,6 @@ Style/DoubleNegation:
Style/EmptyMethod:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/NumericPredicate:
Enabled: false

Expand All @@ -108,3 +106,18 @@ Style/StringLiterals:

Style/TrivialAccessors:
AllowPredicates: true

Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always # or 'always' or 'never' depending on your preference
SafeAutoCorrect: true # Set to true for safe autocorrection, false if you need to review changes
Exclude:
- ./**/Gemfile*
- bootstrap_form.gemspec
- Dangerfile
- demo/config/**/*
- demo/config.ru
- demo/db/migrate/**/*
- gemfiles/*
- Rakefile
- Vagrantfile
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# yarn lockfile v1


lastUpdateCheck 1762373771610
lastUpdateCheck 1762552807228
2 changes: 2 additions & 0 deletions demo/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
end
2 changes: 2 additions & 0 deletions demo/app/controllers/bootstrap_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class BootstrapController < ApplicationController
def form
load_models
Expand Down
2 changes: 2 additions & 0 deletions demo/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class UsersController < ApplicationController
def create
redirect_to root_path
Expand Down
2 changes: 2 additions & 0 deletions demo/app/helpers/bootstrap_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module BootstrapHelper
def form_with_source(&)
form_html = capture(&)
Expand Down
2 changes: 2 additions & 0 deletions demo/app/models/address.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Address < ApplicationRecord
belongs_to :user

Expand Down
2 changes: 2 additions & 0 deletions demo/app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
2 changes: 2 additions & 0 deletions demo/app/models/faux_user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FauxUser
attr_accessor :email, :password, :comments, :misc

Expand Down
2 changes: 2 additions & 0 deletions demo/app/models/model_user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ModelUser
include ActiveModel::Model

Expand Down
2 changes: 2 additions & 0 deletions demo/app/models/skill.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Skill
attr_accessor :id, :name

Expand Down
2 changes: 2 additions & 0 deletions demo/app/models/super_user.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

class SuperUser < User
end
2 changes: 2 additions & 0 deletions demo/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class User < ApplicationRecord
attr_accessor :remember_me

Expand Down
2 changes: 2 additions & 0 deletions demo/test/application_system_test_case.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"
require "capybara_screenshot_diff/minitest"

Expand Down
2 changes: 2 additions & 0 deletions demo/test/controllers/bootstrap_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class BootstrapControllerTest < ActionDispatch::IntegrationTest
Expand Down
2 changes: 2 additions & 0 deletions demo/test/controllers/users_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class UsersControllerTest < ActionDispatch::IntegrationTest
Expand Down
2 changes: 2 additions & 0 deletions demo/test/system/bootstrap_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "application_system_test_case"
require "capybara_screenshot_diff/minitest"

Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "action_view"
require "action_pack"
require "bootstrap_form/action_view_extensions/form_helper"
Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form/form_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# require 'bootstrap_form/aliasing'

module BootstrapForm
Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form/helpers/bootstrap.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module BootstrapForm
module Helpers
module Bootstrap
Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form/helpers/field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module BootstrapForm
module Helpers
module Field
Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form/inputs/inputs_collection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module BootstrapForm
module Inputs
module InputsCollection
Expand Down
2 changes: 2 additions & 0 deletions lib/bootstrap_form/inputs/submit.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module BootstrapForm
module Inputs
module Submit
Expand Down
6 changes: 4 additions & 2 deletions lib/bootstrap_form/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# frozen_string_literal: true

module BootstrapForm
VERSION = "5.5.0".freeze
REQUIRED_RAILS_VERSION = ">= 7.2".freeze
VERSION = "5.5.0"
REQUIRED_RAILS_VERSION = ">= 7.2"
end
2 changes: 2 additions & 0 deletions test/bootstrap_checkbox_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapCheckboxTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_configuration_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapConfigurationTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_fields_for_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapFieldsForTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_fields_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapFieldsTest < ActionView::TestCase
Expand Down
6 changes: 4 additions & 2 deletions test/bootstrap_form_group_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapFormGroupTest < ActionView::TestCase
Expand Down Expand Up @@ -671,8 +673,8 @@ class BootstrapFormGroupTest < ActionView::TestCase

test "non-default column span on form isn't mutated" do
frozen_horizontal_builder = BootstrapForm::FormBuilder.new(:user, @user, self, layout: :horizontal,
label_col: "col-sm-3".freeze,
control_col: "col-sm-9".freeze)
label_col: "col-sm-3",
control_col: "col-sm-9")
output = frozen_horizontal_builder.form_group { "test" }

expected = '<div class="mb-3 row"><div class="col-sm-9 offset-sm-3">test</div></div>'
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_form_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapFormTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_other_components_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapOtherComponentsTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_radio_button_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapRadioButtonTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_rich_text_area_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"
require "minitest/mock"

Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_selects_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapSelectsTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/bootstrap_without_fields_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class BootstrapWithoutFieldsTest < ActionView::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/special_form_class_models_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require_relative "test_helper"

class SpecialFormClassModelsTest < ActionView::TestCase
Expand Down
4 changes: 3 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

ENV["RAILS_ENV"] ||= "test"

puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop/ignore Rails/Output
puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop:disable Rails/Output

require "warning"
mail_gem_path = Gem::Specification.find_by_name("mail").full_gem_path
Expand Down