hoe 3.13.0 → 3.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92fc33d9fc7af343493aa701504ac489d907159c
4
- data.tar.gz: 95970f4cf7d653e35eaaba6625c698180a849273
3
+ metadata.gz: 32002b0b4cde89649bd0eb72eaa53e8b78c4d1db
4
+ data.tar.gz: 4b3cca25bf5b9b467af2aa970d390af5f784b4fa
5
5
  SHA512:
6
- metadata.gz: 8f70a44c98c6e18193b73197e41cd7c288b828a7228c6995f2f7abca19d88abbabda51575c9405c1a0a2ab5df4e9e7ea1cfedf70bdf34946f6ab4c2447012c57
7
- data.tar.gz: 50e1a6317801d341ea106e62cd319a9094a573bf3c1c51a87217f718e59a7a23273c238aad6f199dd69e3b9e1921712ea6fbf71a62580309d8972ebd31f2fbe3
6
+ metadata.gz: e5caf7ec30c5c70441b53c4fcca196f1c73c9d1c24757f483a1d7d62e6f8745f4833bebc6d77c39bccfaebeff9e932c4bb8557788d9184f992cc4a0b2e63c9f8
7
+ data.tar.gz: 9d2e51d7489a4c1335d356d4f9b729de7550858dee886a58a3d159c7b5bb451da398d1ec6ce050f0e9d7526f79308883e1fd3914a19823d4ce9d272a125dff47
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 3.13.1 / 2015-02-03
2
+
3
+ * 1 bug fix:
4
+
5
+ * Remove deprecated test_files from spec. (igas)
6
+
1
7
  === 3.13.0 / 2014-09-26
2
8
 
3
9
  * 2 minor enhancements:
data/Rakefile CHANGED
@@ -1,12 +1,14 @@
1
1
  # -*- ruby -*-
2
2
 
3
- $:.unshift 'lib'
4
- require './lib/hoe.rb'
3
+ $:.unshift "lib"
4
+ require "./lib/hoe.rb"
5
5
 
6
6
  Hoe.plugin :seattlerb
7
7
  Hoe.plugin :isolate
8
8
  Hoe.plugin :rdoc
9
9
 
10
+ Hoe.add_include_dirs "../../minitest/dev/lib"
11
+
10
12
  Hoe.spec "hoe" do
11
13
  developer "Ryan Davis", "ryand-ruby@zenspider.com"
12
14
 
@@ -17,14 +19,14 @@ Hoe.spec "hoe" do
17
19
  license "MIT"
18
20
 
19
21
  pluggable!
20
- require_rubygems_version '>= 1.4'
22
+ require_rubygems_version ">= 1.4"
21
23
 
22
24
  dependency "rake", [">= 0.8", "< 11.0"] # FIX: to force it to exist pre-isolate
23
25
  end
24
26
 
25
27
  task :plugins do
26
28
  puts `find lib/hoe -name \*.rb | xargs grep -h module.Hoe::`.
27
- gsub(/module/, '*')
29
+ gsub(/module/, "*")
28
30
  end
29
31
 
30
32
  task :known_plugins do
@@ -32,7 +34,7 @@ task :known_plugins do
32
34
  fetcher = Gem::SpecFetcher.fetcher
33
35
  spec_tuples = fetcher.find_matching dep
34
36
 
35
- max = spec_tuples.map { |(tuple, source)| tuple.first.size }.max
37
+ max = spec_tuples.map { |(tuple, _source)| tuple.first.size }.max
36
38
 
37
39
  spec_tuples.each do |(tuple, source)|
38
40
  spec = Gem::SpecFetcher.fetcher.fetch_spec(tuple, URI.parse(source))
data/bin/sow CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env ruby -w
2
2
 
3
- require 'optparse'
4
- require 'rubygems'
5
- require 'hoe'
6
- require 'fileutils'
7
- require 'erb'
3
+ require "optparse"
4
+ require "rubygems"
5
+ require "hoe"
6
+ require "fileutils"
7
+ require "erb"
8
8
 
