Skip to content

Commit e4c8efa

Browse files
committed
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping
1 parent 6f4719a commit e4c8efa

33 files changed

+3493
-3490
lines changed

.rubocop.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ Style/EachWithObject:
7575
Style/Encoding:
7676
Enabled: false
7777

78+
Style/FrozenStringLiteralComment:
79+
Enabled: false
80+
7881
Style/Lambda:
7982
Enabled: false
8083

@@ -85,8 +88,8 @@ Style/RegexpLiteral:
8588
Exclude:
8689
- 'Guardfile'
8790

88-
Style/FrozenStringLiteralComment:
89-
Enabled: false
91+
Style/StringLiterals:
92+
EnforcedStyle: double_quotes
9093

9194
Style/TrailingCommaInArrayLiteral:
9295
EnforcedStyleForMultiline: 'comma'

Gemfile

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

3-
gem 'rake'
4-
gem 'rubocop-rake'
5-
gem 'rubocop-rspec'
3+
gem "rake"
4+
gem "rubocop-rake"
5+
gem "rubocop-rspec"
66

77
group :development do
8-
gem 'pry'
8+
gem "pry"
99
end
1010

1111
group :test do
12-
gem 'coveralls'
13-
gem 'rb-readline', '>= 0.5.5'
14-
gem 'rspec', '>= 3'
15-
gem 'rubocop', '>= 0.79'
16-
gem 'simplecov', '>= 0.18.2'
17-
gem 'timecop'
18-
gem 'tins'
19-
gem 'webmock', '>= 3.8.2'
12+
gem "coveralls"
13+
gem "rb-readline", ">= 0.5.5"
14+
gem "rspec", ">= 3"
15+
gem "rubocop", ">= 0.79"
16+
gem "simplecov", ">= 0.18.2"
17+
gem "timecop"
18+
gem "tins"
19+
gem "webmock", ">= 3.8.2"
2020
end
2121

2222
gemspec

Rakefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
require 'bundler'
1+
require "bundler"
22
Bundler::GemHelper.install_tasks
33

4-
require 'rspec/core/rake_task'
4+
require "rspec/core/rake_task"
55
RSpec::Core::RakeTask.new(:spec)
66

77
begin
8-
require 'rubocop/rake_task'
8+
require "rubocop/rake_task"
99
RuboCop::RakeTask.new
1010
rescue LoadError
11-
desc 'Run RuboCop'
11+
desc "Run RuboCop"
1212
task :rubocop do
13-
warn 'Rubocop is disabled'
13+
warn "Rubocop is disabled"
1414
end
1515
end
1616

17-
Dir.glob('tasks/*.rake').each { |r| import r }
17+
Dir.glob("tasks/*.rake").each { |r| import r }
1818

19-
task release: ['completion:zsh', 'completion:bash']
19+
task release: ["completion:zsh", "completion:bash"]
2020
task test: :spec
2121
task default: %i[spec rubocop]

bin/t

+13-13
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# Trap interrupts to quit cleanly. See
44
# https://twitter.com/mitchellh/status/283014103189053442
5-
Signal.trap('INT') { abort }
5+
Signal.trap("INT") { abort }
66

7-
require 'oauth'
8-
require 't'
9-
require 'twitter'
7+
require "oauth"
8+
require "t"
9+
require "twitter"
1010

1111
# Output message to $stderr, prefixed with the program name
1212
def pute(*args)
@@ -19,21 +19,21 @@ end
1919
begin
2020
T::CLI.start(ARGV)
2121
rescue Interrupt
22-
pute 'Quitting...'
22+
pute "Quitting..."
2323
rescue OAuth::Unauthorized
24-
pute 'Authorization failed'
24+
pute "Authorization failed"
2525
rescue Twitter::Error::TooManyRequests => e
2626
pute e.message, "The rate limit for this request will reset in #{e.rate_limit.reset_in} #{e.rate_limit.reset_in == 1 ? 'second' : 'seconds'}."
2727
rescue Twitter::Error::BadRequest => e
28-
pute e.message, 'Run `t authorize` to authorize.'
28+
pute e.message, "Run `t authorize` to authorize."
2929
rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized => e
30-
if e.message == 'Error processing your OAuth request: Read-only application cannot POST' ||
31-
e.message == 'This application is not allowed to access or delete your direct messages'
30+
if e.message == "Error processing your OAuth request: Read-only application cannot POST" ||
31+
e.message == "This application is not allowed to access or delete your direct messages"
3232
warn(%q(Make sure to set your Twitter application's Access Level to "Read, Write and Access direct messages".))
33-
require 'thor'
34-
Thor::Shell::Basic.new.ask 'Press [Enter] to open the Twitter Developer site.'
35-
require 'launchy'
36-
Launchy.open('https://dev.twitter.com/apps') { |u, _, _| warn "Manually open #{u}" }
33+
require "thor"
34+
Thor::Shell::Basic.new.ask "Press [Enter] to open the Twitter Developer site."
35+
require "launchy"
36+
Launchy.open("https://dev.twitter.com/apps") { |u, _, _| warn "Manually open #{u}" }
3737
else
3838
pute e.message
3939
end

lib/t.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
require 't/cli'
2-
require 'time'
1+
require "t/cli"
2+
require "time"
33

44
module T
55
class << self

0 commit comments

Comments
 (0)