Skip to content

Commit

Permalink
Add frozen_string_literal pragma to ruby files (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiek1507 authored and brendon committed Mar 19, 2018
1 parent cc92aa9 commit 26ef8c2
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 2 deletions.
2 changes: 2 additions & 0 deletions init.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

$:.unshift "#{File.dirname(__FILE__)}/lib"
require "acts_as_list"
2 changes: 2 additions & 0 deletions lib/acts_as_list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "acts_as_list/active_record/acts/list"
require "acts_as_list/active_record/acts/position_column_method_definer"
require "acts_as_list/active_record/acts/scope_method_definer"
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/active_record.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ActiveSupport.on_load :active_record do
extend ActiveRecord::Acts::List::ClassMethods
end
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::AddNewAtMethodDefiner #:nodoc:
def self.call(caller_class, add_new_at)
caller_class.class_eval do
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/aux_method_definer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::AuxMethodDefiner #:nodoc:
def self.call(caller_class)
caller_class.class_eval do
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/callback_definer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::CallbackDefiner #:nodoc:
def self.call(caller_class, add_new_at)
caller_class.class_eval do
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord
module Acts #:nodoc:
module List #:nodoc:
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/no_update.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord
module Acts
module List
Expand Down
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::PositionColumnMethodDefiner #:nodoc:
def self.call(caller_class, position_column)
define_class_methods(caller_class, position_column)
Expand Down Expand Up @@ -29,7 +31,7 @@ def self.define_class_methods(caller_class, position_column)
end

define_singleton_method :update_all_with_touch do |updates|
update_all(updates << touch_record_sql)
update_all(updates + touch_record_sql)
end

private
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/active_record/acts/scope_method_definer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::ScopeMethodDefiner #:nodoc:
extend ActiveSupport::Inflector

Expand Down
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::SequentialUpdatesMethodDefiner #:nodoc:
def self.call(caller_class, column, sequential_updates_option)
caller_class.class_eval do
Expand Down
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord::Acts::List::TopOfListMethodDefiner #:nodoc:
def self.call(caller_class, top_of_list)
caller_class.class_eval do
Expand Down
2 changes: 2 additions & 0 deletions lib/acts_as_list/version.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveRecord
module Acts
module List
Expand Down
2 changes: 2 additions & 0 deletions test/helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# $DEBUG = true

require "rubygems"
Expand Down
2 changes: 2 additions & 0 deletions test/shared.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Common shared behaviour.
module Shared
autoload :List, 'shared_list'
Expand Down
2 changes: 2 additions & 0 deletions test/shared_array_scope_list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module ArrayScopeList
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/shared_list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module List
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/shared_list_sub.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module ListSub
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/shared_no_addition.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module NoAddition
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/shared_quoting.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module Quoting

Expand Down
2 changes: 2 additions & 0 deletions test/shared_top_addition.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module TopAddition
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/shared_zero_based.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Shared
module ZeroBased
def setup
Expand Down
2 changes: 2 additions & 0 deletions test/test_joined_list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'helper'

class Section < ActiveRecord::Base
Expand Down
2 changes: 2 additions & 0 deletions test/test_list.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# NOTE: following now done in helper.rb (better Readability)
require 'helper'

Expand Down
2 changes: 2 additions & 0 deletions test/test_no_update_for_extra_classes.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'helper'

class TodoList < ActiveRecord::Base
Expand Down
4 changes: 3 additions & 1 deletion test/test_no_update_for_scope_destruction.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'helper'

class DestructionTodoList < ActiveRecord::Base
Expand Down Expand Up @@ -69,4 +71,4 @@ def test_update_children_when_sibling_destroyed
end

end
end
end

0 comments on commit 26ef8c2

Please sign in to comment.