massimo 0.4.0 → 0.4.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
data/lib/massimo/site.rb CHANGED
@@ -117,8 +117,9 @@ module Massimo
117
117
  # Return an Array of the reloaded Constants.
118
118
  def reload_files(files)
119
119
  files.collect do |file|
120
- load(file)
121
120
  class_name = File.basename(file).gsub(File.extname(file), "").classify
121
+ Object.class_eval { remove_const(class_name) if const_defined?(class_name) }
122
+ load(file)
122
123
  class_name.constantize rescue nil
123
124
  end
124
125
  end
data/massimo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{massimo}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Peter Browne"]
12
- s.date = %q{2010-01-09}
12
+ s.date = %q{2010-01-10}
13
13
  s.default_executable = %q{massimo}
14
14
  s.description = %q{Massimo builds HTML, Javascript, and CSS Files from your source.}
15
15
  s.email = %q{me@petebrowne.com}
data/test/test_site.rb CHANGED
@@ -32,6 +32,45 @@ class TestSite < Test::Unit::TestCase
32
32
  assert @site.production?
33
33
  end
34
34
 
35
+ context "Site#dir_for" do
36
+ should "get the default path to directories" do
37
+ @site = Massimo::Site(:source => source_dir)
38
+ assert_equal source_dir("pages"), @site.dir_for(:pages)
39
+ end
40
+
41
+ should "get the specified path to directories from the options" do
42
+ @site = Massimo::Site(:source => source_dir, :pages_path => source_dir("my_pages"))
43
+ assert_equal source_dir("my_pages"), @site.dir_for(:pages)
44
+ end
45
+
46
+ should "get paths to files" do
47
+ @site = Massimo::Site(:source => source_dir)
48
+ assert_equal source_dir("random", "file.jpg"), @site.dir_for(:random, "file.jpg")
49
+ end
50
+ end
51
+
52
+ context "Site#all_source_dirs" do
53
+ should "get the directories of all the resources, libs, and helpers" do
54
+ assert_equal [
55
+ "./test/source/views",
56
+ "./test/source/pages",
57
+ "./test/source/stylesheets",
58
+ "./test/source/javascripts",
59
+ "./test/source/helpers",
60
+ "./test/source/lib" ],
61
+ site.all_source_dirs
62
+ end
63
+
64
+ should "include new resource directories" do
65
+ class Post < Massimo::Page; end
66
+ assert site.all_source_dirs.include?("./test/source/posts")
67
+ end
68
+
69
+ teardown do
70
+ Massimo.resources.delete_if { |resource| resource.name == "post" }
71
+ end
72
+ end
73
+
35
74
  context "A Normal Site" do
36
75
  setup { site() }
37
76
 
@@ -39,13 +78,6 @@ class TestSite < Test::Unit::TestCase
39
78
  assert_equal source_dir("some", "path"), @site.source_dir("some", "path")
40
79
  end
41
80
 
42
- # should "have a directory shortcut methods" do
43
- # assert_equal source_dir("pages", "some", "file.txt"), @site.pages_dir("some", "file.txt")
44
- # assert_equal source_dir("views", "some", "file.txt"), @site.views_dir("some", "file.txt")
45
- # assert_equal source_dir("stylesheets", "some", "file.txt"), @site.stylesheets_dir("some", "file.txt")
46
- # assert_equal source_dir("javascripts", "some", "file.txt"), @site.javascripts_dir("some", "file.txt")
47
- # end
48
-
49
81
  should "have a output_dir method" do
50
82
  assert_equal output_dir("some", "path"), @site.output_dir("some", "path")
51
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: massimo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Browne
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-09 00:00:00 -06:00
12
+ date: 2010-01-10 00:00:00 -06:00
13
13
  default_executable: massimo
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency