middleman-cli 4.0.0.alpha.6 → 4.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/middleman-cli/build.rb +1 -1
- data/lib/middleman-cli/console.rb +7 -2
- data/lib/middleman-cli/init.rb +9 -4
- data/lib/middleman-cli/server.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca1303294fc85e582d20992e6f46a43cb19cc58
|
4
|
+
data.tar.gz: 518298d2db1340666962b53100e4298ce398e0c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c238b5da02ea26d305a3ff23dd1072f14425d96ba48e4f71737beacdb2966c2ef7d10bf881d37632be5795607fdfe7958944fea7ce3faa41a3dab3e95ce93caf
|
7
|
+
data.tar.gz: e5c0b44dc4c53f4c3a5e0a5dff6c13b53ac10b20d3dd1469e73d8711ce6f9567f1a23067e04012084761b77ff5b03e996bcacd2b2cfc546064e958ca038e2649
|
data/lib/middleman-cli/build.rb
CHANGED
@@ -29,12 +29,17 @@ module Middleman::Cli
|
|
29
29
|
::Middleman::Logger.singleton(opts[:debug] ? 0 : 1, opts[:instrumenting] || false)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
self.class.interact_with @app
|
33
|
+
end
|
33
34
|
|
35
|
+
# Start an interactive console in the context of the provided object.
|
36
|
+
# @param [Object] context
|
37
|
+
# @return [void]
|
38
|
+
def self.interact_with(context)
|
34
39
|
IRB.setup nil
|
35
40
|
IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context
|
36
41
|
require 'irb/ext/multi-irb'
|
37
|
-
IRB.irb nil,
|
42
|
+
IRB.irb nil, context
|
38
43
|
end
|
39
44
|
|
40
45
|
# Add to CLI
|
data/lib/middleman-cli/init.rb
CHANGED
@@ -47,12 +47,17 @@ module Middleman::Cli
|
|
47
47
|
end
|
48
48
|
|
49
49
|
dir = Dir.mktmpdir
|
50
|
-
|
50
|
+
|
51
51
|
begin
|
52
52
|
branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
|
53
53
|
|
54
54
|
run("git clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
|
55
55
|
|
56
|
+
unless File.directory?(dir)
|
57
|
+
say 'Git clone failed, maybe the url is invalid or you don\'t have the permissions?', :red
|
58
|
+
exit
|
59
|
+
end
|
60
|
+
|
56
61
|
inside(target) do
|
57
62
|
thorfile = File.join(dir, 'Thorfile')
|
58
63
|
|
@@ -68,18 +73,18 @@ module Middleman::Cli
|
|
68
73
|
run('bundle install') unless ENV['TEST'] || options[:'skip-bundle']
|
69
74
|
end
|
70
75
|
ensure
|
71
|
-
FileUtils.remove_entry(dir)
|
76
|
+
FileUtils.remove_entry(dir) if File.directory?(dir)
|
72
77
|
end
|
73
78
|
end
|
74
79
|
|
75
80
|
protected
|
76
81
|
|
77
82
|
def shortname?(repo)
|
78
|
-
repo.split('/').length
|
83
|
+
repo.split('/').length == 1
|
79
84
|
end
|
80
85
|
|
81
86
|
def repository_path(repo)
|
82
|
-
"git://github.com/#{repo}.git"
|
87
|
+
repo.include?('://') || repo.include?('git@') ? repo : "git://github.com/#{repo}.git"
|
83
88
|
end
|
84
89
|
|
85
90
|
# Add to CLI
|
data/lib/middleman-cli/server.rb
CHANGED
@@ -11,11 +11,9 @@ module Middleman::Cli
|
|
11
11
|
class_option :host,
|
12
12
|
type: :string,
|
13
13
|
aliases: '-h',
|
14
|
-
default: '0.0.0.0',
|
15
14
|
desc: 'Bind to HOST address'
|
16
15
|
class_option :port,
|
17
16
|
aliases: '-p',
|
18
|
-
default: '4567',
|
19
17
|
desc: 'The port Middleman will listen on'
|
20
18
|
class_option :verbose,
|
21
19
|
type: :boolean,
|
@@ -40,7 +38,7 @@ module Middleman::Cli
|
|
40
38
|
class_option :latency,
|
41
39
|
type: :numeric,
|
42
40
|
aliases: '-l',
|
43
|
-
default: 0.
|
41
|
+
default: 0.5,
|
44
42
|
desc: 'Set file watcher latency, in seconds'
|
45
43
|
|
46
44
|
# Start the server
|
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.0.0.
|
4
|
+
version: 4.0.0.beta.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: 2015-
|
12
|
+
date: 2015-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: 1.3.1
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.4.
|
89
|
+
rubygems_version: 2.4.6
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Hand-crafted frontend development
|