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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- highcarb (0.1)
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.7)
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.2.0)
23
- daemons (1.1.8)
24
- em-websocket (0.3.6)
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.12.10)
28
- execjs (1.3.0)
27
+ eventmachine (1.0.0)
28
+ execjs (1.4.0)
29
29
  multi_json (~> 1.0)
30
- haml (3.1.4)
31
- kramdown (0.13.5)
32
- mime-types (1.17.2)
33
- multi_json (1.1.0)
34
- nokogiri (1.5.0)
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.15)
37
- thin (1.3.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 (1.16.2)
41
+ trollop (2.0)
42
42
 
43
43
  PLATFORMS
44
44
  ruby
@@ -66,6 +66,10 @@ module HighCarb
66
66
  vendor_path.children.first.rename vendor_path.join("deck.js")
67
67
  end
68
68
  end
69
+
70
+ create_file path.join("config.yml"), {
71
+ "jquery" => Dir.chdir(path) { "/#{Dir["assets/**/jquery*.js"].first}" }
72
+ }.to_yaml
69
73
  end
70
74
 
71
75
  # Helpers
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module HighCarb
2
- Version = "0.2"
2
+ Version = "0.2.1"
3
3
  end
@@ -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
@@ -6,7 +6,7 @@
6
6
  %body.presenter.deck-container
7
7
  .slides Loading...
8
8
 
9
- %script{ src: "/assets/vendor/deck.js/jquery-1.7.min.js" }
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" }
@@ -2,7 +2,7 @@
2
2
  %html
3
3
  %head
4
4
  %title Remote control
5
- %script{ src: "/assets/vendor/deck.js/jquery-1.7.min.js" }
5
+ %script{ src: app.config["jquery"] }
6
6
  %script{ src: "/assets/custom.coffee" }
7
7
  %script{ src: "/assets/custom-remote.coffee" }
8
8
 
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: '0.2'
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-07-20 00:00:00.000000000 Z
12
+ date: 2012-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thin