Skip to content

Commit

Permalink
issue #494: add magic # frozen_string_literal: true comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinDKelley committed Oct 14, 2020
1 parent 86e06ae commit 48c8871
Show file tree
Hide file tree
Showing 62 changed files with 124 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Create this file to use pristine/installed version of Listen for development
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

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

require 'logger'
require 'weakref'
require 'listen/logger'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/adapter/base'
require 'listen/adapter/bsd'
require 'listen/adapter/darwin'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/base.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/options'
require 'listen/record'
require 'listen/change'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/bsd.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Listener implementation for BSD's `kqueue`.
# @see http://www.freebsd.org/cgi/man.cgi?query=kqueue
# @see https://github.com/mat813/rb-kqueue/blob/master/lib/rb-kqueue/queue.rb
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/config.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'pathname'

module Listen
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/darwin.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'

module Listen
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/linux.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
module Adapter
# @see https://github.com/nex3/rb-inotify
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/polling.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
module Adapter
# Polling Adapter that works cross-platform and
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/adapter/windows.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
module Adapter
# Adapter implementation for Windows `wdm`.
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/backend.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/adapter'
require 'listen/adapter/base'
require 'listen/adapter/config'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/change.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/file'
require 'listen/directory'

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

require 'thor'
require 'listen'
require 'logger'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/directory.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'

module Listen
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/event/config.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
module Event
class Config
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/event/loop.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'

require 'timeout'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/event/processor.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
module Event
class Processor
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/event/queue.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'

require 'forwardable'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/file.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'digest/md5'

module Listen
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/fsm.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Code copied from https://github.com/celluloid/celluloid-fsm

require 'thread'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/listener.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'English'

require 'listen/version'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/listener/config.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
class Listener
class Config
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/logger.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
def self.logger
@logger ||= nil
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/options.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
class Options
def initialize(opts, defaults)
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/queue_optimizer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
class QueueOptimizer
class Config
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/record.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'
require 'listen/record/entry'
require 'listen/record/symlink_detector'
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/record/entry.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
# @private api
class Record
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/record/symlink_detector.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'

module Listen
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/silencer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
class Silencer
# The default list of directories that get ignored.
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/silencer/controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
class Silencer
class Controller
Expand Down
2 changes: 2 additions & 0 deletions lib/listen/version.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Listen
VERSION = '3.2.1'.freeze
end
2 changes: 2 additions & 0 deletions spec/acceptance/listen_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# encoding: UTF-8

RSpec.describe 'Listen', acceptance: true do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/base_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Adapter::Base do
class FakeAdapter < described_class
def initialize(config)
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/bsd_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Adapter::BSD do
describe 'class' do
subject { described_class }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/config_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/adapter/config'

RSpec.describe Listen::Adapter::Config do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/darwin_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This is just so stubs work
require 'rb-fsevent'

Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/linux_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Adapter::Linux do
describe 'class' do
subject { described_class }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/polling_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

include Listen

RSpec.describe Adapter::Polling do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter/windows_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Adapter::Windows do
describe 'class' do
subject { described_class }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/adapter_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Adapter do
let(:listener) { instance_double(Listen::Listener, options: {}) }
before do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/backend_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/backend'

RSpec.describe Listen::Backend do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/change_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Change do
let(:config) { instance_double(Listen::Change::Config) }
let(:dir) { instance_double(Pathname) }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/cli_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/cli'

RSpec.describe Listen::CLI do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/directory_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

include Listen

RSpec.describe Directory do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/event/config_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/event/config'

RSpec.describe Listen::Event::Config do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/event/loop_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread'
require 'listen/event/config'
require 'listen/event/loop'
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/event/processor_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/event/processor'
require 'listen/event/config'

Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/event/queue_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/event/queue'

# TODO: not part of listener really
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/file_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::File do
let(:record) do
instance_double(
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/fsm_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::FSM do
context 'simple FSM' do
class SpecSimpleFsm
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/listener/config_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/listener/config'
RSpec.describe Listen::Listener::Config do
describe 'options' do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/listener_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

include Listen

RSpec.describe Listener do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/queue_optimizer_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::QueueOptimizer do
let(:config) { instance_double(Listen::QueueOptimizer::Config) }
subject { described_class.new(config) }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/record_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen::Record do
let(:dir) { instance_double(Pathname, to_s: '/dir') }
let(:record) { Listen::Record.new(dir) }
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/silencer/controller_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'listen/silencer/controller'

RSpec.describe Listen::Silencer::Controller do
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen/silencer_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec::Matchers.define :accept do |type, path|
match { |actual| !actual.silenced?(Pathname(path), type) }
end
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/listen_spec.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe Listen do
let(:listener) { instance_double(Listen::Listener, stop: nil) }

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

# TODO: reduce requires everwhere and be more strict about it
require 'listen'

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

{
modification: :modified,
addition: :added,
Expand Down
2 changes: 2 additions & 0 deletions spec/support/fixtures_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'tmpdir'

include FileUtils
Expand Down
2 changes: 2 additions & 0 deletions spec/support/platform_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

def darwin?
RbConfig::CONFIG['target_os'] =~ /darwin/i
end
Expand Down

0 comments on commit 48c8871

Please sign in to comment.