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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b4d71b08b02fed014baba761ddb5021c93e3149
4
- data.tar.gz: c5c2046bf5f453504550008aba3db227353c83c0
3
+ metadata.gz: bca1303294fc85e582d20992e6f46a43cb19cc58
4
+ data.tar.gz: 518298d2db1340666962b53100e4298ce398e0c9
5
5
  SHA512:
6
- metadata.gz: ea071324738707a762be53f986e8ecbc5d9f47bef1e9e4268010bde865dc71f4a42af782a5fc5714030399eb0be8c196d2b851df7bf4959578f2a1fab0dc31ab
7
- data.tar.gz: 120cac0b58998fde7737ba7c5c07d6b387dd70ebcffc102cca5f3a184ca21977fc59518bdd8cb18df06aff30cf0d7455abbd4e4fd6bd0b4bf517ea9291925727
6
+ metadata.gz: c238b5da02ea26d305a3ff23dd1072f14425d96ba48e4f71737beacdb2966c2ef7d10bf881d37632be5795607fdfe7958944fea7ce3faa41a3dab3e95ce93caf
7
+ data.tar.gz: e5c0b44dc4c53f4c3a5e0a5dff6c13b53ac10b20d3dd1469e73d8711ce6f9567f1a23067e04012084761b77ff5b03e996bcacd2b2cfc546064e958ca038e2649
@@ -59,7 +59,7 @@ module Middleman::Cli
59
59
  glob: options['glob'],
60
60
  clean: options['clean'],
61
61
  parallel: options['parallel'])
62
-
62
+ builder.thor = self
63
63
  builder.on_build_event(&method(:on_event))
64
64
 
65
65
  if builder.run!
@@ -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
- # TODO: get file watcher / reload! working in console
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, @app
42
+ IRB.irb nil, context
38
43
  end
39
44
 
40
45
  # Add to CLI
@@ -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 != 2
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
@@ -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.25,
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.alpha.6
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-01-04 00:00:00.000000000 Z
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.3
89
+ rubygems_version: 2.4.6
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Hand-crafted frontend development