beta_invite 0.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f2320c033dd61e0ec769f423c47e518fd0be67f
4
+ data.tar.gz: 43818b860099c953f659778defec316bbb0b2e89
5
+ SHA512:
6
+ metadata.gz: f5b4033de03a494e7627ace5cf59133b32e6f15fde87f5721c490d726808b56ed5a073a4521570bb2a8de6d41396fb08f191939f8b8367cccb6f36ab622149c0
7
+ data.tar.gz: d7e596984d034d432ad81d661bfb78b32a71e5bb108ab981d0dc2b5b7996e8e30351e82de0fb32edd45c0d9cadeda2f8a8ba416530b768b42d42e906f333af19
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ #BetaInvite
2
+
3
+ A simple gem to help you build your __beta_invite__ page up and running in no time
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'BetaInvite'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ module BetaInvite
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,24 @@
1
+ require_dependency "beta_invite/application_controller"
2
+
3
+ module BetaInvite
4
+ class BetaInvitesController < ApplicationController
5
+
6
+ def new
7
+ @beta_invite = BetaInvite.new
8
+ end
9
+
10
+ def create
11
+ email = params[:beta_invite][:email]
12
+ beta_invite = BetaInvite.new
13
+ beta_invite.email = email
14
+ beta_invite.token = SecureRandom.hex(10) #generate a random hex token for all the users
15
+ if beta_invite.save
16
+ flash[:success] = "#{email} has been registered for beta invite"
17
+ redirect_to beta_invites_path
18
+ else
19
+ flash[:alert] = beta_invite.errors.full_messages
20
+ render :new
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,4 @@
1
+ module BetaInvite
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module BetaInvite
2
+ module BetaInvitesHelper
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module BetaInvite
2
+ class BetaInvite < ActiveRecord::Base
3
+ attr_accessible :email, :token
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ <h1>You are in index of beta_invites</h1>
@@ -0,0 +1,6 @@
1
+ <h1>You are in new of beta_invites</h1>
2
+ <%= form_for @beta_invite do |f| %>
3
+ <%= f.label :email, 'Email'%>
4
+ <%= f.text_field :email, placeholder: "Enter your email" %>
5
+ <%= f.submit%>
6
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>BetaInvite</title>
5
+ <%= stylesheet_link_tag "beta_invite/application", :media => "all" %>
6
+ <%= javascript_include_tag "beta_invite/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ BetaInvite::Engine.routes.draw do
2
+ resources :beta_invites
3
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBetaInviteBetaInvites < ActiveRecord::Migration
2
+ def change
3
+ create_table :beta_invite_beta_invites do |t|
4
+ t.string :email
5
+ t.string :token
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module BetaInvite
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace BetaInvite
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module BetaInvite
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ require "beta_invite/engine"
2
+
3
+ module BetaInvite
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :beta_invite do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BetaInviteTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, BetaInvite
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ email: MyString
5
+ token: MyString
6
+
7
+ two:
8
+ email: MyString
9
+ token: MyString
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module BetaInvite
4
+ class BetaInvitesControllerTest < ActionController::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module BetaInvite
4
+ class BetaInviteTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module BetaInvite
4
+ class BetaInvitesHelperTest < ActionView::TestCase
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: beta_invite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kaushik Thirthappa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.13
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.13
27
+ description: Setup beta invite system with ease
28
+ email:
29
+ - thirthappa.kaushik@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - app/assets/javascripts/beta_invite/application.js
35
+ - app/assets/javascripts/beta_invite/beta_invites.js
36
+ - app/assets/stylesheets/beta_invite/application.css
37
+ - app/assets/stylesheets/beta_invite/beta_invites.css
38
+ - app/controllers/beta_invite/application_controller.rb
39
+ - app/controllers/beta_invite/beta_invites_controller.rb
40
+ - app/helpers/beta_invite/application_helper.rb
41
+ - app/helpers/beta_invite/beta_invites_helper.rb
42
+ - app/models/beta_invite/beta_invite.rb
43
+ - app/views/beta_invite/beta_invites/index.html.erb
44
+ - app/views/beta_invite/beta_invites/new.html.erb
45
+ - app/views/layouts/beta_invite/application.html.erb
46
+ - config/routes.rb
47
+ - db/migrate/20130507120318_create_beta_invite_beta_invites.rb
48
+ - lib/beta_invite/engine.rb
49
+ - lib/beta_invite/version.rb
50
+ - lib/beta_invite.rb
51
+ - lib/tasks/beta_invite_tasks.rake
52
+ - MIT-LICENSE
53
+ - Rakefile
54
+ - README.md
55
+ - test/beta_invite_test.rb
56
+ - test/fixtures/beta_invite/beta_invites.yml
57
+ - test/functional/beta_invite/beta_invites_controller_test.rb
58
+ - test/integration/navigation_test.rb
59
+ - test/test_helper.rb
60
+ - test/unit/beta_invite/beta_invite_test.rb
61
+ - test/unit/helpers/beta_invite/beta_invites_helper_test.rb
62
+ homepage: https://github.com/ktkaushik/beta_invite
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.1.4
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Setup beta invite system with ease
86
+ test_files:
87
+ - test/beta_invite_test.rb
88
+ - test/fixtures/beta_invite/beta_invites.yml
89
+ - test/functional/beta_invite/beta_invites_controller_test.rb
90
+ - test/integration/navigation_test.rb
91
+ - test/test_helper.rb
92
+ - test/unit/beta_invite/beta_invite_test.rb
93
+ - test/unit/helpers/beta_invite/beta_invites_helper_test.rb