tdreyno-middleman 0.2.4 → 0.2.5

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.2.4
1
+ 0.2.5
data/bin/mm-build CHANGED
@@ -3,6 +3,8 @@
3
3
  # Require app
4
4
  require 'rubygems'
5
5
  require 'templater'
6
+
7
+ MIDDLEMAN_BUILDER = true
6
8
  require File.join(File.dirname(__FILE__), '..', 'lib', 'middleman')
7
9
  require File.join(File.dirname(__FILE__), '..', 'vendor', 'rack-test', 'lib', 'rack', 'test')
8
10
 
@@ -36,7 +38,6 @@ module Generators
36
38
  end
37
39
 
38
40
  def self.file(name, *args, &block)
39
- puts args.inspect
40
41
  args[1] = args[0].gsub('views/', '') if (args[0] === args[1])
41
42
  super(name, *args, &block)
42
43
  end
@@ -54,8 +55,6 @@ module Generators
54
55
  add :build, Builder
55
56
  end
56
57
 
57
- Middleman.set :root, Dir.pwd
58
-
59
58
  # Monkey-patch to use a dynamic renderer
60
59
  class Templater::Actions::Template
61
60
  def render
data/bin/mm-init CHANGED
@@ -18,7 +18,8 @@ module Generators
18
18
  def self.source_root
19
19
  File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'template')
20
20
  end
21
-
21
+
22
+ file :init, "init.rb"
22
23
  glob! :views
23
24
  glob! :public
24
25
  empty_directory :stylesheets, "public/stylesheets"
@@ -0,0 +1,17 @@
1
+ # Helpers
2
+ helpers do
3
+ end
4
+
5
+ # Or inject more templating languages
6
+ # helpers Sinatra::Markdown
7
+
8
+ # Build-specific configuration
9
+ configure :build do
10
+ Compass.configuration do |config|
11
+ # For example, change the Compass output style for deployment
12
+ # config.output_style = :compressed
13
+
14
+ # Or use a different image path
15
+ # config.http_images_path = "/Content/images/"
16
+ end
17
+ end
data/lib/middleman.rb CHANGED
@@ -11,6 +11,10 @@ require File.join(File.dirname(__FILE__), '..', 'vendor', 'sinatra-maruku', 'lib
11
11
 
12
12
  class Middleman < Sinatra::Base
13
13
  set :app_file, __FILE__
14
+ set :static, true
15
+ set :root, Dir.pwd
16
+ set :environment, defined?(MIDDLEMAN_BUILDER) ? :build : :development
17
+
14
18
  helpers Sinatra::Markaby
15
19
  helpers Sinatra::Maruku
16
20
 
@@ -45,7 +49,14 @@ class Middleman < Sinatra::Base
45
49
  config.http_images_path = "/images/"
46
50
  end
47
51
  end
48
-
52
+
53
+ # Check for local config
54
+ local_config = File.join(self.root, "init.rb")
55
+ if File.exists? local_config
56
+ puts "== Local config at: #{local_config}"
57
+ class_eval File.read(local_config)
58
+ end
59
+
49
60
  get /(.*)/ do |path|
50
61
  path << "index.html" if path.match(%r{/$})
51
62
  path.gsub!(%r{^/}, '')
data/middleman.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{middleman}
5
- s.version = "0.2.4"
5
+ s.version = "0.2.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Thomas Reynolds"]
9
- s.date = %q{2009-07-28}
9
+ s.date = %q{2009-07-29}
10
10
  s.email = %q{tdreyno@gmail.com}
11
11
  s.executables = ["mm-init", "mm-build", "mm-server"]
12
12
  s.extra_rdoc_files = [
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "bin/mm-init",
26
26
  "bin/mm-server",
27
27
  "lib/middleman.rb",
28
+ "lib/middleman/template/init.rb",
28
29
  "lib/middleman/template/views/index.haml",
29
30
  "lib/middleman/template/views/layout.haml",
30
31
  "lib/middleman/template/views/stylesheets/site.sass",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdreyno-middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Reynolds
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-28 00:00:00 -07:00
12
+ date: 2009-07-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -95,6 +95,7 @@ files:
95
95
  - bin/mm-init
96
96
  - bin/mm-server
97
97
  - lib/middleman.rb
98
+ - lib/middleman/template/init.rb
98
99
  - lib/middleman/template/views/index.haml
99
100
  - lib/middleman/template/views/layout.haml
100
101
  - lib/middleman/template/views/stylesheets/site.sass