take_off 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 545c25ff35fac0e365ef9a94fb41a370c698283b
4
+ data.tar.gz: 470cbc3a2c667817ea2672296ff6c9805406c463
5
+ SHA512:
6
+ metadata.gz: 92ebf9a90514694ad52f7f70b19653c1e7abfda4b21ff3339bcf9a425872b39b0dca024b4c13833989f3b0efd7b9aa57b89488945f6aabc0787c030a055605af
7
+ data.tar.gz: ea19cc264b6520429237aeb3aa8ec52bf927f7bcc18430e1c50f35117e98d5e943da167d2b5f5dc34e37580ccec605dcddcf89293b26352947b8fc9cae39c1a6
@@ -0,0 +1,24 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'TakeOff'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+ load 'rails/tasks/statistics.rake'
20
+
21
+
22
+
23
+ Bundler::GemHelper.install_tasks
24
+
@@ -0,0 +1,13 @@
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 any plugin's vendor/assets/javascripts directory 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
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module TakeOff
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,20 @@
1
+ module TakeOff
2
+ class PagesController < ApplicationController
3
+ def show
4
+ if exist?
5
+ render file: path, layout: 'application'
6
+ else
7
+ raise ActionController::RoutingError.new 'Not Found'
8
+ end
9
+ end
10
+
11
+ private
12
+ def exist?
13
+ Dir.glob(Rails.root.join('app/views', path + '*' )).present?
14
+ end
15
+
16
+ def path
17
+ "pages/#{params[:path] || 'index'}"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ module TakeOff
2
+ module ApplicationHelper
3
+ def validate_release_date! date
4
+ unless release_date? date
5
+ raise ActionController::RoutingError.new 'not found'
6
+ end
7
+ end
8
+
9
+ def release_date? date
10
+ Time.zone.parse(date) <= Time.current
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ module TakeOff
2
+ class Mailer < ActionMailer::Base
3
+ layout 'mailer'
4
+
5
+ def post_mail headers
6
+ mail headers
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ module TakeOff
2
+ class Mail < ActiveRecord::Base
3
+ validates :from, presence: true
4
+ validates :subject, presence: true
5
+ validates :template, presence: true
6
+
7
+ def send_to to
8
+ Mailer.post_mail from: from,
9
+ bcc: bcc,
10
+ subject: subject,
11
+ template_path: 'mailer',
12
+ template_name: template,
13
+ to: to
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ TakeOff::Engine.routes.draw do
2
+ mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
3
+ match '*path' => 'pages#show', via: :get
4
+ root 'pages#show'
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateTakeOffMails < ActiveRecord::Migration
2
+ def change
3
+ create_table :take_off_mails do |t|
4
+ t.string :from, null: false
5
+ t.string :bcc
6
+ t.string :subject, null: false
7
+ t.string :template, null: false
8
+
9
+ t.timestamps null: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ require 'rails/generators'
2
+
3
+ module TakeOff
4
+ class InstallGenerator < Rails::Generators::Base
5
+ source_root File.expand_path('../templates', __FILE__)
6
+
7
+ desc ''
8
+ def install
9
+ route "mount TakeOff::Engine => '/', as: 'take_off'"
10
+
11
+ copy_file 'mailer.text.erb', 'app/views/layouts/mailer.text.erb'
12
+ copy_file 'mailer.html.erb', 'app/views/layouts/mailer.html.erb'
13
+ create_file 'app/views/mailer/.keep'
14
+ create_file 'app/views/pages/.keep'
15
+ rake 'take_off:install:migrations'
16
+ copy_file 'rails_admin.rb', 'config/initializers/rails_admin.rb'
17
+ copy_file 'take_off.rb', 'config/initializers/take_off.rb'
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ <html>
2
+ <body>
3
+ <%= yield %>
4
+ </body>
5
+ </html>
@@ -0,0 +1,34 @@
1
+ RailsAdmin.config do |config|
2
+
3
+ ### Popular gems integration
4
+
5
+ ## == Devise ==
6
+ # config.authenticate_with do
7
+ # warden.authenticate! scope: :user
8
+ # end
9
+ # config.current_user_method(&:current_user)
10
+
11
+ ## == Cancan ==
12
+ # config.authorize_with :cancan
13
+
14
+ ## == PaperTrail ==
15
+ # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
16
+
17
+ ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
18
+
19
+ config.actions do
20
+ dashboard # mandatory
21
+ index # mandatory
22
+ new
23
+ export
24
+ bulk_delete
25
+ show
26
+ edit
27
+ delete
28
+ show_in_app
29
+
30
+ ## With an audit adapter, you can add:
31
+ # history_index
32
+ # history_show
33
+ end
34
+ end
@@ -0,0 +1,11 @@
1
+ if ENV['SENDGRID_USERNAME']
2
+ ActionMailer::Base.smtp_settings = {
3
+ address: 'smtp.sendgrid.net',
4
+ port: '587',
5
+ authentication: :plain,
6
+ user_name: ENV['SENDGRID_USERNAME'],
7
+ password: ENV['SENDGRID_PASSWORD'],
8
+ domain: 'heroku.com',
9
+ enable_starttls_auto: true
10
+ }
11
+ end
@@ -0,0 +1,2 @@
1
+ require 'take_off/engine'
2
+ require 'rails_admin'
@@ -0,0 +1,5 @@
1
+ module TakeOff
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace TakeOff
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module TakeOff
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: take_off
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - sinsoku
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-22 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: 4.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails_admin
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.6.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: sqlite3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: TakeOff is a rails engine for creating landing page quickly.
56
+ email:
57
+ - sinsoku.listy@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - Rakefile
63
+ - app/assets/javascripts/take_off/application.js
64
+ - app/assets/stylesheets/take_off/application.css
65
+ - app/controllers/take_off/application_controller.rb
66
+ - app/controllers/take_off/pages_controller.rb
67
+ - app/helpers/take_off/application_helper.rb
68
+ - app/mailers/take_off/mailer.rb
69
+ - app/models/take_off/mail.rb
70
+ - config/routes.rb
71
+ - db/migrate/20150422000000_create_take_off_mails.rb
72
+ - lib/generators/take_off/install_generator.rb
73
+ - lib/generators/take_off/templates/mailer.html.erb
74
+ - lib/generators/take_off/templates/mailer.text.erb
75
+ - lib/generators/take_off/templates/rails_admin.rb
76
+ - lib/generators/take_off/templates/take_off.rb
77
+ - lib/take_off.rb
78
+ - lib/take_off/engine.rb
79
+ - lib/take_off/version.rb
80
+ homepage: https://github.com/sinsoku/take_off
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.4.5
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: TakeOff is a rails engine for creating landing page quickly.
104
+ test_files: []