Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 93af5a80ee5fda0739e461a4c578899e3699f489 0 parents
@jbritten jbritten authored
2  .gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*.log
12 CONFIG
@@ -0,0 +1,12 @@
+Configuration
+=============
+
+Sign up for a free account on http://www.prefinery.com and create a new web beta. Once you
+do this, you'll configure PrefineryBetaFu using the id of the beta you just created.
+
+You should have something like this in config/initializers/prefinery.rb.
+
+ Prefinery.configure do |config|
+ config.subdomain = 'compulsivo'
+ config.beta = '4'
+ end
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Compulsivo, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 README
@@ -0,0 +1,45 @@
+PrefineryBetaFu
+===============
+
+Prefinery (http://www.prefinery.com) helps you launch a private beta in minutes.
+Prefinery collects email addresses, generates invitation codes, and sends
+invitations for your web beta. Your customers never leave your site and
+e-mail invitations are sent from your address.
+
+PrefineryBetaFu gets Prefinery integrated into your Rails website in seconds.
+
+
+Installation
+============
+
+ script/plugin install git://github.com/compulsivo/prefinery-beta-fu.git
+
+
+Configuration
+=============
+
+Sign up for a free account on http://www.prefinery.com and create a new web beta. Once you
+do this, you'll configure PrefineryBetaFu using the id of the beta you just created.
+
+You should have something like this in config/initializers/prefinery.rb.
+
+ Prefinery.configure do |config|
+ config.subdomain = 'compulsivo'
+ config.beta = '4'
+ end
+
+
+Examples
+========
+
+To include Prefinery's invitation javascript on your site's signup page:
+
+<%= prefinery_invitation_javascript %>
+
+To place a link on your site's signup page which will launch the Prefinery invitation widget:
+
+<%= link_to_prefinery_invitation 'Sign up for the beta now!', '#' %>
+
+
+
+Copyright (c) 2009 Compulsivo, Inc. Released under the MIT license
4 init.rb
@@ -0,0 +1,4 @@
+require 'prefinery'
+require 'helpers/invitation_helper'
+require 'helpers/feedback_helper'
+ActionView::Base.send :include, Prefinery::ViewHelper
1  install.rb
@@ -0,0 +1 @@
+puts IO.read(File.join(File.dirname(__FILE__), 'CONFIG'))
25 lib/helpers/feedback_helper.rb
@@ -0,0 +1,25 @@
+module Prefinery
+ module ViewHelper
+ def prefinery_feedback_javascript
+ <<-HTML
+ <style type='text/css'>@import url('http://www.prefinery.com/stylesheets/widget.css');</style>
+ <script src='http://www.prefinery.com/javascripts/widget.js' type='text/javascript'></script>
+ <script type='text/javascript' charset='utf-8'>
+ Prefinery.feedback("#{Prefinery.url}/comments/new?display=popup");
+ </script>
+ HTML
+ end
+
+ def prefinery_embed_feedback_form
+ <<-HTML
+ <iframe id='prefinery_iframe_inline' allowTransparency='true' width='100%' height='600' scrolling='no' frameborder='0' src="#{Prefinery.url}/comments/new?display=inline"></iframe>
+ HTML
+ end
+
+ def link_to_prefinery_feedback(name, options = {}, html_options = {})
+ html_options.merge!({:id => 'prefinery_feedback_link'})
+ link_to name, options, html_options
+ end
+ end
+end
+
25 lib/helpers/invitation_helper.rb
@@ -0,0 +1,25 @@
+module Prefinery
+ module ViewHelper
+ def prefinery_invitation_javascript
+ <<-HTML
+ <style type='text/css'>@import url('http://www.prefinery.com/stylesheets/widget.css');</style>
+ <script src='http://www.prefinery.com/javascripts/widget.js' type='text/javascript'></script>
+ <script type='text/javascript' charset='utf-8'>
+ Prefinery.invite("#{Prefinery.url}/testers/new?display=popup");
+ </script>
+ HTML
+ end
+
+ def prefinery_embed_invitation_form
+ <<-HTML
+ <iframe id='prefinery_iframe_inline' allowTransparency='true' width='100%' height='600' scrolling='no' frameborder='0' src="#{Prefinery.url}/testers/new?display=inline"></iframe>
+ HTML
+ end
+
+ def link_to_prefinery_invitation(name, options = {}, html_options = {})
+ html_options.merge!({:id => 'prefinery_invite_link'})
+ link_to name, options, html_options
+ end
+ end
+end
+
45 lib/prefinery.rb
@@ -0,0 +1,45 @@
+require 'rubygems'
+
+module Prefinery
+
+ class << self
+ attr_accessor :subdomain, :host, :port, :secure, :beta
+
+ def subdomain
+ @subdomain
+ end
+
+ def port
+ @port || (secure ? 443 : 80)
+ end
+
+ def host
+ @host ||= "#{subdomain}.prefinery.com"
+ end
+
+ def beta
+ @beta
+ end
+
+ # Call this method to modify defaults in your initializers.
+ #
+ # Prefinery.configure do |config|
+ # config.subdomain = 'compulsivo'
+ # config.beta = '1'
+ # config.secure = false
+ # end
+ def configure
+ yield self
+ end
+
+ def protocol #:nodoc:
+ secure ? "https" : "http"
+ end
+
+ def url #:nodoc:
+ URI.parse("#{protocol}://#{host}:#{port}/betas/#{beta}")
+ end
+
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.