html_mockup 0.5.0 → 0.5.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/README.rdoc CHANGED
@@ -67,7 +67,7 @@ You can also call ./script/server just above the HTML directory.
67
67
 
68
68
  Options:
69
69
  --port:: The port the server should listen on. Defaults to 9000
70
- --partial_path:: the path where the partial files can be found (*.part.html), defaults to director/../partials
70
+ --partial_path:: the path where the partial files can be found (*.part.html), defaults to directory /../partials
71
71
  --validate:: Flag to set wether or not we should validate all html files (defaults to false)
72
72
 
73
73
  ==== mockup generate [directory]
@@ -8,7 +8,7 @@ module HtmlMockup
8
8
  end
9
9
 
10
10
  def call(env)
11
- r = Rack::Request.new(env)
11
+ r = ::Rack::Request.new(env)
12
12
  if r.params["sleep"]
13
13
  sleeptime = [r.params["sleep"].to_i, 5].min
14
14
  sleep sleeptime
@@ -0,0 +1,25 @@
1
+ # Extracts the actual mockup into a directory and makes URLs
2
+ # relative.
3
+ class Release::Extractor
4
+
5
+
6
+ # Resolves an url to a true file on disk:
7
+ #
8
+ # * it will add index.html if it's a directory
9
+ # * it will try to append .html or .htm if it's not a directory
10
+ def resolve_path(path)
11
+ path = Pathname.new(path) unless path.kind_of?(Pathname)
12
+ # Append index.html/index.htm/index.rhtml if it's a diretory
13
+ if path.directory?
14
+ search_files = %w{.html .htm}.map!{|p| path + "index#{p}" }
15
+ # If it ends with a slash or does not contain a . and it's not a directory
16
+ # try to add .html/.htm/.rhtml to see if that exists.
17
+ elsif (path.to_s =~ /\/$/) || (path.to_s =~ /^[^.]+$/)
18
+ search_files = [path.to_s + ".html", path.to_s + ".htm"].map!{|p| Pathname.new(p) }
19
+ else
20
+ search_files = [path]
21
+ end
22
+ search_files.find{|p| p.exist? }
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_mockup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-08 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70226277925520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: 0.16.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- version: 0.16.0
24
+ version_requirements: *70226277925520
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rack
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70226277924900 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,12 +32,7 @@ dependencies:
37
32
  version: 1.0.0
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 1.0.0
35
+ version_requirements: *70226277924900
46
36
  description:
47
37
  email: flurin@digitpaint.nl
48
38
  executables:
@@ -65,6 +55,7 @@ files:
65
55
  - lib/html_mockup/rack/html_validator.rb
66
56
  - lib/html_mockup/rack/sleep.rb
67
57
  - lib/html_mockup/release.rb
58
+ - lib/html_mockup/release/extractor.rb
68
59
  - lib/html_mockup/release/finalizers.rb
69
60
  - lib/html_mockup/release/finalizers/dir.rb
70
61
  - lib/html_mockup/release/finalizers/zip.rb
@@ -82,7 +73,8 @@ files:
82
73
  homepage: http://github.com/flurin/html_mockup
83
74
  licenses: []
84
75
  post_install_message:
85
- rdoc_options: []
76
+ rdoc_options:
77
+ - --charset=UTF-8
86
78
  require_paths:
87
79
  - lib
88
80
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -91,9 +83,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
83
  - - ! '>='
92
84
  - !ruby/object:Gem::Version
93
85
  version: '0'
94
- segments:
95
- - 0
96
- hash: -1984595046850543499
97
86
  required_rubygems_version: !ruby/object:Gem::Requirement
98
87
  none: false
99
88
  requirements:
@@ -102,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
91
  version: '0'
103
92
  requirements: []
104
93
  rubyforge_project:
105
- rubygems_version: 1.8.24
94
+ rubygems_version: 1.8.15
106
95
  signing_key:
107
96
  specification_version: 3
108
97
  summary: HTML Mockup is a set of tools to create self-containing HTML mockups.