9
- XIF = 'FI' + 'X' # prevents extra hits on my TAG reporter
9
+ XIF = "FI" + "X" # prevents extra hits on my TAG reporter
10
10
 
11
11
  option = {
12
12
  :style => "default",
@@ -14,17 +14,17 @@ option = {
14
14
  }
15
15
 
16
16
  def check_subdir option
17
- if option[:subdir] then
18
- warn "ERROR: you can't specify multiple subdirs"
19
- abort opts.to_s
20
- end
17
+ return unless option[:subdir]
18
+
19
+ warn "ERROR: you can't specify multiple subdirs"
20
+ abort opts.to_s
21
21
  end
22
22
 
23
23
  def make_sub_modules klass
24
24
  last = nil
25
- result = ''
26
- klass.split('::')[0..-2].each do |part|
27
- last = [last, part].compact.join('::')
25
+ result = ""
26
+ klass.split("::")[0..-2].each do |part|
27
+ last = [last, part].compact.join("::")
28
28
  result << "module #{last}; end\n"
29
29
  end
30
30
  result << "\n" unless result.empty?
@@ -87,7 +87,7 @@ end
87
87
  project = ARGV.shift
88
88
 
89
89
  abort op.to_s unless project
90
- abort "Project #{project} seems to exist" if test ?d, project
90
+ abort "Project #{project} seems to exist" if File.directory? project
91
91
 
92
92
  _, file_name, klass, test_klass = Hoe.normalize_names project
93
93
  ext_name = File.basename file_name # minitest/plugin => plugin
@@ -115,7 +115,7 @@ Dir.chdir project do
115
115
  warn "erb: #{path}"
116
116
 
117
117
  File.open path, "w" do |io|
118
- erb = ERB.new file, nil, '<>'
118
+ erb = ERB.new file, nil, "<>"
119
119
  erb.filename = path
120
120
  io.puts erb.result(binding)
121
121
  end
@@ -125,17 +125,17 @@ Dir.chdir project do
125
125
  new_file = file.
126
126
  sub(/(test_)?file_name/, file_name).
127
127
  sub(/(test_)?ext_name/, ext_name).
128
- sub(/\.erb$/, '')
128
+ sub(/\.erb$/, "")
129
129
 
130
130
  case file
131
131
  when /^bin/ then
132
132
  dir, *rest = new_file.split File::SEPARATOR
133
133
 
134
- new_file = File.join dir, rest.join('_')
134
+ new_file = File.join dir, rest.join("_")
135
135
  when /^test/ then
136
136
  dir, *rest = new_file.split File::SEPARATOR
137
137
 
138
- rest.last.sub!(/^/, 'test_')
138
+ rest.last.sub!(/^/, "test_")
139
139
 
140
140
  new_file = File.join dir, *rest
141
141
  end
data/lib/hoe.rb CHANGED
@@ -1,24 +1,24 @@
1
1
  # -*- mode: ruby; coding: us-ascii; -*-
2
2
 
3
- require 'rubygems'
3
+ require "rubygems"
4
4
 
5
5
  begin
6
- gem 'rake'
6
+ gem "rake"
7
7
  rescue Gem::LoadError
8
8
  warn "Using the crusty system installed rake... you probably want to upgrade"
9
9
  end
10
- require 'rake'
11
- require 'rake/testtask'
12
- require 'rbconfig'
10
+ require "rake"
11
+ require "rake/testtask"
12
+ require "rbconfig"
13
13
 
14
14
  begin
15
- require 'psych'
15
+ require "psych"
16
16
  rescue LoadError
17
17
  # do nothing
18
18
  end
19
- require 'yaml'
19
+ require "yaml"
20
20
 
21
- require 'hoe/rake'
21
+ require "hoe/rake"
22
22
 
23
23
  ##
24
24
  # Hoe is a simple rake/rubygems helper for project Rakefiles. It helps
@@ -91,7 +91,7 @@ class Hoe
91
91
  include Rake::DSL if defined?(Rake::DSL)
92
92
 
93
93
  # duh
94
- VERSION = "3.13.0"
94
+ VERSION = "3.13.1"
95
95
 
96
96
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
97
97
  :publish, :gemcutter, :signing, :test]
@@ -101,15 +101,15 @@ class Hoe
101
101
  ##
102
102
  # Used to add extra flags to RUBY_FLAGS.
103
103
 
104
- RUBY_DEBUG = ENV['RUBY_DEBUG']
104
+ RUBY_DEBUG = ENV["RUBY_DEBUG"]
105
105
 
106
- default_ruby_flags = "-w -I#{%w(lib bin test .).join(File::PATH_SEPARATOR)}" +
107
- (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
106
+ default_ruby_flags = "-w -I#{%w[lib bin test .].join(File::PATH_SEPARATOR)}" +
107
+ (RUBY_DEBUG ? " #{RUBY_DEBUG}" : "")
108
108
 
109
109
  ##
110
110
  # Used to specify flags to ruby [has smart default].
111
111
 
112
- RUBY_FLAGS = ENV['RUBY_FLAGS'] || default_ruby_flags
112
+ RUBY_FLAGS = ENV["RUBY_FLAGS"] || default_ruby_flags
113
113
 
114
114
  ##
115
115
  # Default configuration values for .hoerc. Plugins should populate
@@ -122,7 +122,7 @@ class Hoe
122
122
  ##
123
123
  # True if you're a masochistic developer. Used for building commands.
124
124
 
125
- WINDOZE = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
125
+ WINDOZE = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
126
126
 
127
127
  ##
128
128
  # *MANDATORY*: The author(s) of the package. (can be array)
@@ -343,11 +343,11 @@ class Hoe
343
343
  # Test klass names are same as Klass with Test prepended to each part.
344
344
 
345
345
  def self.normalize_names project # :nodoc:
346
- project = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
346
+ project = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, "")
347
347
  klass = project.gsub(/(?:^|_)([a-z])/) { $1.upcase }
348
348
  klass = klass. gsub(/(?:^|-)([a-z])/) { "::#{$1.upcase}" }
349
349
  test_klass = klass. gsub(/(^|::)([A-Z])/) { "#{$1}Test#{$2}" }
350
- file_name = project.gsub(/-/, '/')
350
+ file_name = project.gsub(/-/, "/")
351
351
 
352
352
  return project, file_name, klass, test_klass
353
353
  end
@@ -396,14 +396,14 @@ class Hoe
396
396
 
397
397
  def activate_plugins
398
398
  with_config do |config, _|
399
- config_plugins = config['plugins']
399
+ config_plugins = config["plugins"]
400
400
  break unless config_plugins
401
- Hoe.plugins.concat config_plugins.map { |plugin| plugin.intern }
401
+ Hoe.plugins.concat config_plugins.map(&:intern)
402
402
  end
403
403
 
404
404
  Hoe.load_plugins Hoe.plugins
405
405
 
406
- names = Hoe.constants.map { |s| s.to_s }
406
+ names = Hoe.constants.map(&:to_s)
407
407
  names.reject! { |n| n =~ /^[A-Z_]+$/ }
408
408
 
409
409
  names.each do |name|
@@ -471,7 +471,7 @@ class Hoe
471
471
  self.extra_dev_deps = normalize_deps extra_dev_deps
472
472
 
473
473
  case name
474
- when 'hoe' then
474
+ when "hoe" then
475
475
  dependency "rake", [">= 0.8", "< 11.0"]
476
476
  else
477
477
  version = VERSION.split(/\./).first(2).join(".")
@@ -499,7 +499,7 @@ class Hoe
499
499
  # Returns the proper dependency list for the thingy.
500
500
 
501
501
  def dependency_target
502
- self.name == 'hoe' ? extra_deps : extra_dev_deps
502
+ self.name == "hoe" ? extra_deps : extra_dev_deps
503
503
  end
504
504
 
505
505
  ##
@@ -507,7 +507,7 @@ class Hoe
507
507
 
508
508
  def define_spec
509
509
  self.spec = Gem::Specification.new do |s|
510
- dirs = Dir['lib']
510
+ dirs = Dir["lib"]
511
511
 
512
512
  manifest = read_manifest
513
513
 
@@ -515,7 +515,7 @@ class Hoe
515
515
  "Manifest is missing or couldn't be read.",
516
516
  "The Manifest is kind of a big deal.",
517
517
  "Maybe you're using a gem packaged by a linux project.",
518
- "It seems like they enjoy breaking other people's code."
518
+ "It seems like they enjoy breaking other people's code.",
519
519
  ].join "\n" unless manifest
520
520
 
521
521
  s.name = name
@@ -535,9 +535,8 @@ class Hoe
535
535
  s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
536
536
  s.bindir = "bin"
537
537
  s.require_paths = dirs unless dirs.empty?
538
- s.rdoc_options = ['--main', readme_file]
538
+ s.rdoc_options = ["--main", readme_file]
539
539
  s.post_install_message = post_install_message
540
- s.test_files = Dir[*self.test_globs].uniq
541
540
 
542
541
  missing "Manifest.txt" if s.files.empty?
543
542
 
@@ -567,24 +566,24 @@ class Hoe
567
566
  end
568
567
 
569
568
  def check_for_version # :nodoc:
570
- unless self.version then
571
- version = nil
572
- version_re = /VERSION += +([\"\'])([\d][\w\.]+)\1/
569
+ return if self.version
573
570
 
574
- spec.files.each do |file|
575
- next unless File.exist? file
576
- version = File.read_utf(file)[version_re, 2] rescue nil
577
- break if version
578
- end
571
+ version = nil
572
+ version_re = /VERSION += +([\"\'])([\d][\w\.]+)\1/
579
573
 
580
- spec.version = self.version = version if version
574
+ spec.files.each do |file|
575
+ next unless File.exist? file
576
+ version = File.read_utf(file)[version_re, 2] rescue nil
577
+ break if version
578
+ end
581
579
 
582
- unless self.version then
583
- spec.version = self.version = "0.borked"
584
- warn "** Add 'VERSION = \"x.y.z\"' to your code,"
585
- warn " add a version to your hoe spec,"
586
- warn " or fix your Manifest.txt"
587
- end
580
+ spec.version = self.version = version if version
581
+
582
+ unless self.version then
583
+ spec.version = self.version = "0.borked"
584
+ warn "** Add 'VERSION = \"x.y.z\"' to your code,"
585
+ warn " add a version to your hoe spec,"
586
+ warn " or fix your Manifest.txt"
588
587
  end
589
588
  end
590
589
 
@@ -627,7 +626,7 @@ class Hoe
627
626
  self.author = []
628
627
  self.changes = nil
629
628
  self.description = nil
630
- self.description_sections = %w(description)
629
+ self.description_sections = %w[description]
631
630
  self.email = []
632
631
  self.extra_deps = []
633
632
  self.extra_dev_deps = []
@@ -639,10 +638,12 @@ class Hoe
639
638
  self.spec_extras = {}
640
639
  self.summary = nil
641
640
  self.summary_sentences = 1
642
- self.test_globs = ['test/**/{test,spec}_*.rb',
643
- 'test/**/*_{test,spec}.rb']
641
+ self.test_globs = ["test/**/{test,spec}_*.rb",
642
+ "test/**/*_{test,spec}.rb"]
644
643
 
645
- if manifest = read_manifest then
644
+ manifest = read_manifest
645
+
646
+ if manifest then
646
647
  self.readme_file = manifest.grep(/^README\./).first
647
648
  self.history_file = manifest.grep(/^History\./).first
648
649
  end
@@ -658,11 +659,11 @@ class Hoe
658
659
 
659
660
  def intuit_values
660
661
  header_re = /^((?:=+|#+) .*)$/
661
- readme = File.read_utf(readme_file).split(header_re)[1..-1] rescue ''
662
+ readme = File.read_utf(readme_file).split(header_re)[1..-1] rescue ""
662
663
 
663
664
  unless readme.empty? then
664
665
  sections = Hash[*readme.map { |s|
665
- s =~ /^[=#]/ ? s.strip.downcase.chomp(':').split.last : s.strip
666
+ s =~ /^[=#]/ ? s.strip.downcase.chomp(":").split.last : s.strip
666
667
  }]
667
668
  desc = sections.values_at(*description_sections).join("\n\n")
668
669
  summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
@@ -680,7 +681,7 @@ class Hoe
680
681
  h.split(/^(={2,}|\#{2,})/)[1..2].join.strip
681
682
  rescue
682
683
  missing history_file
683
- ''
684
+ ""
684
685
  end
685
686
  end
686
687
 
@@ -703,8 +704,7 @@ class Hoe
703
704
  # should update the readme.
704
705
 
705
706
  def parse_urls text
706
-
707
- lines = text.gsub(/^\* /, '').delete("<>").split(/\n/).grep(/\S+/)
707
+ lines = text.gsub(/^\* /, "").delete("<>").split(/\n/).grep(/\S+/)
708
708
 
709
709
  if lines.first =~ /::/ then
710
710
  Hash[lines.map { |line| line.split(/\s*::\s*/) }]
@@ -781,7 +781,7 @@ class Hoe
781
781
 
782
782
  def pluggable!
783
783
  abort "update rubygems to >= 1.3.1" unless Gem.respond_to? :find_files
784
- require_rubygems_version '>= 1.3.1'
784
+ require_rubygems_version ">= 1.3.1"
785
785
  end
786
786
 
787
787
  ##
@@ -838,7 +838,7 @@ class Hoe
838
838
  # 12/31 of the current year.
839
839
 
840
840
  def timebomb n, m, finis = nil, start = nil
841
- require 'time'
841
+ require "time"
842
842
  finis = Time.parse(finis || "#{Time.now.year}-12-31")
843
843
  start = Time.parse(start || "#{Time.now.year}-01-01")
844
844
  rest = (finis - Time.now)
@@ -851,7 +851,7 @@ class Hoe
851
851
  # Verify that mandatory fields are set.
852
852
 
853
853
  def validate_fields
854
- %w(email author).each do |field|
854
+ %w[email author].each do |field|
855
855
  value = self.send(field)
856
856
  abort "Hoe #{field} value not set. aborting" if value.nil? or value.empty?
857
857
  end
@@ -870,7 +870,7 @@ class Hoe
870
870
 
871
871
  config = config.merge homeconfig
872
872
 
873
- localrc = File.join Dir.pwd, '.hoerc'
873
+ localrc = File.join Dir.pwd, ".hoerc"
874
874
  exists = File.exist? localrc
875
875
  localconfig = exists ? YAML.load_file(localrc) : {}
876
876
 
@@ -890,7 +890,7 @@ class File
890
890
  if r19 then
891
891
  f.read
892
892
  else
893
- f.read.sub %r/\A\xEF\xBB\xBF/, ''
893
+ f.read.sub %r%\A\xEF\xBB\xBF%, ""
894
894
  end
895
895
  end
896
896
  end
data/lib/hoe/clean.rb CHANGED
@@ -15,15 +15,15 @@ module Hoe::Clean
15
15
  # Initialize variables for plugin.
16
16
 
17
17
  def initialize_clean
18
- self.clean_globs ||= %w(diff diff.txt TAGS ri deps .source_index
19
- *.gem **/*~ **/.*~ **/*.rbc coverage*)
18
+ self.clean_globs ||= %w[diff diff.txt TAGS ri deps .source_index
19
+ *.gem **/*~ **/.*~ **/*.rbc coverage*]
20
20
  end
21
21
 
22
22
  ##
23
23
  # Define tasks for plugin.
24
24
 
25
25
  def define_clean_tasks
26
- desc 'Clean up all the extras.'
26
+ desc "Clean up all the extras."
27
27
  task :clean => [ :clobber_docs, :clobber_package ] do
28
28
  clean_globs.each do |pattern|
29
29
  files = Dir[pattern]