hyper 0.4.1 → 0.4.2

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.
@@ -4,6 +4,9 @@ module Hyper
4
4
  class Generator
5
5
  include Term::ANSIColor
6
6
 
7
+ # Path to template directory
8
+ TEMPLATE_PATH = File.expand_path(File.dirname(__FILE__) + '/../../template').freeze
9
+
7
10
  def initialize(name, options = {})
8
11
  @name = name
9
12
  @options = options
@@ -30,14 +33,9 @@ module Hyper
30
33
 
31
34
  # Returns a glob of paths for files and folders in Hyper's template directory.
32
35
  def template_contents
33
- Dir[File.join(template_path, '*')]
36
+ Dir[File.join(TEMPLATE_PATH, '*')]
34
37
  end
35
-
36
- # Returns the path to Hyper's template directory.
37
- def template_path
38
- File.expand_path(File.dirname(__FILE__) + '/template')
39
- end
40
-
38
+
41
39
  # Returns a path to use for creating a new file inside the destination directory.
42
40
  def destination_path(path)
43
41
  File.join(destination_folder, common_component_path(path))
@@ -57,7 +55,7 @@ module Hyper
57
55
  #
58
56
  # Used to build destination paths.
59
57
  def common_component_path(path)
60
- path.sub(template_path, '')
58
+ path.sub(TEMPLATE_PATH, '')
61
59
  end
62
60
 
63
61
  # Returns an easy to understand string representing and installation path.
@@ -2,7 +2,7 @@ module Hyper
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Wilding
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-05 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-11-09 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rack
@@ -90,17 +89,11 @@ files:
90
89
  - lib/hyper/application.rb
91
90
  - lib/hyper/generator.rb
92
91
  - lib/hyper/static.rb
93
- - lib/hyper/template/config.ru
94
- - lib/hyper/template/Gemfile
95
- - lib/hyper/template/lib/helper.rb
96
- - lib/hyper/template/templates/layout.html.erb
97
- - lib/hyper/template/templates/views/index.html.erb
98
92
  - lib/hyper/utils.rb
99
93
  - lib/hyper/version.rb
100
94
  - lib/hyper.rb
101
95
  - README.md
102
96
  - bin/hyper
103
- has_rdoc: true
104
97
  homepage: http://github.com/jameswilding/hyper
105
98
  licenses: []
106
99
 
@@ -130,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
123
  requirements: []
131
124
 
132
125
  rubyforge_project:
133
- rubygems_version: 1.6.2
126
+ rubygems_version: 1.8.11
134
127
  signing_key:
135
128
  specification_version: 3
136
129
  summary: Zero-config framework for static websites
@@ -1 +0,0 @@
1
- gem 'hyper'
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'rack'
4
- require 'hyper'
5
-
6
- builder = Rack::Builder.new do
7
- # Add middleware here
8
- run Hyper
9
- end
10
-
11
- run builder.to_app
@@ -1,3 +0,0 @@
1
- module Hyper::Helper
2
- # methods added here will be available in your templates
3
- end
@@ -1,9 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <title>Hyper Site</title>
5
- </head>
6
- <body>
7
- <%= yield %>
8
- </body>
9
- </html>
@@ -1 +0,0 @@
1
- <p>Find me in <%= __FILE__ -%></p>