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 +23 -4
- data/README.md +1 -1
- data/data/rack/Gemfile +1 -1
- data/data/rack/Gemfile.lock +2 -2
- data/data/rack/config.ru +8 -6
- data/lib/proton/config.rb +1 -1
- data/lib/proton/helpers.rb +10 -4
- data/lib/proton/project.rb +1 -1
- data/lib/proton/version.rb +1 -1
- data/test/unit/build_options_test.rb +0 -1
- data/test/unit/helper_test.rb +12 -0
- metadata +5 -4
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
|
-
|
7
|
-
|
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
|
11
|
-
and
|
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
data/data/rack/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
gem "proton", "0.3.
|
1
|
+
gem "proton", "~> 0.3.2"
|
2
2
|
gem "rack-cache", "~> 1.0.0"
|
data/data/rack/Gemfile.lock
CHANGED
@@ -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.
|
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 (
|
39
|
+
proton (~> 0.3.2)
|
40
40
|
rack-cache (~> 1.0.0)
|
data/data/rack/config.ru
CHANGED
@@ -8,14 +8,16 @@ begin
|
|
8
8
|
require 'bundler'
|
9
9
|
Bundler.setup
|
10
10
|
rescue LoadError
|
11
|
-
gem 'proton', '0.3.
|
11
|
+
gem 'proton', '0.3.2'
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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.
|
data/lib/proton/config.rb
CHANGED
@@ -72,7 +72,7 @@ class Config
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def requirement
|
75
|
-
# Backward compatibility
|
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
|
data/lib/proton/helpers.rb
CHANGED
@@ -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
|
-
|
69
|
-
|
70
|
-
|
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)
|
data/lib/proton/project.rb
CHANGED
@@ -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
|
data/lib/proton/version.rb
CHANGED
@@ -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:
|
5
|
-
version: 0.3.
|
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:
|
293
|
+
version: "0"
|
293
294
|
requirements: []
|
294
295
|
|
295
296
|
rubyforge_project:
|