middleman-cli 4.2.1 → 4.3.0.rc.1

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
2
  SHA1:
3
- metadata.gz: 4feeae5ebc27d96fb3612590049cd936012f7656
4
- data.tar.gz: a287d26153d59501e030c532dc67689e78ab2660
3
+ metadata.gz: 62508ac01ace610a0772fa2aaba90e46edf0fb36
4
+ data.tar.gz: d110634639c89a17396209780555aec998e895cb
5
5
  SHA512:
6
- metadata.gz: 281d2d6fb77e14e1f44df900fde079524b0a59065f3f69ad8cca7b0d5be2f4816437bbb46f4d353efa134d2d44089a102b59c44c489a17dedac60ae33efa7465
7
- data.tar.gz: 6f2f0b7c5d009764111a3014d69422dff3435806da3c09a745c1a28d7df1bc4ccd3076b57da72beea24bb0d13cde3f921a0ba7f009f992533a2e3ed1f4b601ec
6
+ metadata.gz: c5fa44cea315462e39202442c8fbd904f08d8b5108a9772e1e59a9431031a83da197f6f879487261b4b5d9da8d2f05286141367cb4e1580817ba4c23fbb161cd
7
+ data.tar.gz: 0e913ef272bb8f9a9a670f38adcd0eb4cce77a9b9856b0ac18f1826ce6d08c7449d774952ff384b95b7d379ff628f5d990c724d5502d390b48c4e77c04a17b70
data/bin/middleman CHANGED
@@ -47,7 +47,6 @@ end
47
47
 
48
48
  ::Middleman::Logger.singleton(3)
49
49
  ::Middleman::Cli.config = ::Middleman::Application.new do
50
- #
51
50
  config[:environment] = (ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development').to_sym
52
51
  config[:mode] = :config
53
52
  config[:exit_before_ready] = true
@@ -14,9 +14,8 @@ Feature: Middleman CLI
14
14
  | config.rb |
15
15
  | source/index.html.erb |
16
16
  | source/layouts/layout.erb |
17
- | source/javascripts/all.js |
17
+ | source/javascripts/site.js |
18
18
  | source/stylesheets/site.css.scss |
19
- | source/stylesheets/_normalize.scss |
20
19
 
21
20
  Scenario: Create a new project in the current directory
22
21
  Given a directory named "MY_PROJECT"
@@ -9,7 +9,7 @@ Feature: Run the preview server
9
9
  And the default aruba timeout is 30 seconds
10
10
 
11
11
  Scenario: Start the server with defaults
12
- When I run `middleman server` interactively
12
+ When I run the interactive middleman server
13
13
  And I stop middleman if the output contains:
14
14
  """
15
15
  Inspect your site configuration
@@ -139,6 +139,7 @@ Feature: Run the preview server
139
139
  Inspect your site configuration at "http://127.0.0.5:4567/__middleman"
140
140
  """
141
141
 
142
+ @wip
142
143
  Scenario: Start the server with bind address ::1
143
144
  Given a file named ".hosts" with:
144
145
  """
@@ -8,11 +8,8 @@ SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
8
8
  require 'phantomjs/poltergeist'
9
9
  Capybara.javascript_driver = :poltergeist
10
10
 
11
- require 'coveralls'
12
- Coveralls.wear!
13
-
14
- require 'codeclimate-test-reporter'
15
- CodeClimate::TestReporter.start
11
+ require 'simplecov'
12
+ SimpleCov.start
16
13
 
17
14
  PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
18
15
  require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-cli')
@@ -42,7 +42,9 @@ module Middleman::Cli
42
42
  # Core build Thor command
43
43
  # @return [void]
44
44
  def build
45
- unless ENV['MM_ROOT']
45
+ root = ENV['MM_ROOT'] || Dir.pwd
46
+
47
+ unless File.exists?(File.join(root, "config.rb"))
46
48
  raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
47
49
  end
48
50
 
@@ -79,7 +81,7 @@ module Middleman::Cli
79
81
  ::Middleman::Util.instrument 'builder.run' do
80
82
  if builder.run!
81
83
  clean_directories! if options['clean']
82
- shell.say 'Project built successfully.'
84
+ puts 'Project built successfully.'
83
85
  else
84
86
  msg = 'There were errors during this build'
85
87
  unless options['verbose']
@@ -22,6 +22,10 @@ module Middleman::Cli
22
22
  default: false,
23
23
  desc: 'Skip bundle install'
24
24
 
25
+ class_option 'bundle-path',
26
+ type: :string,
27
+ desc: 'Use specified bundle path'
28
+
25
29
  # The init task
26
30
  def init
27
31
  require 'fileutils'
@@ -43,7 +47,7 @@ module Middleman::Cli
43
47
 
44
48
  begin
45
49
  data = ::JSON.parse(uri.read)
46
- data['links']['github']
50
+ is_local_dir = false
47
51
  data['links']['github'].split('#')
48
52
  rescue ::OpenURI::HTTPError
49
53
  say "Template `#{options[:template]}` not found in Middleman Directory."
@@ -52,21 +56,12 @@ module Middleman::Cli
52
56
  end
53
57
  else
54
58
  repo_name, repo_branch = options[:template].split('#')
55
- [repository_path(repo_name), repo_branch]
59
+ repo_path, is_local_dir = repository_path(repo_name)
60
+ [repo_path, repo_branch]
56
61
  end
57
62
 
58
- dir = Dir.mktmpdir
59
-
60
63
  begin
61
- branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
62
-
63
- git_path = "#{branch_cmd}#{repo_path}"
64
- run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
65
-
66
- unless $?.success?
67
- say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
68
- exit 1
69
- end
64
+ dir = is_local_dir ? repo_path : clone_repository(repo_path, repo_branch)
70
65
 
71
66
  inside(target) do
72
67
  thorfile = File.join(dir, 'Thorfile')
@@ -80,10 +75,11 @@ module Middleman::Cli
80
75
  directory dir, '.', exclude_pattern: /\.git\/|\.gitignore$/
81
76
  end
82
77
 
83
- run('bundle install') unless ENV['TEST'] || options[:'skip-bundle']
78
+ bundle_args = options[:'bundle-path'] ? " --path=#{options[:'bundle-path']}" : ''
79
+ run("bundle install#{bundle_args}") unless ENV['TEST'] || options[:'skip-bundle']
84
80
  end
85
81
  ensure
86
- FileUtils.remove_entry(dir) if File.directory?(dir)
82
+ FileUtils.remove_entry(dir) if !is_local_dir && File.directory?(dir)
87
83
  end
88
84
  end
89
85
 
@@ -112,8 +108,30 @@ module Middleman::Cli
112
108
  repo.split('/').length == 1
113
109
  end
114
110
 
115
- def repository_path(repo)
116
- repo.include?('://') || repo.include?('git@') ? repo : "https://github.com/#{repo}.git"
111
+ def repository_path(repo_name)
112
+ if repo_name.include?('://') || /^[^@]+@[^:]+:.+/ =~ repo_name
113
+ repo_name
114
+ elsif (repo_path = Pathname(repo_name)).directory? && repo_path.absolute?
115
+ [repo_name, true]
116
+ else
117
+ "https://github.com/#{repo_name}.git"
118
+ end
119
+ end
120
+
121
+ def clone_repository(repo_path, repo_branch)
122
+ dir = Dir.mktmpdir
123
+
124
+ branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
125
+
126
+ git_path = "#{branch_cmd}#{repo_path}"
127
+ run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
128
+
129
+ unless $?.success?
130
+ say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
131
+ exit 1
132
+ end
133
+
134
+ dir
117
135
  end
118
136
 
119
137
  # Add to CLI
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.email = ['me@tdreyno.com', 'ben@benhollis.net']
12
12
  s.homepage = 'http://middlemanapp.com'
13
13
  s.summary = 'Hand-crafted frontend development'
14
- s.description = 'A static site generator. Provides dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.'
14
+ s.description = 'A static site generator. Provides dozens of templating languages (Haml, Sass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.'
15
15
 
16
16
  s.files = `git ls-files -z`.split("\0")
17
17
  s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\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.2.1
4
+ version: 4.3.0.rc.1
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: 2017-01-26 00:00:00.000000000 Z
12
+ date: 2018-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -32,8 +32,8 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
34
  description: A static site generator. Provides dozens of templating languages (Haml,
35
- Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache
36
- busting, Yaml data (and more) an easy part of your development cycle.
35
+ Sass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting,
36
+ Yaml data (and more) an easy part of your development cycle.
37
37
  email:
38
38
  - me@tdreyno.com
39
39
  - ben@benhollis.net
@@ -98,12 +98,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  version: 2.2.0
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ">"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.1
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.5.1
106
+ rubygems_version: 2.6.13
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Hand-crafted frontend development