hx 0.25.0 → 0.26.0

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/hx.rb +11 -17
  3. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.25.0
1
+ 0.26.0
data/lib/hx.rb CHANGED
@@ -376,21 +376,13 @@ def self.get_default_author(options)
376
376
  options.fetch(:default_author, "nobody")
377
377
  end
378
378
 
379
- def self.local_require(options, library)
380
- saved_require_path = $:.dup
381
- begin
382
- $:.delete(".")
383
- lib_dir = Hx.get_pathname(options, :lib_dir)
384
- if lib_dir.relative?
385
- $:.push "./#{lib_dir}"
386
- else
387
- $:.push lib_dir.to_s
388
- end
389
- require library
390
- rescue LoadError
391
- raise
392
- ensure
393
- $:[0..-1] = saved_require_path
379
+ def self.setup_require_path(options)
380
+ $:.delete(".")
381
+ lib_dir = Hx.get_pathname(options, :lib_dir)
382
+ if lib_dir.relative?
383
+ $:.push "./#{lib_dir}"
384
+ else
385
+ $:.push lib_dir.to_s
394
386
  end
395
387
  end
396
388
 
@@ -463,7 +455,7 @@ def self.build_source(options, default_input, sources, raw_source)
463
455
  factory = Hx.resolve_constant(filter)
464
456
  rescue NameError
465
457
  library = filter.gsub(/::/, '/').downcase
466
- Hx.local_require(options, library)
458
+ require library
467
459
  factory = Hx.resolve_constant(filter)
468
460
  end
469
461
  source = factory.new(source, filter_options)
@@ -518,9 +510,11 @@ class Site
518
510
  options[:config_file] = config_file
519
511
  options.update(option_overrides)
520
512
 
513
+ Hx.setup_require_path(options)
514
+
521
515
  if raw_config.has_key? 'require'
522
516
  for library in raw_config['require']
523
- Hx.local_require(options, library)
517
+ require library
524
518
  end
525
519
  end
526
520
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 123
4
+ hash: 119
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 25
8
+ - 26
9
9
  - 0
10
- version: 0.25.0
10
+ version: 0.26.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - MenTaLguY
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-29 00:00:00 -07:00
18
+ date: 2011-04-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency