middleman-targets 1.0.10 → 1.0.11

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: deee1c85364e43f1459115ebde84b781d2549fc8
4
- data.tar.gz: b7bbac002f75e24910d241191b4879ec98ff169a
3
+ metadata.gz: ca4461d428b23805b22490d34f982653f8672c5e
4
+ data.tar.gz: c641ebab71e92cb56268759ce0fb3962032c1e56
5
5
  SHA512:
6
- metadata.gz: 021a9f30ba4995390ad0a72e2b7074b011f40fb262279a524bd87be05a4db7aa673aabad094ec857f55917bb6c721159292cb781febd87e1c991b96a77339592
7
- data.tar.gz: 7d9b66a946ed244634f8a7e6e0116afff6ef4c83c512ce74ba43009bb3fd3107c518aa535971885f38c8f102e7222c1d318dc3e01d4ccba4a3c60ca0a9f2c4d8
6
+ metadata.gz: 249127f0ac430965e499cd1cb33897e5b49f54167cd42466becd181a502b9b2c3ab26545e88d7be4ee63ef385163c8a6dc7955bda9844ae0ef6d99a004410b3e
7
+ data.tar.gz: 828add7e1cd36c5ea3e8b63cac842d5869078021f63183cb7d7732aa4eadca1307f1d17d8c3246c3c7fb19c9b18b07796924d1b251fc02af1d0b04d2d761be69
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
1
  middleman-targets change log
2
2
  ============================
3
3
 
4
- - Version 1.0.10 / 2018-June-07
4
+ - Version 1.0.11 / 2018-June-08
5
5
 
6
+ - Changed list_all for compatibility with other gems.
6
7
  - Bump to version 1.0.10, because list_all command line option was added.
7
8
 
8
9
  - Version 1.0.9 / 2018-May-26
@@ -16,7 +17,7 @@ middleman-targets change log
16
17
 
17
18
  - Added middleman_target exposed to config.rb
18
19
 
19
- - Version 1.0.7 / 2016-May-14
20
+ - Version 1.0.7 / 2016-May-15
20
21
 
21
22
  - Bump to 1.0.7 fixes:
22
23
  - Require capybara as development dependency fixes broken testing.
@@ -9,6 +9,6 @@ gem 'wdm', '~> 0.1.0', platforms: [:mswin, :mingw]
9
9
  gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]
10
10
 
11
11
  # Middleman Gems
12
- gem 'middleman-targets', '~>1.0.10'
12
+ gem 'middleman-targets', '~>1.0.11.wip'
13
13
  gem 'middleman', ['~> 4.1', '>= 4.1.7']
14
14
  gem 'middleman-syntax'
@@ -103,7 +103,7 @@ helpers do
103
103
  end
104
104
 
105
105
  def product_version
106
- '1.0.10'
106
+ '1.0.11'
107
107
  end
108
108
 
109
109
  end
@@ -120,28 +120,30 @@ class MiddlemanTargets < ::Middleman::Extension
120
120
  #############################################################
121
121
  def after_configuration
122
122
 
123
- return if app.config[:exit_before_ready]
124
-
125
123
  app.config[:target] = app.config[:target].downcase.to_sym
126
124
  requested_target = app.config[:target]
127
125
  valid_targets = app.config[:targets].each_key.collect { |item| item.downcase}
128
126
 
127
+ if (build_dir = app.config[:targets][app.config[:target]][:build_dir])
128
+ app.config[:build_dir] = sprintf(build_dir, requested_target)
129
+ else
130
+ app.config[:build_dir] = "#{app.config[:build_dir]} (#{requested_target})"
131
+ end
132
+
129
133
  if valid_targets.count < 1
130
134
  say 'middleman-targets is activated but there are no targets specified in your', :red
131
135
  say 'configuration file.', :red
132
136
  exit 1
133
137
  end
134
138
 
139
+ return if app.config[:exit_before_ready]
140
+
141
+
135
142
  if valid_targets.include?(requested_target)
136
143
 
137
144
  if app.config[:mode] == :server
138
145
  say "Middleman will serve using target \"#{requested_target}\".", :blue
139
146
  else
140
- if (build_dir = app.config[:targets][app.config[:target]][:build_dir])
141
- app.config[:build_dir] = sprintf(build_dir, requested_target)
142
- else
143
- app.config[:build_dir] = "#{app.config[:build_dir]} (#{requested_target})"
144
- end
145
147
  say "Middleman will build using target \"#{requested_target}\".", :blue
146
148
  say "Build directory is \"#{app.config[:build_dir]}\".", :blue
147
149
  end
@@ -18,28 +18,43 @@ module Middleman::Cli
18
18
  # @return [Void]
19
19
  ############################################################
20
20
  def list_all
21
- # The first thing we want to do is create a temporary application
22
- # instance so that we can determine the valid targets.
21
+
22
+ # Determine the valid targets.
23
23
  app = ::Middleman::Application.new do
24
24
  config[:exit_before_ready] = true
25
25
  end
26
- config = app.config.clone
26
+ app_config = app.config.clone
27
27
  app.shutdown!
28
28
 
29
- config[:targets].each do |target|
30
- out_path = ''
29
+ # Spin up an instance for each target to get its
30
+ # output path.
31
+ app_config[:targets].each do |target|
31
32
  requested_target = target[0]
32
- if (build_dir = config[:targets][requested_target][:build_dir])
33
- out_path = sprintf(build_dir, requested_target.to_s)
34
- else
35
- out_path = "#{config[:build_dir]} (#{requested_target.to_s})"
33
+ app = ::Middleman::Application.new do
34
+ config[:target] = requested_target
35
+ config[:exit_before_ready] = true
36
36
  end
37
-
38
- out_path = File.expand_path(out_path)
39
-
37
+ config = app.config.clone
38
+ app.shutdown!
39
+ out_path = File.expand_path(config[:build_dir])
40
40
  say "#{requested_target.to_s}, #{out_path}", :cyan
41
-
42
41
  end
42
+
43
+
44
+ # config[:targets].each do |target|
45
+ # out_path = ''
46
+ # requested_target = target[0]
47
+ # if (build_dir = config[:targets][requested_target][:build_dir])
48
+ # out_path = sprintf(build_dir, requested_target.to_s)
49
+ # else
50
+ # out_path = "#{config[:build_dir]} (#{requested_target.to_s})"
51
+ # end
52
+ #
53
+ # out_path = File.expand_path(out_path)
54
+ #
55
+ # say "#{requested_target.to_s}, #{out_path}", :cyan
56
+ #
57
+ # end
43
58
  end
44
59
 
45
60
  Base.register(self, 'list_all', 'list_all', 'Lists all targets')
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module MiddlemanTargets
3
- VERSION = '1.0.10'
3
+ VERSION = '1.0.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-targets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Derry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core