middleman-cli 4.3.0.rc.1 → 4.3.0.rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Rakefile +0 -1
- data/bin/middleman +4 -4
- data/features/preview_server.feature +1 -0
- data/features/support/env.rb +2 -1
- data/fixtures/preview-server-app/bin/dns_server.rb +12 -13
- data/fixtures/preview-server-hook-app/config.rb +1 -1
- data/lib/middleman-cli.rb +1 -3
- data/lib/middleman-cli/build.rb +2 -2
- data/lib/middleman-cli/init.rb +22 -21
- data/lib/middleman-cli/templates/extension/Gemfile +1 -1
- data/lib/middleman-cli/templates/extension/Rakefile +1 -1
- data/lib/middleman-cli/templates/extension/lib/lib/extension.rb +1 -1
- data/middleman-cli.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 869f5be23dce78a38e541a0292cdf3c68ddfde54358906859b6748e400964cd4
|
|
4
|
+
data.tar.gz: 41193c17e826abdf41afd3fc6dd38e46a075b42ce14ab6b101d43c746151f6a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15ae81a110b21f1d1373d5f24ed201b23c3274b317f8497765a4eefe68f116ad9464d1bc75ec729e9c686952d11d342ff0a91ae981aa8572cafebb3fa69eefed
|
|
7
|
+
data.tar.gz: f3e0cc810a50f74b4108ef54e38726c8f9a1c63ad50461360f1612a1743ba35959584b65ffca0a7dcaa97dd3a6e4cb0d70c131c541153c397bcabc1f1360edc6
|
data/Rakefile
CHANGED
data/bin/middleman
CHANGED
|
@@ -6,7 +6,7 @@ if ARGV.include? '--profile'
|
|
|
6
6
|
end
|
|
7
7
|
# Middleman::Profiling.start
|
|
8
8
|
|
|
9
|
-
require
|
|
9
|
+
require 'middleman-core/load_paths'
|
|
10
10
|
Middleman.setup_load_paths
|
|
11
11
|
|
|
12
12
|
require 'dotenv'
|
|
@@ -35,13 +35,13 @@ module Middleman::Cli
|
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
require
|
|
38
|
+
require 'middleman-cli'
|
|
39
39
|
|
|
40
40
|
# Change directory to the root
|
|
41
|
-
Dir.chdir(ENV[
|
|
41
|
+
Dir.chdir(ENV['MM_ROOT']) if ENV['MM_ROOT']
|
|
42
42
|
|
|
43
43
|
# Default command is server
|
|
44
|
-
if ARGV[0] != 'help' && (ARGV.
|
|
44
|
+
if ARGV[0] != 'help' && (ARGV.empty? || ARGV.first.include?('-'))
|
|
45
45
|
ARGV.unshift('server')
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -316,6 +316,7 @@ Feature: Run the preview server
|
|
|
316
316
|
Inspect your site configuration at "http://[::1]:4567/__middleman"
|
|
317
317
|
"""
|
|
318
318
|
|
|
319
|
+
@wip
|
|
319
320
|
Scenario: Start the server with https
|
|
320
321
|
When I run `middleman server --verbose --https` interactively
|
|
321
322
|
And I stop middleman if the output contains:
|
data/features/support/env.rb
CHANGED
|
@@ -6,25 +6,24 @@ require 'psych'
|
|
|
6
6
|
db_file = ARGV[0]
|
|
7
7
|
port = ARGV[1] || 5300
|
|
8
8
|
|
|
9
|
-
db =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
db = if File.file? db_file
|
|
10
|
+
warn 'Found dns db'
|
|
11
|
+
Psych.load_file(db_file)
|
|
12
|
+
else
|
|
13
|
+
warn 'Found no dns db. Use default db.'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
{
|
|
16
|
+
/www\.example\.org/ => '1.1.1.1'
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
19
|
|
|
20
20
|
interfaces = [
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
[:udp, '127.0.0.1', port],
|
|
22
|
+
[:tcp, '127.0.0.1', port]
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
# Start the RubyDNS server
|
|
27
|
-
RubyDNS
|
|
26
|
+
RubyDNS.run_server(listen: interfaces) do
|
|
28
27
|
db.each do |matcher, result|
|
|
29
28
|
match(matcher, Resolv::DNS::Resource::IN::A) do |transaction|
|
|
30
29
|
transaction.respond!(result)
|
|
@@ -9,7 +9,7 @@ class MyFeature < Middleman::Extension
|
|
|
9
9
|
puts "/// #{server_information.port} ///"
|
|
10
10
|
puts "/// #{server_information.server_name} ///"
|
|
11
11
|
puts "/// #{server_information.site_addresses.first} ///"
|
|
12
|
-
puts
|
|
12
|
+
puts '/// ### END ### ///'
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
data/lib/middleman-cli.rb
CHANGED
data/lib/middleman-cli/build.rb
CHANGED
|
@@ -44,7 +44,7 @@ module Middleman::Cli
|
|
|
44
44
|
def build
|
|
45
45
|
root = ENV['MM_ROOT'] || Dir.pwd
|
|
46
46
|
|
|
47
|
-
unless File.
|
|
47
|
+
unless File.exist?(File.join(root, 'config.rb'))
|
|
48
48
|
raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -101,7 +101,7 @@ module Middleman::Cli
|
|
|
101
101
|
# @param [String] contents The event contents.
|
|
102
102
|
# @param [String] extra The extra information.
|
|
103
103
|
# @return [void]
|
|
104
|
-
def on_event(event_type, target, extra=nil)
|
|
104
|
+
def on_event(event_type, target, extra = nil)
|
|
105
105
|
case event_type
|
|
106
106
|
when :error
|
|
107
107
|
say_status :error, target, :red
|
data/lib/middleman-cli/init.rb
CHANGED
|
@@ -39,26 +39,26 @@ module Middleman::Cli
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
repo_path, repo_branch = if shortname?(options[:template])
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
42
|
+
require 'open-uri'
|
|
43
|
+
require 'json'
|
|
44
|
+
|
|
45
|
+
api = 'https://directory.middlemanapp.com/api'
|
|
46
|
+
uri = ::URI.parse("#{api}/#{options[:template]}.json")
|
|
47
|
+
|
|
48
|
+
begin
|
|
49
|
+
data = ::JSON.parse(uri.read)
|
|
50
|
+
is_local_dir = false
|
|
51
|
+
data['links']['github'].split('#')
|
|
52
|
+
rescue ::OpenURI::HTTPError
|
|
53
|
+
say "Template `#{options[:template]}` not found in Middleman Directory."
|
|
54
|
+
say 'Did you mean to use a full `user/repo` path?'
|
|
55
|
+
exit 1
|
|
56
|
+
end
|
|
57
|
+
else
|
|
58
|
+
repo_name, repo_branch = options[:template].split('#')
|
|
59
|
+
repo_path, is_local_dir = repository_path(repo_name)
|
|
60
|
+
[repo_path, repo_branch]
|
|
61
|
+
end
|
|
62
62
|
|
|
63
63
|
begin
|
|
64
64
|
dir = is_local_dir ? repo_path : clone_repository(repo_path, repo_branch)
|
|
@@ -88,6 +88,7 @@ module Middleman::Cli
|
|
|
88
88
|
# Copied from Bundler
|
|
89
89
|
def git_present?
|
|
90
90
|
return @git_present if defined?(@git_present)
|
|
91
|
+
|
|
91
92
|
@git_present = which(GIT_CMD) || which('git.exe')
|
|
92
93
|
end
|
|
93
94
|
|
|
@@ -126,7 +127,7 @@ module Middleman::Cli
|
|
|
126
127
|
git_path = "#{branch_cmd}#{repo_path}"
|
|
127
128
|
run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
|
|
128
129
|
|
|
129
|
-
unless
|
|
130
|
+
unless $CHILD_STATUS.success?
|
|
130
131
|
say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
|
|
131
132
|
exit 1
|
|
132
133
|
end
|
|
@@ -4,7 +4,7 @@ Bundler::GemHelper.install_tasks
|
|
|
4
4
|
require 'cucumber/rake/task'
|
|
5
5
|
|
|
6
6
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
|
7
|
-
t.cucumber_opts = '--color --tags
|
|
7
|
+
t.cucumber_opts = '--fail-fast --color --tags 'not @wip' --strict'
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
require 'rake/clean'
|
|
@@ -5,7 +5,7 @@ require 'middleman-core'
|
|
|
5
5
|
class MyExtension < ::Middleman::Extension
|
|
6
6
|
option :my_option, 'default', 'An example option'
|
|
7
7
|
|
|
8
|
-
def initialize(app, options_hash={}, &block)
|
|
8
|
+
def initialize(app, options_hash = {}, &block)
|
|
9
9
|
# Call super to build options from the options_hash
|
|
10
10
|
super
|
|
11
11
|
|
data/middleman-cli.gemspec
CHANGED
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
|
|
18
18
|
s.executable = 'middleman'
|
|
19
19
|
s.require_path = 'lib'
|
|
20
|
-
s.required_ruby_version = '>= 2.
|
|
20
|
+
s.required_ruby_version = '>= 2.3.0'
|
|
21
21
|
|
|
22
22
|
# CLI
|
|
23
23
|
s.add_dependency('thor', ['>= 0.17.0', '< 2.0'])
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.3.0.rc.
|
|
4
|
+
version: 4.3.0.rc.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Reynolds
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-03
|
|
12
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
95
95
|
requirements:
|
|
96
96
|
- - ">="
|
|
97
97
|
- !ruby/object:Gem::Version
|
|
98
|
-
version: 2.
|
|
98
|
+
version: 2.3.0
|
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
101
|
- - ">"
|
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
103
103
|
version: 1.3.1
|
|
104
104
|
requirements: []
|
|
105
105
|
rubyforge_project:
|
|
106
|
-
rubygems_version: 2.
|
|
106
|
+
rubygems_version: 2.7.7
|
|
107
107
|
signing_key:
|
|
108
108
|
specification_version: 4
|
|
109
109
|
summary: Hand-crafted frontend development
|