middleman-cli 4.3.0.rc.1 → 4.3.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 62508ac01ace610a0772fa2aaba90e46edf0fb36
4
- data.tar.gz: d110634639c89a17396209780555aec998e895cb
2
+ SHA256:
3
+ metadata.gz: 869f5be23dce78a38e541a0292cdf3c68ddfde54358906859b6748e400964cd4
4
+ data.tar.gz: 41193c17e826abdf41afd3fc6dd38e46a075b42ce14ab6b101d43c746151f6a9
5
5
  SHA512:
6
- metadata.gz: c5fa44cea315462e39202442c8fbd904f08d8b5108a9772e1e59a9431031a83da197f6f879487261b4b5d9da8d2f05286141367cb4e1580817ba4c23fbb161cd
7
- data.tar.gz: 0e913ef272bb8f9a9a670f38adcd0eb4cce77a9b9856b0ac18f1826ce6d08c7449d774952ff384b95b7d379ff628f5d990c724d5502d390b48c4e77c04a17b70
6
+ metadata.gz: 15ae81a110b21f1d1373d5f24ed201b23c3274b317f8497765a4eefe68f116ad9464d1bc75ec729e9c686952d11d342ff0a91ae981aa8572cafebb3fa69eefed
7
+ data.tar.gz: f3e0cc810a50f74b4108ef54e38726c8f9a1c63ad50461360f1612a1743ba35959584b65ffca0a7dcaa97dd3a6e4cb0d70c131c541153c397bcabc1f1360edc6
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- # coding:utf-8
2
1
  RAKE_ROOT = __FILE__.freeze
3
2
  GEM_NAME = 'middleman-cli'.freeze
4
3
  require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
data/bin/middleman CHANGED
@@ -6,7 +6,7 @@ if ARGV.include? '--profile'
6
6
  end
7
7
  # Middleman::Profiling.start
8
8
 
9
- require "middleman-core/load_paths"
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 "middleman-cli"
38
+ require 'middleman-cli'
39
39
 
40
40
  # Change directory to the root
41
- Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
41
+ Dir.chdir(ENV['MM_ROOT']) if ENV['MM_ROOT']
42
42
 
43
43
  # Default command is server
44
- if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
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:
@@ -1,5 +1,6 @@
1
- ENV["TEST"] = "true"
1
+ ENV['TEST'] = 'true'
2
2
 
3
+ require 'backports/latest'
3
4
  require 'sassc'
4
5
 
5
6
  require 'simplecov'
@@ -6,25 +6,24 @@ require 'psych'
6
6
  db_file = ARGV[0]
7
7
  port = ARGV[1] || 5300
8
8
 
9
- db = if File.file? db_file
10
- $stderr.puts 'Found dns db'
11
- Psych.load_file(db_file)
12
- else
13
- $stderr.puts 'Found no dns db. Use default db.'
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
- /www\.example\.org/ => '1.1.1.1'
17
- }
18
- end
15
+ {
16
+ /www\.example\.org/ => '1.1.1.1'
17
+ }
18
+ end
19
19
 
20
20
  interfaces = [
21
- [:udp, "127.0.0.1", port],
22
- [:tcp, "127.0.0.1", port]
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::run_server(listen: interfaces) do
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 "/// ### END ### ///"
12
+ puts '/// ### END ### ///'
13
13
  end
14
14
  end
15
15
  end
data/lib/middleman-cli.rb CHANGED
@@ -1,7 +1,5 @@
1
- # rubocop:disable FileName
2
-
3
1
  # Setup our load paths
4
- libdir = File.expand_path(File.dirname(__FILE__))
2
+ libdir = __dir__
5
3
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
6
4
 
7
5
  # Require Thor since that's what the whole CLI is built around
@@ -44,7 +44,7 @@ module Middleman::Cli
44
44
  def build
45
45
  root = ENV['MM_ROOT'] || Dir.pwd
46
46
 
47
- unless File.exists?(File.join(root, "config.rb"))
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
@@ -39,26 +39,26 @@ module Middleman::Cli
39
39
  end
40
40
 
41
41
  repo_path, repo_branch = if shortname?(options[:template])
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
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 $?.success?
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
@@ -12,7 +12,7 @@ group :development do
12
12
  end
13
13
 
14
14
  group :test do
15
- gem 'cucumber'
16
15
  gem 'aruba'
16
+ gem 'cucumber'
17
17
  gem 'rspec'
18
18
  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 ~@wip --strict'
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
 
@@ -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.2.0'
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.1
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-06 00:00:00.000000000 Z
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.2.0
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.6.13
106
+ rubygems_version: 2.7.7
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Hand-crafted frontend development