nanoc 4.0.0rc2 → 4.0.0rc3

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: ce4a238700e7502d74064d9e013beb617db329ec
4
- data.tar.gz: 89e4fd37145ee9fad99eb7f3675cc2bba2205d81
3
+ metadata.gz: a702d1af4491144cc70a378338ebb2db5a62003d
4
+ data.tar.gz: 90dbc13b34f0c10d11ff49625057340012a1b0b2
5
5
  SHA512:
6
- metadata.gz: 8d62477b536a1ebee8555c3e025eeed536a355bd11c2caa1b1fd7865696f899f0857c10eb2c12224f884541e3a16bb67e75e4d87f96f272ec68f18b2f1a6ae0b
7
- data.tar.gz: 2d5e7a0dd2238702dd44df29e66fc5c81abed4a48f752066a55f03e300fecc702a877c4a4cbeb47e1bf59b0150a278842ce0cc617826237f8098f8749d311eaa
6
+ metadata.gz: 8affe17459068c8137cc7b279ca6802011dc92956de4ce242015ae8fe09aca41655c117ab229f539c34de63583f26abb57e1a5a11f7a2e73b9574f8f654a40df
7
+ data.tar.gz: 791dd43b1f816385256dbf3335abaf178368385bf846f4967f9c48123a28cfef51ad2d011a88e989a3338981efabff87f3f2f4a17e9268b4cb167e1269a98789
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc (4.0.0rc2)
4
+ nanoc (4.0.0rc3)
5
5
  cri (~> 2.3)
6
6
 
7
7
  GEM
@@ -12,9 +12,9 @@ GEM
12
12
  addressable (2.3.8)
13
13
  adsf (1.2.0)
14
14
  rack (>= 1.0.0)
15
- ast (2.0.0)
16
- astrolabe (1.3.0)
17
- parser (>= 2.2.0.pre.3, < 3.0)
15
+ ast (2.1.0)
16
+ astrolabe (1.3.1)
17
+ parser (~> 2.2)
18
18
  bluecloth (2.2.0)
19
19
  builder (3.2.2)
20
20
  chunky_png (1.3.4)
@@ -44,17 +44,18 @@ GEM
44
44
  domain_name (0.5.24)
45
45
  unf (>= 0.0.5, < 1.0.0)
46
46
  erubis (2.7.0)
47
- excon (0.45.3)
48
- execjs (2.5.2)
47
+ excon (0.45.4)
48
+ execjs (2.6.0)
49
49
  ffi (1.9.10)
50
50
  fission (0.5.0)
51
51
  CFPropertyList (~> 2.2)
52
- fog (1.32.0)
52
+ fog (1.34.0)
53
53
  fog-atmos
54
54
  fog-aws (>= 0.6.0)
55
55
  fog-brightbox (~> 0.4)
56
56
  fog-core (~> 1.32)
57
- fog-ecloud (= 0.1.1)
57
+ fog-dynect (~> 0.0.2)
58
+ fog-ecloud (~> 0.1)
58
59
  fog-google (>= 0.0.2)
59
60
  fog-json
60
61
  fog-local
@@ -75,26 +76,30 @@ GEM
75
76
  fog-atmos (0.1.0)
76
77
  fog-core
77
78
  fog-xml
78
- fog-aws (0.6.0)
79
+ fog-aws (0.7.6)
79
80
  fog-core (~> 1.27)
80
81
  fog-json (~> 1.0)
81
82
  fog-xml (~> 0.1)
82
83
  ipaddress (~> 0.8)
83
- fog-brightbox (0.7.2)
84
+ fog-brightbox (0.9.0)
84
85
  fog-core (~> 1.22)
85
86
  fog-json
86
87
  inflecto (~> 0.0.2)
87
- fog-core (1.32.0)
88
+ fog-core (1.32.1)
88
89
  builder
89
90
  excon (~> 0.45)
90
91
  formatador (~> 0.2)
91
92
  mime-types
92
93
  net-scp (~> 1.1)
93
94
  net-ssh (>= 2.1.3)
94
- fog-ecloud (0.1.1)
95
+ fog-dynect (0.0.2)
96
+ fog-core
97
+ fog-json
98
+ fog-xml
99
+ fog-ecloud (0.3.0)
95
100
  fog-core
96
101
  fog-xml
97
- fog-google (0.0.6)
102
+ fog-google (0.0.7)
98
103
  fog-core
99
104
  fog-json
100
105
  fog-xml
@@ -107,7 +112,7 @@ GEM
107
112
  fog-core (~> 1.27)
108
113
  fog-json (~> 1.0)
109
114
  fog-xml (~> 0.1)
110
- fog-profitbricks (0.0.3)
115
+ fog-profitbricks (0.0.5)
111
116
  fog-core
112
117
  fog-xml
113
118
  nokogiri
@@ -119,7 +124,7 @@ GEM
119
124
  fog-core
120
125
  fog-json
121
126
  fog-xml
122
- fog-sakuracloud (1.0.1)
127
+ fog-sakuracloud (1.1.1)
123
128
  fog-core
124
129
  fog-json
125
130
  fog-serverlove (0.1.2)
@@ -145,7 +150,7 @@ GEM
145
150
  nokogiri (~> 1.5, >= 1.5.11)
146
151
  formatador (0.2.5)
147
152
  fssm (0.2.10)
148
- haml (4.0.6)
153
+ haml (4.0.7)
149
154
  tilt
150
155
  handlebars (0.7.0)
151
156
  handlebars-source (~> 3.0.0)
@@ -156,11 +161,11 @@ GEM
156
161
  inflecto (0.0.2)
157
162
  ipaddress (0.8.0)
158
163
  json (1.8.3)
159
- kramdown (1.7.0)
164
+ kramdown (1.8.0)
160
165
  less (2.6.0)
161
166
  commonjs (~> 0.2.7)
162
167
  libv8 (3.16.14.11)
163
- listen (3.0.1)
168
+ listen (3.0.3)
164
169
  rb-fsevent (>= 0.9.3)
165
170
  rb-inotify (>= 0.9)
166
171
  markaby (0.8.0)
@@ -168,12 +173,12 @@ GEM
168
173
  maruku (0.7.2)
169
174
  metaclass (0.0.4)
170
175
  method_source (0.8.2)
171
- mime-types (2.6.1)
176
+ mime-types (2.6.2)
172
177
  mini_portile (0.6.2)
173
- minitest (5.7.0)
178
+ minitest (5.8.0)
174
179
  mocha (1.1.0)
175
180
  metaclass (~> 0.0.1)
176
- multi_json (1.11.1)
181
+ multi_json (1.11.2)
177
182
  mustache (1.0.2)
178
183
  net-scp (1.2.1)
179
184
  net-ssh (>= 2.6.5)
@@ -197,28 +202,28 @@ GEM
197
202
  rainbow (2.0.0)
198
203
  rainpress (1.0)
199
204
  rake (10.4.2)
200
- rb-fsevent (0.9.5)
205
+ rb-fsevent (0.9.6)
201
206
  rb-inotify (0.9.5)
202
207
  ffi (>= 0.5.0)
203
208
  rdiscount (2.1.8)
204
209
  rdoc (4.2.0)
205
210
  redcarpet (3.3.2)
206
- ref (1.0.5)
211
+ ref (2.0.0)
207
212
  rest-client (1.8.0)
208
213
  http-cookie (>= 1.0.2, < 2.0)
209
214
  mime-types (>= 1.16, < 3.0)
210
215
  netrc (~> 0.7)
211
- rouge (1.9.0)
216
+ rouge (1.10.1)
212
217
  rspec (3.3.0)
213
218
  rspec-core (~> 3.3.0)
214
219
  rspec-expectations (~> 3.3.0)
215
220
  rspec-mocks (~> 3.3.0)
216
- rspec-core (3.3.1)
221
+ rspec-core (3.3.2)
217
222
  rspec-support (~> 3.3.0)
218
- rspec-expectations (3.3.0)
223
+ rspec-expectations (3.3.1)
219
224
  diff-lcs (>= 1.2.0, < 2.0)
220
225
  rspec-support (~> 3.3.0)
221
- rspec-mocks (3.3.1)
226
+ rspec-mocks (3.3.2)
222
227
  diff-lcs (>= 1.2.0, < 2.0)
223
228
  rspec-support (~> 3.3.0)
224
229
  rspec-support (3.3.0)
@@ -249,10 +254,10 @@ GEM
249
254
  ref
250
255
  thor (0.19.1)
251
256
  tilt (2.0.1)
252
- tins (1.5.4)
257
+ tins (1.6.0)
253
258
  typogruby (1.0.18)
254
259
  rubypants
255
- uglifier (2.7.1)
260
+ uglifier (2.7.2)
256
261
  execjs (>= 0.3.0)
257
262
  json (>= 1.8.0)
258
263
  unf (0.1.4)
@@ -322,4 +327,4 @@ DEPENDENCIES
322
327
  yuicompressor
323
328
 
324
329
  BUNDLED WITH
325
- 1.10.5
330
+ 1.10.6
data/NEWS.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.0.0rc3 (2015-09-20)
4
+
5
+ Features:
6
+
7
+ * Added `Identifier#without_exts` and `Identifier#exts` (#644, #696) [Rémi Barraquand]
8
+ * Added `DocumentView#attributes` (#699, #702)
9
+
10
+ Fixes:
11
+
12
+ * Fixed issue when comparing document views (#680, #693)
13
+
14
+ Enhancements:
15
+
16
+ * Made `#base_url` argument in `#tags_for` optional (#687) [Croath Liu]
17
+ * Allowed `IdentifiableCollection#[]` to be passed an identifier (#681, #695)
18
+ * Improved `Pattern.from` error message (#683, #692)
19
+ * Let default site use a direct link to the stylesheet (#685, #701)
20
+
21
+ Changes:
22
+
23
+ * Removed `Identifier#with_ext` because its behavior was confusing (#697, #700)
24
+ * Disallowed storing document (views) in attributes (#682, #694)
25
+
3
26
  ## 4.0.0rc2 (2015-07-11)
4
27
 
5
28
  Fixes:
data/README.md CHANGED
@@ -19,4 +19,4 @@ Contributions are greatly appreciated! Consult the [Development guidelines](http
19
19
 
20
20
  Many thanks to everyone who has contributed to Nanoc in one way or another:
21
21
 
22
- Ale Muñoz, Alexander Mankuta, Arnau Siches, Ben Armston, Bil Bas, Brian Candler, Bruno Dufour, Chris Eppstein, Christian Plessl, Colin Barrett, Damien Pollet, Dan Callahan, Daniel Hofstetter, Daniel Mendler, Daniel Wollschlaeger, David Alexander, David Everitt, Dennis Sutch, Devon Luke Buchanan, Dmitry Bilunov, Eric Sunshine, Erik Hollensbe, Fabian Buch, Felix Hanley, Go Maeda, Gregory Pakosz, Grégory Karékinian, Guilherme Garnier, Jack Chu, Jake Benilov, Jasper Van der Jeugt, Jeff Forcier, Jim Mendenhall, John Nishinaga, Justin Clift, Justin Hileman, Kevin Lynagh, Louis T., Mathias Bynens, Matt Keveney, Matthew Frazier, Matthias Beyer, Matthias Reitinger, Matthias Vallentin, Michal Cichra, Nelson Chen, Nicky Peeters, Nikhil Marathe, Oliver Byford, Peter Aronoff, Raphael von der Grün, Remko Tronçon, Riley Goodside, Ruben Verborgh, Scott Vokes, Simon South, Spencer Whitt, Stanley Rost, Starr Horne, Stefan Bühler, Stuart Montgomery, Takashi Uchibe, Toon Willems, Tuomas Kareinen, Ursula Kallio, Vincent Driessen, Xavier Shay, Zaiste de Grengolada, Šime Ramov
22
+ Ale Muñoz, Alexander Mankuta, Arnau Siches, Ben Armston, Bil Bas, Brian Candler, Bruno Dufour, Chris Eppstein, Christian Plessl, Colin Barrett, Croath Liu, Damien Pollet, Dan Callahan, Daniel Hofstetter, Daniel Mendler, Daniel Wollschlaeger, David Alexander, David Everitt, Dennis Sutch, Devon Luke Buchanan, Dmitry Bilunov, Eric Sunshine, Erik Hollensbe, Fabian Buch, Felix Hanley, Go Maeda, Gregory Pakosz, Grégory Karékinian, Guilherme Garnier, Jack Chu, Jake Benilov, Jasper Van der Jeugt, Jeff Forcier, Jim Mendenhall, John Nishinaga, Justin Clift, Justin Hileman, Kevin Lynagh, Louis T., Mathias Bynens, Matt Keveney, Matthew Frazier, Matthias Beyer, Matthias Reitinger, Matthias Vallentin, Michal Cichra, Nelson Chen, Nicky Peeters, Nikhil Marathe, Oliver Byford, Peter Aronoff, Raphael von der Grün, Rémi Barraquand, Remko Tronçon, Riley Goodside, Ruben Verborgh, Scott Vokes, Šime Ramov, Simon South, Spencer Whitt, Stanley Rost, Starr Horne, Stefan Bühler, Stuart Montgomery, Takashi Uchibe, Toon Willems, Tuomas Kareinen, Ursula Kallio, Vincent Driessen, Xavier Shay, Yannick Ihmels, Zaiste de Grengolada
@@ -106,37 +106,20 @@ module Nanoc
106
106
  end
107
107
 
108
108
  # @return [String]
109
- def with_ext(ext)
109
+ def without_ext
110
110
  unless full?
111
111
  raise UnsupportedLegacyOperationError
112
112
  end
113
113
 
114
- # Strip extension, if any
115
114
  extname = File.extname(@string)
116
- string =
117
- if extname.size > 0
118
- @string[0..-extname.size - 1]
119
- else
120
- @string
121
- end
122
115
 
123
- # Add extension
124
- if ext.size > 0
125
- if ext.start_with?('.')
126
- string + ext
127
- else
128
- string + '.' + ext
129
- end
116
+ if extname.size > 0
117
+ @string[0..-extname.size - 1]
130
118
  else
131
- string
119
+ @string
132
120
  end
133
121
  end
134
122
 
135
- # @return [String]
136
- def without_ext
137
- with_ext('')
138
- end
139
-
140
123
  # @return [String] The extension, without a leading dot.
141
124
  def ext
142
125
  unless full?
@@ -147,6 +130,26 @@ module Nanoc
147
130
  s && s[1..-1]
148
131
  end
149
132
 
133
+ # @return [String]
134
+ def without_exts
135
+ extname = exts.join('.')
136
+ if extname.size > 0
137
+ @string[0..-extname.size - 2]
138
+ else
139
+ @string
140
+ end
141
+ end
142
+
143
+ # @return [Array] List of extensions, without a leading dot.
144
+ def exts
145
+ unless full?
146
+ raise UnsupportedLegacyOperationError
147
+ end
148
+
149
+ s = File.basename(@string)
150
+ s ? s.split('.', -1).drop(1) : []
151
+ end
152
+
150
153
  def to_s
151
154
  @string
152
155
  end
@@ -10,7 +10,7 @@ module Nanoc::Int
10
10
  when Regexp
11
11
  Nanoc::Int::RegexpPattern.new(obj)
12
12
  else
13
- raise ArgumentError, "Do not know how to convert #{obj} into a Nanoc::Pattern"
13
+ raise ArgumentError, "Do not know how to convert `#{obj.inspect}` into a Nanoc::Pattern"
14
14
  end
15
15
  end
16
16
 
@@ -24,6 +24,8 @@ module Nanoc::Int
24
24
 
25
25
  def [](arg)
26
26
  case arg
27
+ when Nanoc::Identifier
28
+ object_with_identifier(arg)
27
29
  when String
28
30
  object_with_identifier(arg) || object_matching_glob(arg)
29
31
  when Regexp
@@ -15,7 +15,7 @@ module Nanoc
15
15
 
16
16
  # @see Object#==
17
17
  def ==(other)
18
- identifier == other.identifier
18
+ other.respond_to?(:identifier) && identifier == other.identifier
19
19
  end
20
20
  alias_method :eql?, :==
21
21
 
@@ -37,6 +37,14 @@ module Nanoc
37
37
  unwrap.attributes[key]
38
38
  end
39
39
 
40
+ # @return [Hash]
41
+ def attributes
42
+ Nanoc::Int::NotificationCenter.post(:visit_started, unwrap)
43
+ Nanoc::Int::NotificationCenter.post(:visit_ended, unwrap)
44
+
45
+ unwrap.attributes
46
+ end
47
+
40
48
  # @see Hash#fetch
41
49
  def fetch(key, fallback = NONE, &_block)
42
50
  Nanoc::Int::NotificationCenter.post(:visit_started, unwrap)
@@ -1,11 +1,34 @@
1
1
  module Nanoc
2
2
  module MutableDocumentViewMixin
3
+ # @api private
4
+ class DisallowedAttributeValueError < Nanoc::Error
5
+ attr_reader :value
6
+
7
+ def initialize(value)
8
+ @value = value
9
+ end
10
+
11
+ def message
12
+ "The #{value.class} cannot be stored inside an attribute. Store its identifier instead."
13
+ end
14
+ end
15
+
3
16
  # Sets the value for the given attribute.
4
17
  #
5
18
  # @param [Symbol] key
6
19
  #
7
20
  # @see Hash#[]=
8
21
  def []=(key, value)
22
+ disallowed_value_classes = Set.new([
23
+ Nanoc::Int::Item,
24
+ Nanoc::Int::Layout,
25
+ Nanoc::ItemView,
26
+ Nanoc::LayoutView,
27
+ ])
28
+ if disallowed_value_classes.include?(value.class)
29
+ raise DisallowedAttributeValueError.new(value)
30
+ end
31
+
9
32
  unwrap.attributes[key] = value
10
33
  end
11
34
 
@@ -254,7 +254,7 @@ EOS
254
254
  <head>
255
255
  <meta charset="utf-8">
256
256
  <title>A Brand New Nanoc Site - <%= @item[:title] %></title>
257
- <link rel="stylesheet" href="<%= @items['/stylesheet.*'].path %>">
257
+ <link rel="stylesheet" href="/stylesheet.css">
258
258
 
259
259
  <!-- you don't need to keep this, but it's cool for stats! -->
260
260
  <meta name="generator" content="Nanoc <%= Nanoc::VERSION %>">
@@ -16,7 +16,9 @@ module Nanoc::Helpers
16
16
  # HTML-escaping rules for {#link_for_tag} apply here as well.
17
17
  #
18
18
  # @option params [String] base_url The URL to which the tag will be appended
19
- # to construct the link URL. This URL must have a trailing slash.
19
+ # to construct the link URL. This URL must have a trailing slash. The
20
+ # function would return a tags string without tag page link if the param
21
+ # is not provided.
20
22
  #
21
23
  # @option params [String] none_text ("(none)") The text to display when
22
24
  # the item has no tags
@@ -26,14 +28,14 @@ module Nanoc::Helpers
26
28
  #
27
29
  # @return [String] A hyperlinked list of tags for the given item
28
30
  def tags_for(item, params = {})
29
- base_url = params.fetch(:base_url)
31
+ base_url = params[:base_url]
30
32
  none_text = params[:none_text] || '(none)'
31
33
  separator = params[:separator] || ', '
32
34
 
33
35
  if item[:tags].nil? || item[:tags].empty?
34
36
  none_text
35
37
  else
36
- item[:tags].map { |tag| link_for_tag(tag, base_url) }.join(separator)
38
+ item[:tags].map { |tag| base_url ? link_for_tag(tag, base_url) : tag }.join(separator)
37
39
  end
38
40
  end
39
41
 
@@ -1,4 +1,4 @@
1
1
  module Nanoc
2
2
  # The current Nanoc version.
3
- VERSION = '4.0.0rc2'
3
+ VERSION = '4.0.0rc3'
4
4
  end
@@ -47,6 +47,14 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
47
47
  )
48
48
  end
49
49
 
50
+ def test_tags_for_without_base_url
51
+ # Create item
52
+ item = Nanoc::ItemView.new(Nanoc::Int::Item.new('content', { tags: %w(foo bar) }, '/path/'))
53
+
54
+ # Check
55
+ assert_equal('foo, bar', tags_for(item))
56
+ end
57
+
50
58
  def test_items_with_tag
51
59
  # Create items
52
60
  @items = Nanoc::ItemCollectionView.new([
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0rc2
4
+ version: 4.0.0rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-11 00:00:00.000000000 Z
11
+ date: 2015-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri