henshin 0.4.1 → 0.4.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -64,7 +64,14 @@ else
64
64
 
65
65
  if ARGV[0]
66
66
  override['root'] = ARGV[0].split(':')[0]
67
- override['target'] = ARGV[0].split(':')[1] if ARGV[0].split(':')[1]
67
+ if ARGV[0].split(':')[1]
68
+ override['target'] = ARGV[0].split(':')[1]
69
+ else
70
+ override['target'] = File.join(override['root'], Henshin::Defaults['target'])
71
+ end
72
+ else
73
+ override['root'] = Henshin::Defaults['root']
74
+ override['target'] = Henshin::Defaults['target']
68
75
  end
69
76
 
70
77
 
@@ -85,7 +92,7 @@ else
85
92
 
86
93
  threads << Thread.new {
87
94
  @h = Mongrel::HttpServer.new(build[:address], build[:port])
88
- @h.register "/", Mongrel::DirHandler.new("test/site/_site")
95
+ @h.register("/", Mongrel::DirHandler.new(override['target']))
89
96
  puts "Server launched at http://#{build[:address]}:#{build[:port]}"
90
97
  trap("INT") {
91
98
  @h.stop
@@ -99,7 +106,7 @@ else
99
106
  threads << Thread.new {
100
107
  server = WEBrick::HTTPServer.new(
101
108
  :Port => build[:port],
102
- :DocumentRoot => File.join(config[:root], config[:target]),
109
+ :DocumentRoot => override['target'],
103
110
  :MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes
104
111
  )
105
112
  trap("INT") { server.shutdown }
@@ -116,14 +123,14 @@ else
116
123
  puts "", "Auto-build initiated..."
117
124
 
118
125
  # build the glob pattern
119
- gl = Dir[ File.join(site.config['root'], '*')].select { |x| File.directory?(x) }
126
+ gl = Dir[ File.join(override['root'], '*')].select { |x| File.directory?(x) }
120
127
  ['/_site', '/plugins'].each do |r|
121
- gl = gl.select {|i| !i.include?( File.join(site.config['root'], r) )}
128
+ gl = gl.select {|i| !i.include?( File.join(override['root'], r) )}
122
129
  end
123
- gl.collect! {|x| "#{x}/**/*"[site.config['root'].size+1..-1]}
130
+ gl.collect! {|x| "#{x}/**/*"[override['root'].size+1..-1]}
124
131
  gl += ['*']
125
132
 
126
- dw = DirectoryWatcher.new(site.config['root'], :glob => gl)
133
+ dw = DirectoryWatcher.new(override['root'], :glob => gl)
127
134
  dw.interval = 1
128
135
  dw.add_observer do |*args|
129
136
  if args.size > 1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{henshin}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["hawx"]
@@ -14,22 +14,8 @@ module Henshin
14
14
  # @return [String] a path which should be prepended to all urls
15
15
  attr_accessor :base
16
16
 
17
- # @return [Array]
18
- attr_accessor :gens, :posts, :statics
19
-
20
- # @return [Hash{String => String}]
21
- attr_accessor :layouts
22
-
23
- # @return [Tags]
24
- attr_accessor :tags
25
-
26
- # @return [Categories]
27
- attr_accessor :categories
28
-
29
- # @return [Archive]
30
- attr_accessor :archive
31
-
32
- # @return [Hash{String => Plugin}]
17
+ attr_accessor :gens, :posts, :statics, :layouts
18
+ attr_accessor :tags, :categories, :archive
33
19
  attr_accessor :plugins
34
20
 
35
21
  # A new instance of site
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: henshin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - hawx