highcarb 0.2 → 0.2.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/Gemfile.lock +15 -15
- data/lib/highcarb/generator.rb +4 -0
- data/lib/highcarb/rack_app.rb +5 -0
- data/lib/highcarb/version.rb +1 -1
- data/lib/highcarb/views_controller.rb +8 -3
- data/resources/views/index.haml +1 -1
- data/resources/views/remote.haml +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
highcarb (0.
|
4
|
+
highcarb (0.2)
|
5
5
|
coffee-script
|
6
6
|
em-websocket
|
7
7
|
haml
|
@@ -15,30 +15,30 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: http://rubygems.org/
|
17
17
|
specs:
|
18
|
-
addressable (2.2
|
18
|
+
addressable (2.3.2)
|
19
19
|
coffee-script (2.2.0)
|
20
20
|
coffee-script-source
|
21
21
|
execjs
|
22
|
-
coffee-script-source (1.
|
23
|
-
daemons (1.1.
|
24
|
-
em-websocket (0.3.
|
22
|
+
coffee-script-source (1.3.3)
|
23
|
+
daemons (1.1.9)
|
24
|
+
em-websocket (0.3.8)
|
25
25
|
addressable (>= 2.1.1)
|
26
26
|
eventmachine (>= 0.12.9)
|
27
|
-
eventmachine (0.
|
28
|
-
execjs (1.
|
27
|
+
eventmachine (1.0.0)
|
28
|
+
execjs (1.4.0)
|
29
29
|
multi_json (~> 1.0)
|
30
|
-
haml (3.1.
|
31
|
-
kramdown (0.
|
32
|
-
mime-types (1.
|
33
|
-
multi_json (1.
|
34
|
-
nokogiri (1.5.
|
30
|
+
haml (3.1.7)
|
31
|
+
kramdown (0.14.0)
|
32
|
+
mime-types (1.19)
|
33
|
+
multi_json (1.3.6)
|
34
|
+
nokogiri (1.5.5)
|
35
35
|
rack (1.4.1)
|
36
|
-
sass (3.1
|
37
|
-
thin (1.
|
36
|
+
sass (3.2.1)
|
37
|
+
thin (1.5.0)
|
38
38
|
daemons (>= 1.0.9)
|
39
39
|
eventmachine (>= 0.12.6)
|
40
40
|
rack (>= 1.0.0)
|
41
|
-
trollop (
|
41
|
+
trollop (2.0)
|
42
42
|
|
43
43
|
PLATFORMS
|
44
44
|
ruby
|
data/lib/highcarb/generator.rb
CHANGED
data/lib/highcarb/rack_app.rb
CHANGED
@@ -3,6 +3,7 @@ require "mime/types"
|
|
3
3
|
require "pathname"
|
4
4
|
require "haml"
|
5
5
|
require "kramdown"
|
6
|
+
require "yaml"
|
6
7
|
|
7
8
|
require "highcarb/assets_controller"
|
8
9
|
require "highcarb/slides_controller"
|
@@ -19,11 +20,15 @@ module HighCarb
|
|
19
20
|
attr_reader :command
|
20
21
|
attr_reader :root
|
21
22
|
attr_reader :assets_root
|
23
|
+
attr_reader :config
|
22
24
|
|
23
25
|
def initialize(command)
|
24
26
|
@command = command
|
25
27
|
@root = Pathname.new(command.args.first)
|
26
28
|
@assets_root = @root.join("./assets")
|
29
|
+
|
30
|
+
config_path = @root.join("config.yml")
|
31
|
+
@config = config_path.exist? ? YAML.load(config_path.read) : {}
|
27
32
|
end
|
28
33
|
|
29
34
|
def plain_response!(status, content)
|
data/lib/highcarb/version.rb
CHANGED
@@ -8,8 +8,9 @@ module HighCarb
|
|
8
8
|
DefaultViewsPath = Pathname.new(File.expand_path("../../../resources/views/", __FILE__))
|
9
9
|
|
10
10
|
class ViewContext
|
11
|
-
attr_reader :options, :root
|
12
|
-
def initialize(options, root)
|
11
|
+
attr_reader :app, :options, :root
|
12
|
+
def initialize(app, options, root)
|
13
|
+
@app = app
|
13
14
|
@options = options
|
14
15
|
@root = root
|
15
16
|
end
|
@@ -17,6 +18,10 @@ module HighCarb
|
|
17
18
|
def load_coffe(source)
|
18
19
|
"<script>//<![CDATA[\n" + CoffeeScript.compile(root.join(source + ".coffee").read) + "\n//]]></script>"
|
19
20
|
end
|
21
|
+
|
22
|
+
def jquery_path
|
23
|
+
Dir.chdir(root) { Dir["assets/vendor/deck.js/jquery-*.js"].first }
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
27
|
def render_view(view_name)
|
@@ -29,7 +34,7 @@ module HighCarb
|
|
29
34
|
not_found! view_name + " view"
|
30
35
|
end
|
31
36
|
|
32
|
-
output = Haml::Engine.new(view_path.read).render(ViewContext.new(command.options, view_path.dirname))
|
37
|
+
output = Haml::Engine.new(view_path.read).render(ViewContext.new(self, command.options, view_path.dirname))
|
33
38
|
|
34
39
|
throw :response, [200, {'Content-Type' => 'text/html'}, output]
|
35
40
|
end
|
data/resources/views/index.haml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
%body.presenter.deck-container
|
7
7
|
.slides Loading...
|
8
8
|
|
9
|
-
%script{ src: "
|
9
|
+
%script{ src: app.config["jquery"] }
|
10
10
|
%script{ src: "/assets/vendor/deck.js/modernizr.custom.js" }
|
11
11
|
%script{ src: "/assets/vendor/deck.js/core/deck.core.js" }
|
12
12
|
%script{ src: "/assets/vendor/deck.js/extensions/menu/deck.menu.js" }
|
data/resources/views/remote.haml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: highcarb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thin
|