proton 0.3.0.rc1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,14 +1,33 @@
1
+ Proton v0.3.2 - Jun 22, 2011
2
+ ----------------------------
3
+
4
+ Hotfixes.
5
+
6
+ ### Fixed:
7
+ * `Gemfile` and `Gemfile.lock` are now auto ignored when doing *proton build*.
8
+ * Fixed the `rel()` helper.
9
+
1
10
  Proton v0.3.0 - Jun 22, 2011
2
11
  ----------------------------
3
12
 
4
13
  **The project has been renamed to Proton** (previously called *Hyde*).
5
14
 
6
- ### Changed:
7
- * The main class is now called `Proton` instead of `Hyde`. However, `Hyde`
15
+ A manual is also in progress, currently hosted at
16
+ [sinefunc.com/hyde/manual](http://sinefunc.com/hyde/manual).
17
+
18
+ ### Renamed:
19
+ * * The main class is now called `Proton` instead of `Hyde`. However, *Hyde*
8
20
  still works as an alias.
9
21
  * The main executable is now called `proton` (and not `hyde`).
10
- * The configuration file is now called `Protonfile`. The legacy `hyde.conf`
11
- and `.hyderc` still works for backward-compatibility.
22
+ * The configuration file is now called `Protonfile`. The legacy *hyde.conf*
23
+ and *.hyderc* still works for backward-compatibility.
24
+
25
+ ### Added:
26
+ * New `proton rack` command to Rackify a given project.
27
+
28
+ ### Changed:
29
+ * Creating a project with `proton create` will now not include any gem
30
+ manifest or *config.ru* file.
12
31
 
13
32
  Hyde v0.2.3 - Jun 20, 2011
14
33
  --------------------------
data/README.md CHANGED
@@ -41,7 +41,7 @@ It's like building a static site, but better! You can use Proton for:
41
41
  Installation
42
42
  ------------
43
43
 
44
- gem install protonweb
44
+ gem install proton
45
45
 
46
46
  Usage
47
47
  -----
@@ -1,2 +1,2 @@
1
- gem "proton", "0.3.0.rc1"
1
+ gem "proton", "~> 0.3.2"
2
2
  gem "rack-cache", "~> 1.0.0"
@@ -14,7 +14,7 @@ GEM
14
14
  hashie (1.0.0)
15
15
  maruku (0.6.0)
16
16
  syntax (>= 1.0.0)
17
- proton (0.3.0.rc1)
17
+ proton (0.3.2)
18
18
  RedCloth (~> 4.2.3)
19
19
  compass (~> 0.11.1)
20
20
  cuba (~> 2.0.0)
@@ -36,5 +36,5 @@ PLATFORMS
36
36
  ruby
37
37
 
38
38
  DEPENDENCIES
39
- proton (= 0.3.0.rc1)
39
+ proton (~> 0.3.2)
40
40
  rack-cache (~> 1.0.0)
@@ -8,14 +8,16 @@ begin
8
8
  require 'bundler'
9
9
  Bundler.setup
10
10
  rescue LoadError
11
- gem 'proton', '0.3.0.rc1'
11
+ gem 'proton', '0.3.2'
12
12
  end
13
13
 
14
- # Add the 'rack-cache' gem if you want to enable caching.
15
- begin
16
- require 'rack/cache'
17
- use Rack::Cache
18
- rescue LoadError
14
+ # Optional: use the 'rack-cache' gem for cacheing.
15
+ if ENV['RACK_ENV'] == 'production'
16
+ begin
17
+ require 'rack/cache'
18
+ use Rack::Cache
19
+ rescue LoadError
20
+ end
19
21
  end
20
22
 
21
23
  # Load Proton.
@@ -72,7 +72,7 @@ class Config
72
72
  end
73
73
 
74
74
  def requirement
75
- # Backward compatibility: this config option used to be called
75
+ # Backward compatibility; this config option used to be called
76
76
  # `hyde_requirement` before the project was renamed to Proton.
77
77
  self[:requirement] || self[:hyde_requirement]
78
78
  end
@@ -64,10 +64,16 @@ module Helpers
64
64
  #
65
65
  # ...where the `../../` depends on the current page's path.
66
66
  #
67
- def rel(path)
68
- depth = page.path.count('/')
69
- dotdot = depth > 1 ? ('../' * (depth-1)) : './'
70
- (dotdot[0...-1] + path)
67
+ def rel(path, from=page.path)
68
+ if path[0] == '/'
69
+ depth = from.count('/')
70
+ dotdot = depth > 1 ? ('../' * (depth-1)) : './'
71
+ str = (dotdot[0...-1] + path).squeeze('/')
72
+ str = str[2..-1] if str[0..-1] == './'
73
+ str
74
+ else
75
+ path
76
+ end
71
77
  end
72
78
 
73
79
  # Method: content_for (Proton::Helpers)
@@ -141,7 +141,7 @@ class Project
141
141
  end
142
142
 
143
143
  # Ignore dotfiles and hyde.conf files by default
144
- specs += %w[.* _* *~ README* /config.ru]
144
+ specs += %w[.* _* *~ README* /config.ru Gemfile Gemfile.lock]
145
145
  specs += Proton::CONFIG_FILES.map { |s| "/#{s}" }
146
146
 
147
147
  specs.compact.map { |s| glob(s) }.flatten.uniq
@@ -1,5 +1,5 @@
1
1
  class Proton
2
- VERSION = "0.3.0.rc1"
2
+ VERSION = "0.3.2"
3
3
 
4
4
  # Attribute: version (Proton)
5
5
  # Returns the version.
@@ -1,4 +1,3 @@
1
-
2
1
  require File.expand_path('../../helper', __FILE__)
3
2
 
4
3
  class BuildOptionsTest < TestCase
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../helper', __FILE__)
2
+
3
+ class HelperTest < TestCase
4
+ include Proton::Helpers
5
+
6
+ test "rel" do
7
+ assert_equal 'index.html', rel('index.html', '/about/index.html')
8
+ assert_equal '../index.html', rel('/index.html', '/about/index.html')
9
+ assert_equal '../foo/index.html', rel('/foo/index.html', '/about/index.html')
10
+ assert_equal '../about/us.html', rel('/about/us.html', '/about/index.html')
11
+ end
12
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proton
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.3.0.rc1
4
+ prerelease:
5
+ version: 0.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rico Sta. Cruz
@@ -254,6 +254,7 @@ files:
254
254
  - test/unit/build_options_test.rb
255
255
  - test/unit/extensions_test.rb
256
256
  - test/unit/fixture_test.rb
257
+ - test/unit/helper_test.rb
257
258
  - test/unit/page_test.rb
258
259
  - test/unit/proton_test.rb
259
260
  - test/unit/set_test.rb
@@ -287,9 +288,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
287
288
  required_rubygems_version: !ruby/object:Gem::Requirement
288
289
  none: false
289
290
  requirements:
290
- - - ">"
291
+ - - ">="
291
292
  - !ruby/object:Gem::Version
292
- version: 1.3.1
293
+ version: "0"
293
294
  requirements: []
294
295
 
295
296
  rubyforge_project: