Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit f8d1b57

Browse files
committed
Merge branch 'development'
2 parents 50dcece + 351992a commit f8d1b57

File tree

45 files changed

+1894
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1894
-14
lines changed

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ Metrics/BlockLength:
5858
Description: 'Some unit tests are going to be naturally long; no need to flag this up.'
5959
Exclude:
6060
- spec/**/*
61+
62+
Layout/EmptyLinesAroundArguments:
63+
Description: 'Produces false positives when using multi-line strings with spaces.'
64+
Exclude:
65+
- 'modules/**/*'

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3
1+
2.5.1

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: ruby
22
rvm:
3-
- 2.3.5
4-
- 2.4.2
5-
- 2.4.3
3+
- 2.3.7
4+
- 2.4.4
5+
- 2.5.1
66
before_install:
77
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
8+
- "gem install bundler"
89
script: bundle exec rspec
910
branches:
1011
except:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.1
1+
1.9.2

lib/cli/console.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ class Console
2323
include Cli::Output
2424

2525
def commands_without_output
26-
%w(back)
26+
%w[back]
2727
end
2828

2929
def permitted_commands
30-
%w(use back set show quit run unset check info gset gunset search clear
31-
reload help)
30+
%w[
31+
use back set show quit run unset check info
32+
gset setg gunset unsetg search clear reload help
33+
]
3234
end
3335

3436
def initialize
@@ -112,8 +114,20 @@ def on_event_emitted(event)
112114
end
113115
end
114116

117+
def normalise_alised_commands(command)
118+
if command == 'exit'
119+
'quit'
120+
elsif command == 'setg'
121+
'gset'
122+
elsif command == 'unsetg'
123+
'gunset'
124+
else
125+
command
126+
end
127+
end
128+
115129
def execute_user_command(command, args)
116-
command = 'quit' if command == 'exit'
130+
command = normalise_alised_commands(command)
117131
if can_handle? command
118132
puts unless commands_without_output.include? command
119133
send(command, *args) if correct_number_of_args?(command, args)

lib/cli/loaded_module.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def run
4444
end
4545

4646
context.module.cleanup
47+
self.indent_level = 1
4748
end
4849

4950
def check

lib/cli/output.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,7 @@ def print_table_row(data, widths)
8989
end
9090
puts ''
9191
end
92+
93+
attr_accessor :indent_level
9294
end
9395
end

lib/wpxf/net/http_server.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ def start_http_server(non_block = false)
8484

8585
# Stop the HTTP server after it has finished processing the current request.
8686
def stop_http_server
87+
return false if @is_stopping
88+
@is_stopping = true
89+
8790
emit_info 'Stopping HTTP server...', true
8891
@http_server_kill_switch = true
89-
@http_server_thread.exit if @http_server_thread
92+
@http_server_thread&.exit
9093
@tcp_server.close if !@tcp_server.nil? && !@tcp_server.closed?
9194
emit_info 'HTTP server stopped'
95+
@is_stopping = false
9296
end
9397

9498
# @return [Thread] thread that the server runs on when in non-blocking mode.
@@ -147,11 +151,10 @@ def http_server_loop
147151
rescue SignalException
148152
emit_warning 'Caught kill signal', true
149153
rescue StandardError => e
150-
emit_warning "Socket error: #{e}", true
154+
emit_error "Socket error: #{e}"
151155
end
152156

153-
@tcp_server.close if !@tcp_server.nil? && !@tcp_server.closed?
154-
@http_server_kill_switch = false
157+
stop_http_server
155158
end
156159

157160
def handle_incoming_http_request(socket)

lib/wpxf/wordpress/comments.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
module Wpxf::WordPress::Comments
55
include Wpxf
66

7+
# Initialises a new instance of {Comments}
78
def initialize
89
super
910
end

lib/wpxf/wordpress/hash_dump.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
module Wpxf::WordPress::HashDump
55
include Wpxf
66

7+
# Initialises a new instance of {HashDump}
78
def initialize
89
super
910

0 commit comments

Comments
 (0)