Skip to content

Commit

Permalink
Merge pull request #17 from tablexi/frozen_string_literal
Browse files Browse the repository at this point in the history
Add frozen string literal cop
  • Loading branch information
jhanggi authored Jan 22, 2019
2 parents 2d426de + 4fb2d20 commit 5c403ec
Show file tree
Hide file tree
Showing 23 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inherit_from:
Style/StringLiterals:
EnforcedStyle: double_quotes

Style/FrozenStringLiteralComment:
EnforcedStyle: always

Metrics/LineLength:
Max: 120

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

source "https://rubygems.org"

# Declare your gem's dependencies in workflow.gemspec.
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

begin
require "bundler/setup"
rescue LoadError
Expand Down
2 changes: 2 additions & 0 deletions flow_machine.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.push File.expand_path("lib", __dir__)

# Maintain your gem's version:
Expand Down
2 changes: 2 additions & 0 deletions lib/flow_machine.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift(File.dirname(__FILE__))

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

require "active_support/core_ext/object/blank"
require "active_support/core_ext/array/extract_options"

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

module FlowMachine
class ChangeCallback < FlowMachine::StateCallback
attr_accessor :field
Expand Down
2 changes: 2 additions & 0 deletions lib/flow_machine/state_callback.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module FlowMachine
class StateCallback < FlowMachine::Callback
def run_method(target, method)
Expand Down
2 changes: 2 additions & 0 deletions lib/flow_machine/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module FlowMachine
VERSION = "0.2.3".freeze
end
2 changes: 2 additions & 0 deletions lib/flow_machine/workflow.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "active_support/core_ext/module/delegation"
require "active_support/core_ext/object/try"
require "flow_machine/workflow/factory_methods"
Expand Down
2 changes: 2 additions & 0 deletions lib/flow_machine/workflow/factory_methods.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# These methods are extended in the base FlowMachine module
module FlowMachine
module FactoryMethods
Expand Down
2 changes: 2 additions & 0 deletions lib/flow_machine/workflow/model_extension.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

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

require "active_support/core_ext/module/delegation"
require "active_support/inflector"

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

# desc "Explaining what the task does"
# task :workflow do
# # Task goes here
Expand Down
2 changes: 2 additions & 0 deletions spec/flow_machine/factory_methods_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe FlowMachine::Workflow do
class TestClass; end

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

RSpec.describe FlowMachine::Workflow do
let(:state_class1) do
Class.new(FlowMachine::WorkflowState) do
Expand Down
2 changes: 2 additions & 0 deletions spec/flow_machine/workflow/model_extension_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "ostruct"

RSpec.describe FlowMachine::Workflow::ModelExtension do
Expand Down
2 changes: 2 additions & 0 deletions spec/flow_machine/workflow_callback_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe FlowMachine::Callback do
let(:object) { double }

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

RSpec.describe FlowMachine::ChangeCallback do
subject(:callback) { described_class.new(:field, :method, if: :condition?) }

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

require "ostruct"

RSpec.describe FlowMachine::Workflow do
Expand Down
2 changes: 2 additions & 0 deletions spec/flow_machine/workflow_state/transition_callbacks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "ostruct"

RSpec.describe FlowMachine::WorkflowState do
Expand Down
2 changes: 2 additions & 0 deletions spec/flow_machine/workflow_state_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe FlowMachine::WorkflowState do
class StateTestClass < described_class
def self.state_name
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

GEM_ROOT = File.expand_path("..", __dir__)
$LOAD_PATH.unshift File.join(GEM_ROOT, "lib")

Expand Down

0 comments on commit 5c403ec

Please sign in to comment.