mango 0.5.0.beta3 → 0.5.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.mdown CHANGED
@@ -1,4 +1,4 @@
1
- Mango release 0.5.0.beta3 (October 21, 2010)
1
+ Mango release 0.5.0.beta4 (October 24, 2010)
2
2
  ============================================
3
3
 
4
4
  ### Features
@@ -13,6 +13,8 @@ Mango release 0.5.0.beta3 (October 21, 2010)
13
13
 
14
14
  ### Dependencies
15
15
 
16
+ * Added [RubyGems](https://rubygems.org/) 1.3.7
17
+ * Updated [Ruby](http://www.ruby-lang.org/) to 1.9.1 or 1.9.2
16
18
  * Updated [Bundler](http://gembundler.com/) to 1.0.3
17
19
  * Updated [Haml](http://haml-lang.com/) to 3.0.22
18
20
  * Updated [Sass](http://sass-lang.com/) to 3.0.22 (bundled with Haml)
@@ -25,6 +27,7 @@ Mango release 0.5.0.beta3 (October 21, 2010)
25
27
  ### Bugs
26
28
 
27
29
  * The NOT_FOUND handler no longer renders the 404 template within a layout template.
30
+ * Improved install-time and run-time error messages for Ruby 1.8 environments
28
31
 
29
32
  Mango release 0.4.0 (August 30, 2010)
30
33
  =====================================
data/README.mdown CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Image courtesy of [B.C. Tree Fruits LTD.](http://www.bctree.com/products/sourced/mango.php)
4
4
 
5
- Mango release 0.5.0.beta3 (October 21, 2010)
5
+ Mango release 0.5.0.beta4 (October 24, 2010)
6
6
  ============================================
7
7
 
8
8
  Copyright (c) 2010 Ryan Sobol. Licensed under the MIT license. Please see the {file:LICENSE} for more information.
@@ -29,6 +29,8 @@ WHAT'S NEW?
29
29
 
30
30
  ### Dependencies
31
31
 
32
+ * Added [RubyGems](https://rubygems.org/) 1.3.7
33
+ * Updated [Ruby](http://www.ruby-lang.org/) to 1.9.1 or 1.9.2
32
34
  * Updated [Bundler](http://gembundler.com/) to 1.0.3
33
35
  * Updated [Haml](http://haml-lang.com/) to 3.0.22
34
36
  * Updated [Sass](http://sass-lang.com/) to 3.0.22 (bundled with Haml)
@@ -41,6 +43,7 @@ WHAT'S NEW?
41
43
  ### Bugs
42
44
 
43
45
  * The NOT_FOUND handler no longer renders the 404 template within a layout template.
46
+ * Improved install-time and run-time error messages for Ruby 1.8 environments
44
47
 
45
48
  Please see {file:CHANGES.mdown} for the historical overview of the project.
46
49
 
@@ -71,7 +74,8 @@ REQUIREMENTS
71
74
 
72
75
  **Required dependencies**
73
76
 
74
- * [Ruby](http://www.ruby-lang.org/) 1.9.1
77
+ * [Ruby](http://www.ruby-lang.org/) 1.9.1 or 1.9.2 ([RVM](http://rvm.beginrescueend.com/) recommended)
78
+ * [RubyGems](https://rubygems.org/) 1.3.7 (bundled with Ruby)
75
79
  * [Bundler](http://gembundler.com/) 1.0.3
76
80
  * [Rack](http://rack.rubyforge.org/) 1.2.1
77
81
  * [Sinatra](http://www.sinatrarb.com/) 1.0
@@ -91,35 +95,51 @@ REQUIREMENTS
91
95
  INSTALLING
92
96
  ----------
93
97
 
94
- $ gem install mango
98
+ $ gem install mango -v 0.5.0.beta4
99
+
100
+ Note: Depending on how RubyGems is installed on your machine, you *may* need to prepend the command with `sudo`.
95
101
 
96
102
  USAGE
97
103
  -----
98
104
 
99
- ### A sample blog structure
100
-
101
- |-- content
102
- | |-- about
103
- | | |-- index.haml
104
- | | `-- us.haml
105
- | `-- index.haml
106
- `-- themes
107
- `-- default
108
- |-- public
109
- | |-- images
110
- | | `-- ripe-mango.jpg
111
- | `-- robots.txt
112
- |-- styles
113
- | `-- screen.sass
114
- `-- views
115
- |-- 404.haml
116
- |-- layout.haml
117
- `-- page.haml
118
-
119
- ### Starting a development server
105
+ ### Generating a Mango application
106
+
107
+ $ mango create /path/to/your/app
120
108
 
109
+ ### Starting the application
110
+
111
+ $ cd /path/to/your/app
121
112
  $ rackup
122
113
 
114
+ ### Generated application structure
115
+
116
+ $ tree
117
+ .
118
+ ├── Gemfile
119
+ ├── README.md
120
+ ├── config.ru
121
+ ├── content
122
+ │ └── index.md
123
+ └── themes
124
+ └── default
125
+ ├── public
126
+ │ ├── favicon.ico
127
+ │ ├── images
128
+ │ │ └── particles.gif
129
+ │ ├── javascripts
130
+ │ │ ├── fireworks.js
131
+ │ │ └── timer.js
132
+ │ ├── robots.txt
133
+ │ └── styles
134
+ │ ├── fireworks.css
135
+ │ └── reset.css
136
+ ├── styles
137
+ │ └── screen.sass
138
+ └── views
139
+ ├── 404.haml
140
+ ├── layout.haml
141
+ └── page.haml
142
+
123
143
  UNDER THE HOOD
124
144
  --------------
125
145
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
- require_relative "lib/mango"
2
+ require File.expand_path("lib/mango", File.dirname(__FILE__))
3
3
  Mango::Dependencies.warn_at_exit
4
4
 
5
5
  ###################################################################################################
data/bin/mango CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
3
 
4
+ # Ensure the environment uses the correct version of Ruby
5
+ require File.expand_path("../lib/mango/dependencies", File.dirname(__FILE__))
6
+
4
7
  require_relative "../lib/mango/runner"
5
8
  Mango::Runner.start
data/lib/mango.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  # encoding: UTF-8
2
- require_relative "mango/dependencies" # ruby version guard
2
+
3
+ # Ensure the environment uses the correct version of Ruby
4
+ require File.expand_path("mango/dependencies", File.dirname(__FILE__))
5
+
3
6
  require_relative "mango/version"
4
7
  require_relative "mango/rack/debugger"
5
8
  require_relative "mango/application"
@@ -9,9 +9,9 @@ module Mango
9
9
  # is not always a better version.
10
10
  #
11
11
  # `Mango::Dependencies` automatically enforces a strict parse-time check for the
12
- # `REQUIRED_RUBY_VERSION` on both application and development processes for the `Mango` library.
13
- # (i.e. `bin/mango`, `rake`, `spec`, etc) Because of this, I've ensured this file is
14
- # syntactically compatible with Ruby 1.8.6 or higher.
12
+ # `SUPPORTED_RUBY_VERSIONS` on both application and development processes for the `Mango`
13
+ # library. (i.e. `bin/mango`, `rake`, `spec`, `rackup`, etc) Because of this, I've ensured this
14
+ # file is syntactically compatible with Ruby 1.8.7 or higher.
15
15
  #
16
16
  # Currently, `Mango` does **not** enforce strict parse-time version checking on `DEVELOPMENT_GEMS`.
17
17
  # In the future, I would like to experiment with using RubyGems and the `Kernel#gem` method to
@@ -36,8 +36,7 @@ module Mango
36
36
  # @see Mango::Dependencies.create_warning_for
37
37
  # @see Mango::Dependencies.warn_at_exit
38
38
  class Dependencies
39
- # For now, starting with Ruby 1.9.1 but I would like to experiment with compatibility with Ruby >= 1.9.1 in the future.
40
- REQUIRED_RUBY_VERSION = "1.9.1"
39
+ SUPPORTED_RUBY_VERSIONS = ["1.9.1", "1.9.2"]
41
40
 
42
41
  # bluecloth is a hidden yard dependency for markdown support
43
42
  DEVELOPMENT_GEMS = {
@@ -49,9 +48,9 @@ module Mango
49
48
  }
50
49
 
51
50
  FILE_NAME_TO_GEM_NAME = {
52
- :"rack/test" => :"rack-test",
53
- :"spec/rake/spectask" => :rspec,
54
- :"yard/sinatra" => :"yard-sinatra"
51
+ :"rack/test" => :"rack-test",
52
+ :"rspec/core/rake_task" => :rspec,
53
+ :"yard/sinatra" => :"yard-sinatra"
55
54
  }
56
55
 
57
56
  # Empties the warnings cache. This method is called when the class is required.
@@ -106,17 +105,17 @@ module Mango
106
105
 
107
106
  private
108
107
 
109
- # Checks that the version of the current Ruby process matches the `REQUIRED_RUBY_VERSION`.
110
- # This method is automatically invoked at the first time this class is required, ensuring the
111
- # correct Ruby version at parse-time.
108
+ # Checks that the version of the current Ruby process matches the one of the
109
+ # `SUPPORTED_RUBY_VERSIONS`. This method is automatically invoked at the first time this class
110
+ # is required, ensuring the correct Ruby version at parse-time.
112
111
  #
113
112
  # @param [String] ruby_version Useful for automated specifications. Defaults to `RUBY_VERSION`.
114
113
  # @raise [SystemExit] Raised, with a message, when the process is using an incorrect version of Ruby.
115
114
  def self.check_ruby_version(ruby_version = RUBY_VERSION)
116
- unless ruby_version == REQUIRED_RUBY_VERSION
115
+ unless SUPPORTED_RUBY_VERSIONS.include?(ruby_version)
117
116
  abort <<-ERROR
118
- This library requires Ruby #{REQUIRED_RUBY_VERSION}, but you're using #{ruby_version}.
119
- Please visit http://www.ruby-lang.org/ for installation instructions.
117
+ This library supports Ruby #{SUPPORTED_RUBY_VERSIONS.join(" or ")}, but you're using #{ruby_version}.
118
+ Please visit http://www.ruby-lang.org/ or http://rvm.beginrescueend.com/ for installation instructions.
120
119
  ERROR
121
120
  end
122
121
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  source "http://rubygems.org"
3
3
 
4
- gem "mango", "0.5.0.beta3"
4
+ gem "mango", "0.5.0.beta4"
data/lib/mango/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mango
4
4
  # Current stable released version
5
- VERSION = "0.5.0.beta3"
5
+ VERSION = "0.5.0.beta4"
6
6
  end
data/mango.gemspec CHANGED
@@ -11,12 +11,13 @@ Gem::Specification.new do |s|
11
11
  s.summary = "Mango is a dynamic, database-free, and open source website framework"
12
12
  s.description = "Mango is a dynamic, database-free, and open source website framework that is designed to make life easier for small teams of designers, developers, and content writers."
13
13
 
14
- s.required_rubygems_version = ">= 1.3.7"
14
+ s.required_ruby_version = "~> 1.9.1"
15
+ s.required_rubygems_version = "~> 1.3.7"
15
16
  s.rubyforge_project = "mango"
16
17
 
17
18
  s.add_runtime_dependency "bundler", "~> 1.0.3"
18
19
  s.add_runtime_dependency "rack", "~> 1.2.1"
19
- s.add_runtime_dependency "sinatra", "~> 1.0"
20
+ s.add_runtime_dependency "sinatra", "~> 1.0.0"
20
21
  s.add_runtime_dependency "haml", "~> 3.0.22"
21
22
  s.add_runtime_dependency "bluecloth", "~> 2.0.9"
22
23
  s.add_runtime_dependency "thor", "~> 0.14.3"
@@ -6,8 +6,8 @@ describe Mango::Dependencies do
6
6
  #################################################################################################
7
7
 
8
8
  describe "class constant and variable defaults" do
9
- it "required ruby version should be correct" do
10
- Mango::Dependencies::REQUIRED_RUBY_VERSION.should == "1.9.1"
9
+ it "supports ruby 1.9.1 or 1.9.2" do
10
+ Mango::Dependencies::SUPPORTED_RUBY_VERSIONS.should == ["1.9.1", "1.9.2"]
11
11
  end
12
12
 
13
13
  it "development gem names and versions should be correct" do
@@ -24,9 +24,9 @@ describe Mango::Dependencies do
24
24
 
25
25
  it "file name to gem name look-up table should be correct" do
26
26
  expected = {
27
- :"rack/test" => :"rack-test",
28
- :"spec/rake/spectask" => :rspec,
29
- :"yard/sinatra" => :"yard-sinatra"
27
+ :"rack/test" => :"rack-test",
28
+ :"rspec/core/rake_task" => :rspec,
29
+ :"yard/sinatra" => :"yard-sinatra"
30
30
  }
31
31
  Mango::Dependencies::FILE_NAME_TO_GEM_NAME.should == expected
32
32
  end
@@ -49,8 +49,8 @@ describe Mango::Dependencies do
49
49
 
50
50
  def expected_message(version)
51
51
  @expected_message = <<-ERROR
52
- This library requires Ruby 1.9.1, but you're using #{version}.
53
- Please visit http://www.ruby-lang.org/ for installation instructions.
52
+ This library supports Ruby 1.9.1 or 1.9.2, but you're using #{version}.
53
+ Please visit http://www.ruby-lang.org/ or http://rvm.beginrescueend.com/ for installation instructions.
54
54
  ERROR
55
55
  end
56
56
 
@@ -82,11 +82,11 @@ Please visit http://www.ruby-lang.org/ for installation instructions.
82
82
  }.should_not raise_exception(SystemExit, expected_message(version))
83
83
  end
84
84
 
85
- it "aborts for ruby 1.9.2" do
85
+ it "doesn't abort for ruby 1.9.2" do
86
86
  version = "1.9.2"
87
87
  lambda {
88
88
  Mango::Dependencies.send(:check_ruby_version, version)
89
- }.should raise_exception(SystemExit, expected_message(version))
89
+ }.should_not raise_exception(SystemExit, expected_message(version))
90
90
  end
91
91
  end
92
92
 
@@ -156,7 +156,7 @@ Please visit http://www.ruby-lang.org/ for installation instructions.
156
156
  end
157
157
 
158
158
  it "displays a warning message to the user on the standard output channel" do
159
- Mango::Dependencies.create_warning_for(LoadError.new("no such file to load -- spec/rake/spectask"))
159
+ Mango::Dependencies.create_warning_for(LoadError.new("no such file to load -- rspec/core/rake_task"))
160
160
  Mango::Dependencies.create_warning_for(LoadError.new("no such file to load -- yard"))
161
161
  Mango::Dependencies.create_warning_for(LoadError.new("no such file to load -- bluecloth"))
162
162
  Mango::Dependencies.render_warnings
@@ -4,7 +4,7 @@ require "spec_helper"
4
4
  describe Mango do
5
5
  describe "version synchronizing" do
6
6
  before(:each) do
7
- @expected = "0.5.0.beta3"
7
+ @expected = "0.5.0.beta4"
8
8
  end
9
9
 
10
10
  it "is correct for Mango::VERSION" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mango
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1162428694
4
+ hash: 561593429
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 0
10
- - beta3
11
- version: 0.5.0.beta3
10
+ - beta4
11
+ version: 0.5.0.beta4
12
12
  platform: ruby
13
13
  authors:
14
14
  - Ryan Sobol
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-23 00:00:00 -07:00
19
+ date: 2010-10-24 00:00:00 -07:00
20
20
  default_executable: mango
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -59,11 +59,12 @@ dependencies:
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- hash: 15
62
+ hash: 23
63
63
  segments:
64
64
  - 1
65
65
  - 0
66
- version: "1.0"
66
+ - 0
67
+ version: 1.0.0
67
68
  type: :runtime
68
69
  version_requirements: *id003
69
70
  - !ruby/object:Gem::Dependency
@@ -288,16 +289,18 @@ require_paths:
288
289
  required_ruby_version: !ruby/object:Gem::Requirement
289
290
  none: false
290
291
  requirements:
291
- - - ">="
292
+ - - ~>
292
293
  - !ruby/object:Gem::Version
293
- hash: 3
294
+ hash: 49
294
295
  segments:
295
- - 0
296
- version: "0"
296
+ - 1
297
+ - 9
298
+ - 1
299
+ version: 1.9.1
297
300
  required_rubygems_version: !ruby/object:Gem::Requirement
298
301
  none: false
299
302
  requirements:
300
- - - ">="
303
+ - - ~>
301
304
  - !ruby/object:Gem::Version
302
305
  hash: 21
303
306
  segments: