nanoc 4.1.0rc2 → 4.1.0

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: 023f1a7d6ab12c07227e7173bc85ad3595b292f2
4
- data.tar.gz: c6c4d7bdf320ba8fa1c04085b4b2596dcded339d
3
+ metadata.gz: a25f62d7d0cba592a2fac26511e3a33c8b23568e
4
+ data.tar.gz: 58ebd91d32f0188962896e11e58f619cf71c30eb
5
5
  SHA512:
6
- metadata.gz: 196b924475b05dc01d2b96f5c21749ac9d8b8034c93a94fa15abd10298c6e5330c2a4eff31fc687869b30be2fcb7fa64874c818a48a4ad51089001a82446125c
7
- data.tar.gz: 000e3458409b477d50a5c3a7cd08c871f5f651639981cf73dd95aa622505cc0960747f882ac133a873a3278f2fd84b9c15824e4762c827af3c41824520f6ef70
6
+ metadata.gz: 20f2f9e77c44f4bb357c03e32dd2c63573f07d6284b6e3ba5cbea1af13c9b64524366ec3171dbc12d9394e743490e6d18ec98efafddc0a173f9ca064c36aabfc
7
+ data.tar.gz: 03083d54d98bf95205a30c378d00c2eb714eb526b460022c87d6ec5c20406dbcdef965361b4dac165f7c1014892fc2480f958c369d6b9a04425bc502b2d21afc
@@ -362,4 +362,4 @@ DEPENDENCIES
362
362
  yuicompressor
363
363
 
364
364
  BUNDLED WITH
365
- 1.10.6
365
+ 1.11.2
data/NEWS.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.1.0 (2015-12-18)
4
+
5
+ Fixes:
6
+
7
+ * Fixed crash when attempting to `#puts` an object that’s not a string (#778)
8
+ * Made pruner not prune away files from routes defined for custom snapshots (#779)
9
+ * Wrapped `@layout` in a layout view (#773)
10
+
11
+ Enhancements:
12
+
13
+ * Added a base path to the Checks file, so that it supports `#require_relative` (#774)
14
+
3
15
  ## 4.1.0rc2 (2015-12-13)
4
16
 
5
17
  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, 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, Garen Torikian, 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
22
+ Ale Muñoz, Alexander Mankuta, Arnau Siches, Ben Armston, Bil Bas, Brian Candler, Bruno Dufour, Chris Eppstein, Christian Plessl, Colin Barrett, Colin Seymour, 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, Garen Torikian, 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
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'fileutils'
5
+ require 'octokit'
6
+
7
+ def run(*args)
8
+ puts "I will execute the following:"
9
+ puts ' ' + args.map { |a| a =~ /\s/ ? a.inspect : a }.join(' ')
10
+ print "Is this correct? [y/N] "
11
+ res = gets
12
+ unless res.strip.downcase == 'y'
13
+ $stderr.puts "Answer was not Y; release aborted."
14
+ exit 1
15
+ end
16
+
17
+ system('echo', *args)
18
+ system(*args)
19
+ end
20
+
21
+
22
+
23
+ puts "=== Logging in to GitHub’s API…"
24
+ client = Octokit::Client.new(netrc: true)
25
+ puts
26
+
27
+ puts "=== Deleting old *.gem files…"
28
+ Dir['*.gem'].each do |fn|
29
+ puts " #{fn}…"
30
+ FileUtils.rm_f(fn)
31
+ end
32
+ puts
33
+
34
+ puts "=== Building new gem…"
35
+ run('gem', 'build', 'nanoc.gemspec')
36
+ puts
37
+
38
+ puts "=== Reading version…"
39
+ require_relative 'lib/nanoc/version'
40
+ puts "Version = #{Nanoc::VERSION}"
41
+ puts
42
+
43
+ puts "=== Verifying that release does not yet exist…"
44
+ releases = client.releases('nanoc/nanoc')
45
+ release = releases.find { |r| r.tag_name == Nanoc::VERSION }
46
+ if release
47
+ $stderr.puts "Release already exists!"
48
+ $stderr.puts "ABORTED!"
49
+ exit 1
50
+ end
51
+ puts
52
+
53
+ puts "=== Creating Git tag…"
54
+ run('git', 'tag', '--sign', '--annotate', Nanoc::VERSION, '--message', "Version #{Nanoc::VERSION}")
55
+ puts
56
+
57
+ puts "=== Pushing Git data…"
58
+ run('git', 'push', 'origin')
59
+ run('git', 'push', 'origin', '--tags')
60
+ puts
61
+
62
+ puts "=== Pushing gem…"
63
+ run('gem', 'push', "nanoc-#{Nanoc::VERSION}.gem")
64
+ puts
65
+
66
+ puts "=== Reading release notes…"
67
+ release_notes = File.readlines('NEWS.md')
68
+ .drop(4)
69
+ .take_while { |l| l !~ /^## / }
70
+ .join
71
+ puts
72
+
73
+ puts "=== Creating release on GitHub…"
74
+ sleep 3 # Give GitHub some time to detect the new tag
75
+ is_prerelease = !Nanoc::VERSION =~ /a|b|rc/ || Nanoc::VERSION =~ /^0/
76
+ client.create_release(
77
+ 'nanoc/nanoc', Nanoc::VERSION,
78
+ prerelease: !!is_prerelease,
79
+ body: release_notes,
80
+ )
81
+ puts
82
+
83
+ puts "DONE!"
@@ -72,7 +72,8 @@ module Nanoc
72
72
  # Create filter
73
73
  klass = Nanoc::Filter.named(filter_name)
74
74
  raise Nanoc::Int::Errors::UnknownFilter.new(filter_name) if klass.nil?
75
- filter = klass.new(assigns_for(rep).merge({ layout: layout }))
75
+ layout_view = Nanoc::LayoutView.new(layout, nil)
76
+ filter = klass.new(assigns_for(rep).merge({ layout: layout_view }))
76
77
 
77
78
  # Visit
78
79
  Nanoc::Int::NotificationCenter.post(:visit_started, layout)
@@ -140,7 +140,7 @@ module Nanoc::CLI
140
140
  protected
141
141
 
142
142
  def _nanoc_clean(s)
143
- @stream_cleaners.reduce(s) { |a, e| e.clean(a) }
143
+ @stream_cleaners.reduce(s.to_s) { |a, e| e.clean(a) }
144
144
  end
145
145
 
146
146
  def _nanoc_swallow_broken_pipe_errors_while
@@ -5,7 +5,7 @@ module Nanoc::CLI::StreamCleaners
5
5
  class ANSIColors < Abstract
6
6
  # @see Nanoc::CLI::StreamCleaners::Abstract#clean
7
7
  def clean(s)
8
- s.is_a?(String) ? s.gsub(/\e\[.+?m/, '') : s
8
+ s.gsub(/\e\[.+?m/, '')
9
9
  end
10
10
  end
11
11
  end
@@ -5,7 +5,7 @@ module Nanoc::Extra::Checking
5
5
 
6
6
  def self.from_file(filename)
7
7
  dsl = new
8
- dsl.instance_eval File.read(filename)
8
+ dsl.instance_eval(File.read(filename), filename)
9
9
  dsl
10
10
  end
11
11
 
@@ -28,7 +28,7 @@ module Nanoc::Extra
28
28
 
29
29
  # Get compiled files
30
30
  # FIXME: requires #build_reps to have been called
31
- all_raw_paths = site.compiler.reps.map(&:raw_path)
31
+ all_raw_paths = site.compiler.reps.flat_map { |r| r.raw_paths.values }
32
32
  compiled_files = all_raw_paths.flatten.compact.select { |f| File.file?(f) }
33
33
 
34
34
  # Get present files and dirs
@@ -1,4 +1,4 @@
1
1
  module Nanoc
2
2
  # The current Nanoc version.
3
- VERSION = '4.1.0rc2'
3
+ VERSION = '4.1.0'
4
4
  end
@@ -53,4 +53,16 @@ class Nanoc::CLI::CleaningStreamTest < Nanoc::TestCase
53
53
  cleaning_stream = Nanoc::CLI::CleaningStream.new(stream)
54
54
  cleaning_stream.write('lol')
55
55
  end
56
+
57
+ def test_non_string
58
+ obj = Object.new
59
+ def obj.to_s
60
+ 'Hello… world!'
61
+ end
62
+
63
+ stream = StringIO.new
64
+ cleaning_stream = Nanoc::CLI::CleaningStream.new(stream)
65
+ cleaning_stream << obj
66
+ assert_equal 'Hello… world!', stream.string
67
+ end
56
68
  end
@@ -11,4 +11,13 @@ class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
11
11
  assert_equal [:bar], dsl.deploy_checks
12
12
  end
13
13
  end
14
+
15
+ def test_has_base_path
16
+ with_site do |_site|
17
+ File.write('stuff.rb', '$greeting = "hello"')
18
+ File.write('Checks', 'require "./stuff"')
19
+ Nanoc::Extra::Checking::DSL.from_file('Checks')
20
+ assert_equal 'hello', $greeting
21
+ end
22
+ end
14
23
  end
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.1.0rc2
4
+ version: 4.1.0
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-12-13 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -68,6 +68,7 @@ files:
68
68
  - README.md
69
69
  - Rakefile
70
70
  - bin/nanoc
71
+ - do-release
71
72
  - doc/yardoc_handlers/identifier.rb
72
73
  - doc/yardoc_templates/default/layout/html/footer.erb
73
74
  - lib/nanoc.rb
@@ -374,9 +375,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
374
375
  version: 2.1.0
375
376
  required_rubygems_version: !ruby/object:Gem::Requirement
376
377
  requirements:
377
- - - ">"
378
+ - - ">="
378
379
  - !ruby/object:Gem::Version
379
- version: 1.3.1
380
+ version: '0'
380
381
  requirements: []
381
382
  rubyforge_project:
382
383
  rubygems_version: 2.4.5.1