deckrb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.md +55 -20
  2. data/bin/deck +5 -10
  3. data/lib/deck.rb +1 -1
  4. data/lib/deck/noko.rb +15 -0
  5. data/lib/deck/rack_app.rb +61 -0
  6. data/lib/deck/slide.rb +50 -28
  7. data/lib/deck/{deck.rb → slide_deck.rb} +42 -41
  8. data/lib/deck/version.rb +1 -1
  9. data/spec/rack_app_spec.rb +177 -0
  10. data/spec/slide_deck_spec.rb +46 -0
  11. data/spec/slide_spec.rb +24 -21
  12. data/spec/spec_helper.rb +5 -0
  13. metadata +51 -81
  14. data/deck/GPL-license.txt +0 -278
  15. data/deck/MIT-license.txt +0 -21
  16. data/deck/README.md +0 -57
  17. data/deck/core/deck.core.css +0 -404
  18. data/deck/core/deck.core.html +0 -39
  19. data/deck/core/deck.core.js +0 -498
  20. data/deck/core/deck.core.scss +0 -447
  21. data/deck/extensions/goto/deck.goto.css +0 -41
  22. data/deck/extensions/goto/deck.goto.html +0 -7
  23. data/deck/extensions/goto/deck.goto.js +0 -134
  24. data/deck/extensions/goto/deck.goto.scss +0 -46
  25. data/deck/extensions/hash/deck.hash.css +0 -13
  26. data/deck/extensions/hash/deck.hash.html +0 -2
  27. data/deck/extensions/hash/deck.hash.js +0 -129
  28. data/deck/extensions/hash/deck.hash.scss +0 -15
  29. data/deck/extensions/menu/deck.menu.css +0 -47
  30. data/deck/extensions/menu/deck.menu.js +0 -187
  31. data/deck/extensions/menu/deck.menu.scss +0 -58
  32. data/deck/extensions/navigation/deck.navigation.css +0 -43
  33. data/deck/extensions/navigation/deck.navigation.html +0 -3
  34. data/deck/extensions/navigation/deck.navigation.js +0 -91
  35. data/deck/extensions/navigation/deck.navigation.scss +0 -56
  36. data/deck/extensions/scale/deck.scale.css +0 -16
  37. data/deck/extensions/scale/deck.scale.js +0 -155
  38. data/deck/extensions/scale/deck.scale.scss +0 -17
  39. data/deck/extensions/status/deck.status.css +0 -18
  40. data/deck/extensions/status/deck.status.html +0 -6
  41. data/deck/extensions/status/deck.status.js +0 -95
  42. data/deck/extensions/status/deck.status.scss +0 -22
  43. data/deck/extensions/theme-picker/deck.theme-picker.css +0 -55
  44. data/deck/extensions/theme-picker/deck.theme-picker.js +0 -13
  45. data/deck/introduction/index.html +0 -221
  46. data/deck/introduction/index.rb +0 -101
  47. data/deck/jquery-1.7.min.js +0 -4
  48. data/deck/modernizr.custom.js +0 -4
  49. data/deck/test/fixtures/complex.html +0 -24
  50. data/deck/test/fixtures/empty.html +0 -19
  51. data/deck/test/fixtures/iframe_simple.html +0 -10
  52. data/deck/test/fixtures/iframes.html +0 -32
  53. data/deck/test/fixtures/nesteds.html +0 -36
  54. data/deck/test/fixtures/standard.html +0 -42
  55. data/deck/test/index.html +0 -39
  56. data/deck/test/lib/jasmine-html.js +0 -190
  57. data/deck/test/lib/jasmine-jquery.js +0 -288
  58. data/deck/test/lib/jasmine.css +0 -166
  59. data/deck/test/lib/jasmine.js +0 -2477
  60. data/deck/test/settings.js +0 -3
  61. data/deck/test/spec.core.js +0 -434
  62. data/deck/test/spec.goto.js +0 -119
  63. data/deck/test/spec.hash.js +0 -81
  64. data/deck/test/spec.menu.js +0 -66
  65. data/deck/test/spec.navigation.js +0 -51
  66. data/deck/test/spec.scale.js +0 -57
  67. data/deck/test/spec.status.js +0 -58
  68. data/deck/themes/style/neon.css +0 -114
  69. data/deck/themes/style/neon.scss +0 -139
  70. data/deck/themes/style/swiss.css +0 -75
  71. data/deck/themes/style/swiss.scss +0 -91
  72. data/deck/themes/style/web-2.0.css +0 -205
  73. data/deck/themes/style/web-2.0.scss +0 -236
  74. data/deck/themes/transition/fade.css +0 -44
  75. data/deck/themes/transition/fade.scss +0 -70
  76. data/deck/themes/transition/horizontal-slide.css +0 -79
  77. data/deck/themes/transition/horizontal-slide.scss +0 -94
  78. data/deck/themes/transition/vertical-slide.css +0 -97
  79. data/deck/themes/transition/vertical-slide.scss +0 -116
  80. data/lib/deck/app.rb +0 -16
  81. data/spec/deck_spec.rb +0 -98
@@ -1,16 +0,0 @@
1
- module Deck
2
- class App
3
- def initialize root, files
4
- @root, @files = root, files
5
- end
6
-
7
- def call env
8
- slides = []
9
- @files.each do |file|
10
- slides += Slide.from_file "#{@root}/#{file}"
11
- end
12
- deck = Deck.new :slides => slides
13
- [200, {}, deck.to_pretty]
14
- end
15
- end
16
- end
@@ -1,98 +0,0 @@
1
- here = File.expand_path File.dirname(__FILE__)
2
- require "#{here}/spec_helper"
3
-
4
- require "deck/deck"
5
-
6
- module Deck
7
- describe Deck do
8
- def temp_dir options = {:remove => true}
9
- @temp_dir ||= begin
10
- require 'tmpdir'
11
- require 'fileutils'
12
- called_from = File.basename caller.first.split(':').first, ".rb"
13
- path = File.join(Dir::tmpdir, "#{called_from}_#{Time.now.to_i}_#{rand(1000)}")
14
- Dir.mkdir(path)
15
- at_exit {FileUtils.rm_rf(path) if File.exists?(path)} if options[:remove]
16
- path
17
- end
18
- end
19
-
20
- def to_html nokogiri_node
21
- nokogiri_node.serialize(:save_with => 0).chomp
22
- end
23
-
24
- def as_html_page snippet
25
- snippet =~ /<html/ ? snippet : "<html>#{snippet}</html>"
26
- end
27
-
28
- def deck_widget options = {}
29
- @deck_widget ||= Deck.new options
30
- end
31
-
32
- def doc
33
- @doc ||= begin
34
- @html = deck_widget.to_html
35
- Nokogiri.parse(as_html_page(@html))
36
- end
37
- end
38
-
39
- def write name, contents = "contents of #{name}"
40
- path = "#{temp_dir}/#{name}"
41
- File.open(path, "w") do |f|
42
- f.write contents
43
- end
44
- File.new path
45
- end
46
-
47
- describe "#write" do
48
- before do
49
- @hello = write "hello.txt"
50
- @goodbye = write "goodbye.txt", "farewell"
51
- end
52
-
53
- it "uses temp_dir" do
54
- File.dirname(@hello).should == temp_dir
55
- File.dirname(@goodbye).should == temp_dir
56
- end
57
-
58
- it "writes a default value" do
59
- File.read(@hello).should == "contents of hello.txt"
60
- end
61
-
62
- it "writes a given value" do
63
- # since write returns a File instance, we can call read on it
64
- @goodbye.read.should == "farewell"
65
- end
66
-
67
- it "writes a file" do
68
- file = write("hello.md", "# hello")
69
- assert { File.read(file) == "# hello" }
70
- end
71
-
72
- end
73
-
74
-
75
- it "renders a basic deck.js HTML page" do
76
- assert { doc }
77
- assert { @html.include? '<link href="deck/core/deck.core.css" rel="stylesheet" />' }
78
- end
79
-
80
- it "contains a single dummy slide" do
81
- assert { doc.css('section.slide').size == 1 }
82
- end
83
-
84
- it "renders a markdown file with one slide" do
85
- file = write("hello.md", "# hello")
86
-
87
- deck_widget :slides => Slide.split(File.read file)
88
- assert { doc.css('section.slide').size == 1 }
89
- slide = doc.css('section.slide').first
90
- assert { slide["id"] == "hello" }
91
- assert { to_html(slide) == "<section class=\"slide\" id=\"hello\">" +
92
- "<h1>hello</h1>\n" +
93
- "</section>"
94
- }
95
- end
96
-
97
- end
98
- end