six-updater-web 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six-updater-web/app/controllers/main_controller.rb +4 -0
  3. data/lib/six-updater-web/app/views/main/_wave.haml +3 -0
  4. data/lib/six-updater-web/app/views/main/index.haml +1 -0
  5. data/lib/six-updater-web/app/views/main/wave.haml +2 -0
  6. data/lib/six-updater-web/config/six-updater-web.rb +1 -1
  7. data/lib/six-updater-web/init.rb +1 -1
  8. data/lib/six-updater-web/vendor/plugins/rave_embed/README +107 -0
  9. data/lib/six-updater-web/vendor/plugins/rave_embed/Rakefile +11 -0
  10. data/lib/six-updater-web/vendor/plugins/rave_embed/init.rb +1 -0
  11. data/lib/six-updater-web/vendor/plugins/rave_embed/install.rb +1 -0
  12. data/lib/six-updater-web/vendor/plugins/rave_embed/lib/autotest/discover.rb +5 -0
  13. data/lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed.rb +3 -0
  14. data/lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/cattr_inheritable.rb +25 -0
  15. data/lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/js_include.rb +18 -0
  16. data/lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb +101 -0
  17. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/custom_font_default_color.html +7 -0
  18. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/fully_configured.html +9 -0
  19. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/hello_world.html +6 -0
  20. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/hello_world_jquery.html +8 -0
  21. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/global_config_spec.rb +26 -0
  22. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/js_include_spec.rb +32 -0
  23. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/spec.opts +4 -0
  24. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/spec_helper.rb +13 -0
  25. data/lib/six-updater-web/vendor/plugins/rave_embed/spec/wave_panel_spec.rb +197 -0
  26. data/lib/six-updater-web/vendor/plugins/rave_embed/tasks/rave_embed_tasks.rake +4 -0
  27. data/lib/six-updater-web/vendor/plugins/rave_embed/uninstall.rb +1 -0
  28. metadata +25 -3
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'six-updater-web'
10
- s.version = '0.17.3'
10
+ s.version = '0.17.4'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -394,6 +394,10 @@ class MainController < ApplicationController
394
394
 
395
395
  end
396
396
 
397
+ def wave
398
+ @waveid = "w+Qkgr-pVcG"
399
+ end
400
+
397
401
  private
398
402
  def act
399
403
  @preset = if @system_setting.favorite_preset
@@ -0,0 +1,3 @@
1
+ = link_to "View in Wave", "https://wave.google.com/wave/waveref/googlewave.com/#{@waveid}"
2
+ %br
3
+ = RaveEmbed::WavePanel.new(@waveid, :height => "768px").to_html
@@ -4,6 +4,7 @@
4
4
  %table{ :border => 1, :width => "100%"}
5
5
  %tr
6
6
  %td
7
+ = link_to "Follow with Google Wave", "/main/wave"
7
8
  - form_tag :action => :index do
8
9
  %p
9
10
  %label{ :for => "sixconfigs" }
@@ -0,0 +1,2 @@
1
+ %script{:src => "http://www.google.com/jsapi"}
2
+ = render :partial => "main/wave"
@@ -22,7 +22,7 @@ case RUBY_VERSION
22
22
  end
23
23
 
24
24
  module SixUpdaterWeb
25
- VERSION = "0.17.3"
25
+ VERSION = "0.17.4"
26
26
  COMPONENT = "six-updater-web"
27
27
 
28
28
  DEFAULT_IP = "127.0.0.1" unless defined?(DEFAULT_IP)
@@ -6,7 +6,7 @@ module SixUpdaterWeb
6
6
  DEFAULT_PORT = 16333
7
7
  DEFAULT_IP = '127.0.0.1'
8
8
 
9
- OPEN_BROWSER = true
9
+ OPEN_BROWSER = true # unless ENV.include?("NO_BROWSER")
10
10
 
11
11
  # Process commandline args to setup host and port
12
12
  argvs = ARGV.join(" ")
@@ -0,0 +1,107 @@
1
+ RaveEmbed
2
+ =========
3
+
4
+ What is RaveEmbed?
5
+ ------------------
6
+
7
+ RaveEmbed is a Ruby on Rails plugin that allows you to use Ruby to embed a Google Wave onto any page in your app. It allows you to configure your Google Wave settings using a simple Ruby method and it will generate the properly formatted Google Wave Embed API javascript automatically.
8
+
9
+ RaveEmbed is federation agnostic, meaning it's been designed to work with any Wave provider. But since Google is currently the ONLY Wave provider, we provide sensible default settings that will work with Google.
10
+
11
+ The bottom line is: with just a couple lines of code, you can add some of the most robust, feature rich communication and collaboration tools ever invented to your app.
12
+
13
+
14
+ What is Google Wave?
15
+ --------------------
16
+
17
+ Google Wave is a product that helps users communicate and collaborate on the web. A "wave" is equal parts conversation and document, where users can almost instantly communicate and work together with richly formatted text, photos, videos, maps, and more. Google Wave is also a platform with a rich set of open APIs that allow developers to embed waves in other web services and to build extensions that work inside waves.
18
+
19
+ Start by viewing the Google I/O presentation given by the creators of this revolutionary communication tool.
20
+ http://www.youtube.com/watch?v=v_UyVmITiYQ
21
+
22
+ To sign up for a Google Wave account, go to:
23
+ http://wave.google.com/
24
+
25
+ If you want to dig deeper into the Google Wave API, go to:
26
+ http://code.google.com/apis/wave/
27
+
28
+
29
+ Dependencies
30
+ ============
31
+
32
+ Currently, this plugin relies on the jQuery javascript framework. Only one line in the entire plugin requires it, so a dependency-free version of this plugin may be on the way.
33
+
34
+ Installation
35
+ ============
36
+
37
+ 1) First, install jQuery. Copy the javascript files from the jQuery website (http://docs.jquery.com/Downloading_jQuery) into your public/javascripts/ folder.
38
+
39
+ 2) From your app root directory, type "script/plugin install git://github.com/wink/rave_embed.git"
40
+
41
+ 3) In your layout template, add this line to the <head> section:
42
+ <%= RaveEmbed::JsInclude.to_html %>
43
+
44
+ Example
45
+ =======
46
+
47
+ Hello World!
48
+ ------------
49
+
50
+ The simplest way to embed an existing Wave into a view:
51
+
52
+ <%= RaveEmbed::WavePanel.new('my_wave_id').to_html %>
53
+ <div id='waveframe'></div>
54
+
55
+ Be sure to replace 'my_wave_id' with the actual id of the Wave you want to embed.
56
+
57
+
58
+ Display Options
59
+ ---------------
60
+
61
+ RaveEmbed works with Google Wave by default, but can be configured to work with any Wave provider (a.k.a. federation). RaveEmbed also allows you to customize the look and feel of the Wave to match your page. The plugin supports the following options:
62
+
63
+ :function_name This is the name of the javascript function that draws the Wave on the page.
64
+ Default: 'wavePanelInit'
65
+ :dom_id This is id of the empty div container to be replaced with the Wave panel.
66
+ Default: 'waveframe'
67
+ :root_url This is the Wave server instance url. It currently points to the Google Wave servers,
68
+ but could be configured to point to any Wave provider (e.g. corporate intranets).
69
+ Default: 'https://wave.google.com/a/wavesandbox.com/'
70
+ :bg_color Customize the background color with a hex code string. (e.g. '#333333', '#999', 'green')
71
+ Default: nil (uses whatever Google chooses as it's default)
72
+ :color Customize the text color with a hex code string. (e.g. '#333333', '#999', 'green')
73
+ Default: nil (uses whatever Google chooses as it's default)
74
+ :font Customize the text font with a font string. (e.g. 'Arial')
75
+ Default: nil (uses whatever Google chooses as it's default)
76
+ :font_size Customize the text font with a font size string. (e.g. '10px', '12pt', '20pt')
77
+ Default: nil (uses whatever Google chooses as it's default)
78
+
79
+ Fully configured example
80
+ ------------------------
81
+
82
+ module WavePanelHelper
83
+ def wave_panel(wave_id)
84
+ wave_panel = RaveEmbed::WavePanel.new(wave_id,
85
+ :function_name => 'wavePanelStart',
86
+ :dom_id => 'wave_container',
87
+ :root_url => 'https://wave.mycompany.com/',
88
+ :bg_color => 'green',
89
+ :color => '#FFFFFF',
90
+ :font => 'Arial',
91
+ :font_size => '12pt')
92
+ wave_panel.to_html
93
+ end
94
+ end
95
+
96
+ # And in your view:
97
+
98
+ <%= wave_panel('my_wave_id') %>
99
+ <div id="wave_container" style="width: 500px; height: 100%"></div>
100
+
101
+
102
+ Global Defaults
103
+ ===============
104
+
105
+ You can change the global default configuration for your whole app by adding an initializer file into
106
+
107
+ Copyright (c) 2009 Micah Winkelspecht, released under the MIT license
@@ -0,0 +1,11 @@
1
+ require 'rake'
2
+ require 'spec/rake/spectask'
3
+
4
+ desc 'Default: run specs.'
5
+ task :default => :spec
6
+
7
+ desc 'Run the specs'
8
+ Spec::Rake::SpecTask.new(:spec) do |t|
9
+ t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
10
+ t.spec_files = FileList['spec/**/*_spec.rb']
11
+ end
@@ -0,0 +1 @@
1
+ # Include hook code here
@@ -0,0 +1 @@
1
+ # Install hook code here
@@ -0,0 +1,5 @@
1
+ $:.push(File.join(File.dirname(__FILE__), %w[.. .. rspec]))
2
+
3
+ Autotest.add_discovery do
4
+ "rspec"
5
+ end
@@ -0,0 +1,3 @@
1
+ require 'rave_embed/cattr_inheritable'
2
+
3
+ module RaveEmbed; end
@@ -0,0 +1,25 @@
1
+ module ClassLevelInheritableAttributes
2
+ def self.included(base)
3
+ base.extend(ClassMethods)
4
+ end
5
+
6
+ module ClassMethods
7
+ def cattr_inheritable(*args)
8
+ @cattr_inheritable_attrs ||= [:cattr_inheritable_attrs]
9
+ @cattr_inheritable_attrs += args
10
+ args.each do |arg|
11
+ class_eval %(
12
+ class << self; attr_accessor :#{arg} end
13
+ )
14
+ end
15
+ @cattr_inheritable_attrs
16
+ end
17
+
18
+ def inherited(subclass)
19
+ @cattr_inheritable_attrs.each do |inheritable_attribute|
20
+ instance_var = "@#{inheritable_attribute}"
21
+ subclass.instance_variable_set(instance_var, instance_variable_get(instance_var))
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ module RaveEmbed
2
+ class JsInclude
3
+ include ClassLevelInheritableAttributes
4
+
5
+ cattr_inheritable :embed_js_url
6
+ @embed_js_url = 'http://wave-api.appspot.com/public/embed.js'
7
+
8
+ attr_accessor :embed_js_url
9
+
10
+ def initialize(opts = {})
11
+ @embed_js_url = opts[:embed_js_url] || JsInclude.embed_js_url
12
+ end
13
+
14
+ def to_html
15
+ "<script src='#{embed_js_url}' type='text/javascript'></script>"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,101 @@
1
+ module RaveEmbed
2
+ class RaveEmbed::WavePanelError < Exception; end
3
+
4
+ class WavePanel
5
+ include ClassLevelInheritableAttributes
6
+
7
+ cattr_inheritable :g_public_address, :g_root_url, :g_dom_id, :g_bg_color, :g_color, :g_font,
8
+ :g_font_size, :g_is_public, :g_embed_js_url, :g_height, :g_width, :g_jquery
9
+ @g_public_address = 'public@a.gwave.com'
10
+ @g_root_url = 'https://wave.google.com/wave/'
11
+ @g_dom_id = 'waveframe'
12
+ @g_is_public = true
13
+ @g_height = '100%'
14
+ @g_width = '100%'
15
+ @g_jquery = false
16
+
17
+
18
+ attr_accessor :wave_id, :dom_id, :root_url, :bg_color, :color, :font, :font_size,
19
+ :participants, :is_public, :height, :width, :jquery
20
+
21
+ def initialize(wave_id_str, opts = {})
22
+ @wave_id = wave_id_str
23
+ @dom_id = opts[:dom_id] || WavePanel.g_dom_id
24
+ @root_url = opts[:root_url] || WavePanel.g_root_url
25
+ @bg_color = opts[:bg_color] || WavePanel.g_bg_color
26
+ @color = opts[:color] || WavePanel.g_color
27
+ @font = opts[:font] || WavePanel.g_font
28
+ @font_size = opts[:font_size] || WavePanel.g_font_size
29
+ @height = opts[:height] || WavePanel.g_height
30
+ @width = opts[:width] || WavePanel.g_width
31
+ @jquery = opts[:jquery] || WavePanel.g_jquery
32
+ @is_public = if opts[:is_public].nil?
33
+ WavePanel.g_is_public
34
+ else
35
+ opts[:is_public] ? true : false
36
+ end
37
+ @participants = opts[:participants] || []
38
+ validate
39
+ end
40
+
41
+ def wave_id=(wave_id_str)
42
+ @wave_id = wave_id_str
43
+ validate
44
+ end
45
+
46
+ def participants
47
+ @participants << WavePanel.g_public_address if is_public?
48
+ @participants
49
+ end
50
+
51
+ def to_html
52
+ html = "<div id='#{dom_id}'"
53
+ unless width.blank? and height.blank?
54
+ styles = []
55
+ styles << "width:#{width}" unless width.blank?
56
+ styles << "height:#{height}" unless height.blank?
57
+ html << " style='#{styles.join(";")}'"
58
+ end
59
+ html << "></div>\n"
60
+ html << "<script type='text/javascript'>\ngoogle.load(\"wave\", \"1\"); google.setOnLoadCallback(function() { new google.wave.WavePanel({target: document.getElementById(\"#{dom_id}\")}).loadWave(\"googlewave.com!#{wave_id}\");}); </script>\n"
61
+ #html << "<script type='text/javascript'>\n"
62
+ #html << "$(document).ready({\n" if jquery?
63
+ #html << " var wavePanel = new WavePanel('#{root_url}');\n"
64
+ #html << " wavePanel.loadWave('#{wave_id}');\n"
65
+ #html << ui_options_js if ui_configured?
66
+ #html << " wavePanel.init(document.getElementById('#{dom_id}'));\n"
67
+ #html << "})\n" if jquery?
68
+ #html << "</script>\n"
69
+ end
70
+
71
+ private
72
+
73
+ def validate
74
+ raise WavePanelError, "Wave ID required to initialize Wave Panel" if wave_id.nil? or wave_id.empty?
75
+ end
76
+
77
+ def ui_configured?
78
+ bg_color or color or font or font_size
79
+ end
80
+
81
+ def is_public?
82
+ is_public ? true : false
83
+ end
84
+
85
+ def jquery?
86
+ jquery ? true : false
87
+ end
88
+
89
+ def ui_options_js
90
+ if ui_configured?
91
+ ui_options = [bg_color, color, font, font_size]
92
+ ui_options = ui_options.collect { |o| "'#{o}'" }
93
+ ui_options_js = " wavePanel.setUIConfig(#{ ui_options.join(', ') });\n"
94
+ else
95
+ nil
96
+ end
97
+ end
98
+
99
+ end
100
+
101
+ end
@@ -0,0 +1,7 @@
1
+ <div id='waveframe' style='width:100%;height:100%'></div>
2
+ <script type='text/javascript'>
3
+ var wavePanel = new WavePanel('https://wave.google.com/wave/');
4
+ wavePanel.loadWave('my_id');
5
+ wavePanel.setUIConfig('', '', 'Arial', '12pt');
6
+ wavePanel.init(document.getElementById('waveframe'));
7
+ </script>
@@ -0,0 +1,9 @@
1
+ <div id='give_me_a_dom_id' style='width:800px;height:90%'></div>
2
+ <script type='text/javascript'>
3
+ $(document).ready({
4
+ var wavePanel = new WavePanel('http://mywave.acme.com');
5
+ wavePanel.loadWave('my_id');
6
+ wavePanel.setUIConfig('green', 'white', 'Arial', '12pt');
7
+ wavePanel.init(document.getElementById('give_me_a_dom_id'));
8
+ })
9
+ </script>
@@ -0,0 +1,6 @@
1
+ <div id='waveframe' style='width:100%;height:100%'></div>
2
+ <script type='text/javascript'>
3
+ var wavePanel = new WavePanel('https://wave.google.com/wave/');
4
+ wavePanel.loadWave('my_id');
5
+ wavePanel.init(document.getElementById('waveframe'));
6
+ </script>
@@ -0,0 +1,8 @@
1
+ <div id='waveframe' style='width:100%;height:100%'></div>
2
+ <script type='text/javascript'>
3
+ $(document).ready({
4
+ var wavePanel = new WavePanel('https://wave.google.com/wave/');
5
+ wavePanel.loadWave('my_id');
6
+ wavePanel.init(document.getElementById('waveframe'));
7
+ })
8
+ </script>
@@ -0,0 +1,26 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe RaveEmbed::WavePanel do
4
+ describe "with custom site wide configuration" do
5
+
6
+ before do
7
+ class_instance = RaveEmbed::WavePanel
8
+
9
+ class_instance.g_root_url = "http://mywave.acme.com"
10
+ class_instance.g_dom_id = 'give_me_a_dom_id'
11
+ class_instance.g_bg_color = 'green'
12
+ class_instance.g_color = 'white'
13
+ class_instance.g_font = 'Arial'
14
+ class_instance.g_font_size = '12pt'
15
+ class_instance.g_is_public = true
16
+ class_instance.g_width = '800px'
17
+ class_instance.g_height = '90%'
18
+ class_instance.g_jquery = true
19
+ @wave_panel = class_instance.new('my_id')
20
+ end
21
+
22
+ it "produces an html/javascript tag with all site-wide configs" do
23
+ @wave_panel.to_html.should == load_fixture('fully_configured.html')
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe RaveEmbed::JsInclude do
4
+ before do
5
+ RaveEmbed::JsInclude.embed_js_url = 'http://wave-api.appspot.com/public/embed.js'
6
+ end
7
+
8
+ describe "constructor:" do
9
+ before do
10
+ @js_include = RaveEmbed::JsInclude.new(:embed_js_url => 'http://wave.federation.com/public/embed.js')
11
+ end
12
+
13
+ it "has an attribute called 'embed_js_url'" do
14
+ @js_include.embed_js_url.should == 'http://wave.federation.com/public/embed.js'
15
+ end
16
+ end
17
+
18
+ describe "defaults:" do
19
+ it "'embed_js_url' defaults to RaveEmbed configured embed url" do
20
+ @js_include = RaveEmbed::JsInclude.new
21
+ @js_include.embed_js_url.should == 'http://wave-api.appspot.com/public/embed.js'
22
+ end
23
+ end
24
+
25
+ describe "#to_html" do
26
+ before { @js_include = RaveEmbed::JsInclude.new }
27
+
28
+ it "outputs javascript include tag into html string" do
29
+ @js_include.to_html.should == "<script src='http://wave-api.appspot.com/public/embed.js' type='text/javascript'></script>"
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format progress
3
+ --loadby mtime
4
+ --reverse
@@ -0,0 +1,13 @@
1
+ begin
2
+ require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
3
+ rescue LoadError
4
+ puts "You need to install rspec in your base app"
5
+ exit
6
+ end
7
+
8
+ plugin_spec_dir = File.dirname(__FILE__)
9
+ ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")
10
+
11
+ def load_fixture(filename)
12
+ File.read(File.dirname(__FILE__) + '/fixtures/' + filename)
13
+ end
@@ -0,0 +1,197 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe RaveEmbed::WavePanel do
4
+
5
+ describe "constructor:" do
6
+ describe "with_config" do
7
+ before do
8
+ @wave_panel = RaveEmbed::WavePanel.new('my_wave_id',
9
+ :dom_id => 'give_me_a_dom_id',
10
+ :root_url => 'http://mywave.acme.com',
11
+ :bg_color => 'green',
12
+ :color => 'white',
13
+ :font => 'Arial',
14
+ :font_size => '12pt',
15
+ :participants => ['greg@waveexample.com', 'bob@waveexample.com'],
16
+ :is_public => false,
17
+ :width => '800px',
18
+ :height => '90%',
19
+ :jquery => true)
20
+ end
21
+
22
+ it "has an attribute called 'id'" do
23
+ @wave_panel.wave_id.should == 'my_wave_id'
24
+ end
25
+
26
+ it "has an attribute called 'dom_id'" do
27
+ @wave_panel.dom_id.should == 'give_me_a_dom_id'
28
+ end
29
+
30
+ it "has an attribute called 'root_url'" do
31
+ @wave_panel.root_url.should == 'http://mywave.acme.com'
32
+ end
33
+
34
+ it "has an attribute called 'bg_color'" do
35
+ @wave_panel.bg_color.should == 'green'
36
+ end
37
+
38
+ it "has an attribute called 'color'" do
39
+ @wave_panel.color.should == 'white'
40
+ end
41
+
42
+ it "has an attribute called 'font'" do
43
+ @wave_panel.font.should == 'Arial'
44
+ end
45
+
46
+ it "has an attribute called 'font_size'" do
47
+ @wave_panel.font_size.should == '12pt'
48
+ end
49
+
50
+ it "has an attribute called 'participants'" do
51
+ @wave_panel.participants.should == ['greg@waveexample.com', 'bob@waveexample.com']
52
+ end
53
+
54
+ it "has an attribute called 'is_public'" do
55
+ @wave_panel.is_public.should == false
56
+ end
57
+
58
+ it "has an attribute called 'width'" do
59
+ @wave_panel.width.should == '800px'
60
+ end
61
+
62
+ it "has an attribute called 'height'" do
63
+ @wave_panel.height.should == '90%'
64
+ end
65
+
66
+ it "has an attribute called 'jquery'" do
67
+ @wave_panel.jquery.should == true
68
+ end
69
+ end
70
+
71
+ describe "when id is blank" do
72
+ it "raises an error with empty string" do
73
+ lambda { RaveEmbed::WavePanel.new('') }.should raise_error
74
+ @wave_panel = RaveEmbed::WavePanel.new('my_id')
75
+ lambda { @wave_panel.wave_id = '' }.should raise_error
76
+ end
77
+
78
+ it "raises an error with nil" do
79
+ lambda { RaveEmbed::WavePanel.new }.should raise_error
80
+ lambda { RaveEmbed::WavePanel.new(nil) }.should raise_error
81
+
82
+ @wave_panel = RaveEmbed::WavePanel.new('my_id')
83
+ lambda { @wave_panel.wave_id = nil }.should raise_error
84
+ end
85
+ end
86
+
87
+ describe "defaults:" do
88
+ before do
89
+ @wave_panel = RaveEmbed::WavePanel.new('my_wave_id')
90
+ end
91
+
92
+ it "'dom_id' defaults to the global RaveEmbed dom id" do
93
+ @wave_panel.dom_id.should == 'waveframe'
94
+ end
95
+
96
+ it "'root_url' defaults to the global RaveEmbed root url" do
97
+ @wave_panel.root_url.should == "https://wave.google.com/wave/"
98
+ end
99
+
100
+ %w(bg_color color font font_size).each do |attr|
101
+ it "'#{attr}' defaults to the global RaveEmbed #{attr} value" do
102
+ @wave_panel.send(attr).should == nil
103
+ end
104
+ end
105
+
106
+ it "'participants' default to nobody if the wave is private" do
107
+ @wave_panel.is_public = false
108
+ @wave_panel.participants.should == []
109
+ end
110
+
111
+ it "'participants' default to only the public address if the wave is public" do
112
+ @wave_panel.is_public = true
113
+ @wave_panel.participants.should == ["public@a.gwave.com"]
114
+ end
115
+
116
+ it "'is_public' defaults to the global RaveEmbed is_public value" do
117
+ @wave_panel.is_public.should == true
118
+ end
119
+
120
+ it "'width' defaults to the global RaveEmbed width value" do
121
+ @wave_panel.width.should == '100%'
122
+ end
123
+
124
+ it "'height' defaults to the global RaveEmbed height value" do
125
+ @wave_panel.height.should == '100%'
126
+ end
127
+
128
+ it "'jquery' defaults to the global RaveEmbed jquery value" do
129
+ @wave_panel.jquery.should == false
130
+ end
131
+ end
132
+ end
133
+
134
+ describe "when public:" do
135
+ before do
136
+ @wave_panel = RaveEmbed::WavePanel.new('my_id', :participants => ['bob@waveexample.com', 'sue@waveexample.com'])
137
+ end
138
+
139
+ it "participants include the public address" do
140
+ @wave_panel.participants.should include("public@a.gwave.com")
141
+ end
142
+ end
143
+
144
+ describe "#to_html" do
145
+ describe "with no configuration:" do
146
+ before do
147
+ @wave_panel = RaveEmbed::WavePanel.new('my_id')
148
+ end
149
+
150
+ it "produces an html/javascript tag that can be embedded into a page" do
151
+ @wave_panel.to_html.should == load_fixture('hello_world.html')
152
+ end
153
+ end
154
+
155
+ describe "with jquery:" do
156
+ before do
157
+ @wave_panel = RaveEmbed::WavePanel.new('my_id', :jquery => true)
158
+ end
159
+
160
+ it "produces html/javascript tag using jquery for loading after dom has loaded" do
161
+ @wave_panel.to_html.should == load_fixture('hello_world_jquery.html')
162
+ end
163
+ end
164
+
165
+ describe "with full configuration:" do
166
+ before do
167
+ @wave_panel = RaveEmbed::WavePanel.new('my_id',
168
+ :dom_id => 'give_me_a_dom_id',
169
+ :root_url => 'http://mywave.acme.com',
170
+ :bg_color => 'green',
171
+ :color => 'white',
172
+ :font => 'Arial',
173
+ :font_size => '12pt',
174
+ :width => '800px',
175
+ :height => '90%',
176
+ :jquery => true)
177
+ end
178
+
179
+ it "produces a fully configured wave html/javascript tag that can be embedded into a page" do
180
+ @wave_panel.to_html.should == load_fixture('fully_configured.html')
181
+ end
182
+ end
183
+
184
+ describe "with custom font and default colors:" do
185
+ before do
186
+ @wave_panel = RaveEmbed::WavePanel.new('my_id', :font => 'Arial', :font_size => '12pt')
187
+ end
188
+
189
+ it "produces a customized font wave html/javascript tag that can be embedded into a page" do
190
+ @wave_panel.to_html.should == load_fixture('custom_font_default_color.html')
191
+ end
192
+ end
193
+
194
+ end
195
+
196
+ end
197
+
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :rave_embed do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 17
8
- - 3
9
- version: 0.17.3
8
+ - 4
9
+ version: 0.17.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-16 00:00:00 +02:00
17
+ date: 2010-06-19 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -181,8 +181,10 @@ files:
181
181
  - lib/six-updater-web/app/views/main/reset_act.haml
182
182
  - lib/six-updater-web/app/views/main/test.rjs
183
183
  - lib/six-updater-web/app/views/main/userconfig.haml
184
+ - lib/six-updater-web/app/views/main/wave.haml
184
185
  - lib/six-updater-web/app/views/main/_check.haml
185
186
  - lib/six-updater-web/app/views/main/_test.haml
187
+ - lib/six-updater-web/app/views/main/_wave.haml
186
188
  - lib/six-updater-web/app/views/mods/imp.haml
187
189
  - lib/six-updater-web/app/views/Repositories/imp.erb
188
190
  - lib/six-updater-web/app/views/servers/imp.erb
@@ -807,6 +809,26 @@ files:
807
809
  - lib/six-updater-web/vendor/plugins/in_place_editing/README
808
810
  - lib/six-updater-web/vendor/plugins/in_place_editing/test/in_place_editing_test.rb
809
811
  - lib/six-updater-web/vendor/plugins/in_place_editing/test/test_helper.rb
812
+ - lib/six-updater-web/vendor/plugins/rave_embed/init.rb
813
+ - lib/six-updater-web/vendor/plugins/rave_embed/install.rb
814
+ - lib/six-updater-web/vendor/plugins/rave_embed/lib/autotest/discover.rb
815
+ - lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/cattr_inheritable.rb
816
+ - lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/js_include.rb
817
+ - lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb
818
+ - lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed.rb
819
+ - lib/six-updater-web/vendor/plugins/rave_embed/Rakefile
820
+ - lib/six-updater-web/vendor/plugins/rave_embed/README
821
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/custom_font_default_color.html
822
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/fully_configured.html
823
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/hello_world.html
824
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/fixtures/hello_world_jquery.html
825
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/global_config_spec.rb
826
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/js_include_spec.rb
827
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/spec.opts
828
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/spec_helper.rb
829
+ - lib/six-updater-web/vendor/plugins/rave_embed/spec/wave_panel_spec.rb
830
+ - lib/six-updater-web/vendor/plugins/rave_embed/tasks/rave_embed_tasks.rake
831
+ - lib/six-updater-web/vendor/plugins/rave_embed/uninstall.rb
810
832
  - lib/six-updater-web/vendor/plugins/recordselect/app/helpers/record_select_helper.rb
811
833
  - lib/six-updater-web/vendor/plugins/recordselect/app/views/record_select/browse.js.rjs
812
834
  - lib/six-updater-web/vendor/plugins/recordselect/app/views/record_select/_browse.html.erb