gitpartyguest 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -0
- data/.idea/.generators +8 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +8 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/sf_frontend_site.iml +66 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +890 -0
- data/Gemfile +41 -0
- data/Gemfile.lock +134 -0
- data/README.md +4 -0
- data/README.rdoc +261 -0
- data/Rakefile +7 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/application.js +15 -0
- data/app/assets/stylesheets/application.css +13 -0
- data/app/controllers/application_controller.rb +3 -0
- data/app/controllers/update_controller.rb +24 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/git_party_guest.rb +41 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/app/views/update/index.html.erb +2 -0
- data/app/views/update/show.html.erb +2 -0
- data/config.ru +4 -0
- data/config/application.rb +62 -0
- data/config/boot.rb +6 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +37 -0
- data/config/environments/production.rb +67 -0
- data/config/environments/test.rb +37 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/inflections.rb +15 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/repo_init.rb +11 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +61 -0
- data/db/seeds.rb +7 -0
- data/doc/README_FOR_APP +2 -0
- data/gitpartyguest/.gitignore +17 -0
- data/gitpartyguest/Gemfile +6 -0
- data/gitpartyguest/LICENSE +22 -0
- data/gitpartyguest/README.md +29 -0
- data/gitpartyguest/Rakefile +2 -0
- data/gitpartyguest/config/initalizers/repo_init.rb +11 -0
- data/gitpartyguest/config/routes.rb +3 -0
- data/gitpartyguest/gitpartyguest.gemspec +18 -0
- data/gitpartyguest/lib/gitpartyguest.rb +42 -0
- data/gitpartyguest/lib/gitpartyguest/version.rb +3 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/tasks/.gitkeep +0 -0
- data/log/.gitkeep +0 -0
- data/public/2012/07/11/1342023312-blah/index.html +61 -0
- data/public/2012/07/11/1342023388-post2/index.html +61 -0
- data/public/2012/07/11/1342023521-title_goes_here/index.html +61 -0
- data/public/2012/07/11/1342031212-title_goes_here/index.html +61 -0
- data/public/2012/07/11/1342031484-ok_now/index.html +61 -0
- data/public/401.html +26 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +25 -0
- data/public/Posts/index.html +150 -0
- data/public/Preview/index.html +158 -0
- data/public/README.md +4 -0
- data/public/css/preview_style.css +52 -0
- data/public/css/style.css +23 -0
- data/public/favicon.ico +0 -0
- data/public/home/index.html +34 -0
- data/public/index.html +28 -0
- data/public/media/SFbloghdrAS.png +0 -0
- data/public/media/banner.jpg +0 -0
- data/public/media/bikes.jpg +0 -0
- data/public/media/bridge.jpg +0 -0
- data/public/media/wing.jpg +0 -0
- data/public/robots.txt +5 -0
- data/script/rails +6 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/functional/.gitkeep +0 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/.gitkeep +0 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +147 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
SfFrontendSite::Application.config.secret_token = 'd8e3f026de3041922072a3fc6b84f65b05f3e6f7858d0e9973f2b4bf7588ab25153f7ae578911c4d3af53d77b972217b978d4637f3cf531cfd9925724f40311f'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
SfFrontendSite::Application.config.session_store :cookie_store, :key => '_sf_frontend_site_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# SfFrontendSite::Application.config.session_store :active_record_store
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters :format => [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
SfFrontendSite::Application.routes.draw do
|
2
|
+
resources :update
|
3
|
+
|
4
|
+
root :to => "posts#index"
|
5
|
+
# The priority is based upon order of creation:
|
6
|
+
# first created -> highest priority.
|
7
|
+
|
8
|
+
# Sample of regular route:
|
9
|
+
# match 'products/:id' => 'catalog#view'
|
10
|
+
# Keep in mind you can assign values other than :controller and :action
|
11
|
+
|
12
|
+
# Sample of named route:
|
13
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
14
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
15
|
+
|
16
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
17
|
+
# resources :products
|
18
|
+
|
19
|
+
# Sample resource route with options:
|
20
|
+
# resources :products do
|
21
|
+
# member do
|
22
|
+
# get 'short'
|
23
|
+
# post 'toggle'
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# collection do
|
27
|
+
# get 'sold'
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
|
31
|
+
# Sample resource route with sub-resources:
|
32
|
+
# resources :products do
|
33
|
+
# resources :comments, :sales
|
34
|
+
# resource :seller
|
35
|
+
# end
|
36
|
+
|
37
|
+
# Sample resource route with more complex sub-resources
|
38
|
+
# resources :products do
|
39
|
+
# resources :comments
|
40
|
+
# resources :sales do
|
41
|
+
# get 'recent', :on => :collection
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
|
45
|
+
# Sample resource route within a namespace:
|
46
|
+
# namespace :admin do
|
47
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
48
|
+
# # (app/controllers/admin/products_controller.rb)
|
49
|
+
# resources :products
|
50
|
+
# end
|
51
|
+
|
52
|
+
# You can have the root of your site routed with "root"
|
53
|
+
# just remember to delete public/index.html.
|
54
|
+
# root :to => 'welcome#index'
|
55
|
+
|
56
|
+
# See how all your routes lay out with "rake routes"
|
57
|
+
|
58
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
59
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
60
|
+
# match ':controller(/:action(/:id))(.:format)'
|
61
|
+
end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
+
# Mayor.create(:name => 'Emanuel', :city => cities.first)
|
data/doc/README_FOR_APP
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Sf-ApiUser
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Gitpartyguest
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'gitpartyguest'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install gitpartyguest
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#Synch Increment is a way to indicate how often a rollback point will be set in git.
|
2
|
+
#The default is minutes which means a new clone will be
|
3
|
+
#created if the previous synch was longer than one minute ago.
|
4
|
+
# the other increments are:
|
5
|
+
# 'second'
|
6
|
+
# 'minute'
|
7
|
+
# 'hour'
|
8
|
+
# 'day'
|
9
|
+
::SYNCHINC = 'minute'
|
10
|
+
|
11
|
+
::REPOSERVER = 'git@github.com:sfweb/SFBlogSite.git'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/gitpartyguest/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Sf-ApiUser"]
|
6
|
+
gem.email = ["Sf-ApiUser@sourcefire.com"]
|
7
|
+
gem.description = %q{This gem is used to synch with a branch in git and create a website }
|
8
|
+
gem.summary = %q{This gem synchs with a branch in git and creates a website in the public directory }
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
|
12
|
+
gem.files = `git ls-files`.split($\)
|
13
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
14
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
|
+
gem.name = "gitpartyguest"
|
16
|
+
gem.require_paths = ["lib","config"]
|
17
|
+
gem.version = Gitpartyguest::VERSION
|
18
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "gitpartyguest/version"
|
2
|
+
|
3
|
+
module Gitpartyguest
|
4
|
+
def self.refresh_site
|
5
|
+
dir_string = directory()
|
6
|
+
|
7
|
+
%x[cd #{Rails.root}/site/#{dir_string};git clone #{::REPOSERVER} ]
|
8
|
+
|
9
|
+
%x[cd #{Rails.root}/site/#{dir_string}/SFBlogSite;jekyll]
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.rollback
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.directory()
|
16
|
+
clones = Dir.glob("#{Rails.root}/site/*").sort
|
17
|
+
latest_directory = clones.first.split("/").last
|
18
|
+
directory_name = Time.now.to_i.to_s
|
19
|
+
|
20
|
+
#if the length of the latest directory is not as long as an epoch time(suggesting its a shorter file name) then just return the current time.
|
21
|
+
if latest_directory.to_i.to_s.length >= 10
|
22
|
+
case ::SYNCHINC
|
23
|
+
when 'second'
|
24
|
+
latest_directory < Time.now.to_i.to_s ? directory_name = Time.now.to_i.to_s : directory_name = latest_directory
|
25
|
+
when 'minute'
|
26
|
+
latest_directory + 1.minute < Time.now.to_i.to_s ? directory_name = Time.now.to_i.to_s : directory_name = latest_directory
|
27
|
+
when 'hour'
|
28
|
+
latest_directory + 1.hour < Time.now.to_i.to_s ? directory_name = Time.now.to_i.to_s : directory_name = latest_directory
|
29
|
+
when 'day'
|
30
|
+
latest_directory + 1.day < Time.now.to_i.to_s ? directory_name = Time.now.to_i.to_s : directory_name = latest_directory
|
31
|
+
else
|
32
|
+
directory_name = Time.now.to_i.to_s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
#if the directory doesn't exist then create it.
|
37
|
+
unless(File.directory?("#{Rails.root}/site/#{directory_name}"))
|
38
|
+
Dir.mkdir("#{Rails.root}/site/#{directory_name}")
|
39
|
+
end
|
40
|
+
return directory_name
|
41
|
+
end
|
42
|
+
end
|
data/lib/assets/.gitkeep
ADDED
File without changes
|
data/lib/tasks/.gitkeep
ADDED
File without changes
|
data/log/.gitkeep
ADDED
File without changes
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset=utf_8 />
|
5
|
+
<title> Blah | Sourcefire blog application </title>
|
6
|
+
<link rel="stylesheet" href="/css/preview_style.css" />
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<div id="user_nav" >
|
11
|
+
<ul class="dashboard">
|
12
|
+
<li><a href="/posts/new">New post</a></li>
|
13
|
+
<li><a href="/posts">View posts</a></li>
|
14
|
+
<li><a href="/Preview">View blog</a></li>
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
<div id="main">
|
18
|
+
|
19
|
+
<header>
|
20
|
+
<img alt="Sourcefire Corporate Blog" height="158px; " id="Header1_headerimg" src="/media/SFbloghdrAS.png" width="960px; "/>
|
21
|
+
</header>
|
22
|
+
|
23
|
+
|
24
|
+
<section class="content">
|
25
|
+
<br>
|
26
|
+
<h2>Blah</h2>
|
27
|
+
<p>Wednesday, July 11th, 2012</p>
|
28
|
+
<p>Posted by Nick Herbert</p>
|
29
|
+
</section>
|
30
|
+
|
31
|
+
|
32
|
+
<div id="blah">
|
33
|
+
<p>
|
34
|
+
DO thi. NOAhaf</p>
|
35
|
+
|
36
|
+
|
37
|
+
<br>
|
38
|
+
<br>
|
39
|
+
<a href="/posts"> Back </a>
|
40
|
+
<br>
|
41
|
+
<a href="/posts/2012-07-11-1342023312-blah"> Edit </a>
|
42
|
+
|
43
|
+
<br>
|
44
|
+
|
45
|
+
|
46
|
+
<p>Labels: comma separated labels</p>
|
47
|
+
|
48
|
+
<div style="clear:left;"> </div>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<div style="clear:right;"> </div>
|
54
|
+
<div id="footer">
|
55
|
+
|
56
|
+
<p>© SourceFire Inc. test blog app 2011 | all rights reserved. </p>
|
57
|
+
</div> <!-- end id="footer" -->
|
58
|
+
|
59
|
+
</div> <!-- end id="main" -->
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset=utf_8 />
|
5
|
+
<title> Post2 | Sourcefire blog application </title>
|
6
|
+
<link rel="stylesheet" href="/css/preview_style.css" />
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<div id="user_nav" >
|
11
|
+
<ul class="dashboard">
|
12
|
+
<li><a href="/posts/new">New post</a></li>
|
13
|
+
<li><a href="/posts">View posts</a></li>
|
14
|
+
<li><a href="/Preview">View blog</a></li>
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
<div id="main">
|
18
|
+
|
19
|
+
<header>
|
20
|
+
<img alt="Sourcefire Corporate Blog" height="158px; " id="Header1_headerimg" src="/media/SFbloghdrAS.png" width="960px; "/>
|
21
|
+
</header>
|
22
|
+
|
23
|
+
|
24
|
+
<section class="content">
|
25
|
+
<br>
|
26
|
+
<h2>Post2</h2>
|
27
|
+
<p>Wednesday, July 11th, 2012</p>
|
28
|
+
<p>Posted by Author goes here</p>
|
29
|
+
</section>
|
30
|
+
|
31
|
+
|
32
|
+
<div id="blah">
|
33
|
+
<p>
|
34
|
+
Post only this</p>
|
35
|
+
|
36
|
+
|
37
|
+
<br>
|
38
|
+
<br>
|
39
|
+
<a href="/posts"> Back </a>
|
40
|
+
<br>
|
41
|
+
<a href="/posts/2012-07-11-1342023388-post2"> Edit </a>
|
42
|
+
|
43
|
+
<br>
|
44
|
+
|
45
|
+
|
46
|
+
<p>Labels: comma separated labels</p>
|
47
|
+
|
48
|
+
<div style="clear:left;"> </div>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<div style="clear:right;"> </div>
|
54
|
+
<div id="footer">
|
55
|
+
|
56
|
+
<p>© SourceFire Inc. test blog app 2011 | all rights reserved. </p>
|
57
|
+
</div> <!-- end id="footer" -->
|
58
|
+
|
59
|
+
</div> <!-- end id="main" -->
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset=utf_8 />
|
5
|
+
<title> Title goes here | Sourcefire blog application </title>
|
6
|
+
<link rel="stylesheet" href="/css/preview_style.css" />
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<div id="user_nav" >
|
11
|
+
<ul class="dashboard">
|
12
|
+
<li><a href="/posts/new">New post</a></li>
|
13
|
+
<li><a href="/posts">View posts</a></li>
|
14
|
+
<li><a href="/Preview">View blog</a></li>
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
<div id="main">
|
18
|
+
|
19
|
+
<header>
|
20
|
+
<img alt="Sourcefire Corporate Blog" height="158px; " id="Header1_headerimg" src="/media/SFbloghdrAS.png" width="960px; "/>
|
21
|
+
</header>
|
22
|
+
|
23
|
+
|
24
|
+
<section class="content">
|
25
|
+
<br>
|
26
|
+
<h2>Title goes here</h2>
|
27
|
+
<p>Wednesday, July 11th, 2012</p>
|
28
|
+
<p>Posted by Author goes here</p>
|
29
|
+
</section>
|
30
|
+
|
31
|
+
|
32
|
+
<div id="blah">
|
33
|
+
<p>
|
34
|
+
asgd</p>
|
35
|
+
|
36
|
+
|
37
|
+
<br>
|
38
|
+
<br>
|
39
|
+
<a href="/posts"> Back </a>
|
40
|
+
<br>
|
41
|
+
<a href="/posts/2012-07-11-1342023521-title_goes_here"> Edit </a>
|
42
|
+
|
43
|
+
<br>
|
44
|
+
|
45
|
+
|
46
|
+
<p>Labels: comma separated labels</p>
|
47
|
+
|
48
|
+
<div style="clear:left;"> </div>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<div style="clear:right;"> </div>
|
54
|
+
<div id="footer">
|
55
|
+
|
56
|
+
<p>© SourceFire Inc. test blog app 2011 | all rights reserved. </p>
|
57
|
+
</div> <!-- end id="footer" -->
|
58
|
+
|
59
|
+
</div> <!-- end id="main" -->
|
60
|
+
</body>
|
61
|
+
</html>
|