Skip to content

Extract tweet engine #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
source 'https://rubygems.org'

def require_false_unless(gem_name, condition)
if condition
gem gem_name
else
gem gem_name, :require => false
end
gem gem_name
end

gem 'rails', '~> 3.2.0'

# image uploads
Expand All @@ -13,12 +22,10 @@ gem 'haml-rails'
gem 'jquery-rails'
# pagination
gem 'kaminari'
# diagnostics
gem 'newrelic_rpm'
# web server
gem 'thin'
# twitter api
gem 'twitter'
# tweet_engine
gem 'tweet_engine', path: 'tweet_engine'
# cron jobs
gem 'whenever', require: false

Expand All @@ -36,14 +43,9 @@ group :assets do
end

group :production do
def require_false_unless(gem_name, condition)
if condition
gem gem_name
else
gem gem_name, :require => false
end
gem gem_name
end
# diagnostics
require_false_unless('newrelic_rpm', !!ENV['NEW_RELIC_APP_NAME'])
# gem 'newrelic_rpm', require: false
# memcached
require_false_unless('memcachier', !!ENV['MEMCACHIER_USERNAME'])
gem 'dalli'
Expand Down
17 changes: 12 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
PATH
remote: tweet_engine
specs:
tweet_engine (0.0.1)
rails (~> 3.2.13)
twitter

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -43,7 +50,7 @@ GEM
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
chronic (0.6.7)
chunky_png (1.2.6)
chunky_png (1.2.8)
cloudinary (1.0.56)
aws_cf_signer
rest-client
Expand Down Expand Up @@ -101,7 +108,7 @@ GEM
foreman (0.60.2)
thor (>= 0.13.6)
formatador (0.2.3)
fssm (0.2.9)
fssm (0.2.10)
gherkin (2.11.5)
json (>= 1.4.6)
growl (1.0.3)
Expand Down Expand Up @@ -208,7 +215,7 @@ GEM
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
ruby-hmac (0.4.0)
sass (3.2.1)
sass (3.2.10)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
Expand All @@ -226,7 +233,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
subexec (0.2.3)
susy (1.0.3)
susy (1.0.9)
compass (>= 0.12.2)
sass (>= 3.2.0)
thin (1.5.0)
Expand Down Expand Up @@ -299,7 +306,7 @@ DEPENDENCIES
susy
thin
timecop
twitter
tweet_engine!
uglifier (>= 1.0.3)
vcr
webmock
Expand Down
7 changes: 7 additions & 0 deletions tweet_engine/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
17 changes: 17 additions & 0 deletions tweet_engine/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source "http://rubygems.org"

# Declare your gem's dependencies in tweet_engine.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# jquery-rails is used by the dummy application
gem "jquery-rails"

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use debugger
# gem 'debugger'
20 changes: 20 additions & 0 deletions tweet_engine/MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2013 YOURNAME

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.
3 changes: 3 additions & 0 deletions tweet_engine/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= TweetEngine

This project rocks and uses MIT-LICENSE.
40 changes: 40 additions & 0 deletions tweet_engine/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'TweetEngine'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'



Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task :default => :test
Empty file.
15 changes: 15 additions & 0 deletions tweet_engine/app/assets/javascripts/tweet_engine/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
13 changes: 13 additions & 0 deletions tweet_engine/app/assets/stylesheets/tweet_engine/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module TweetEngine
class ApplicationController < ActionController::Base
end
end
4 changes: 4 additions & 0 deletions tweet_engine/app/helpers/tweet_engine/application_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module TweetEngine
module ApplicationHelper
end
end
14 changes: 14 additions & 0 deletions tweet_engine/app/views/layouts/tweet_engine/application.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>TweetEngine</title>
<%= stylesheet_link_tag "tweet_engine/application", :media => "all" %>
<%= javascript_include_tag "tweet_engine/application" %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>
2 changes: 2 additions & 0 deletions tweet_engine/config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TweetEngine::Engine.routes.draw do
end
4 changes: 4 additions & 0 deletions tweet_engine/lib/tasks/tweet_engine_tasks.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# desc "Explaining what the task does"
# task :tweet_engine do
# # Task goes here
# end
5 changes: 5 additions & 0 deletions tweet_engine/lib/tweet_engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "tweet_engine/engine"

module TweetEngine
end
require 'tweet_engine/twitter_search'
5 changes: 5 additions & 0 deletions tweet_engine/lib/tweet_engine/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TweetEngine
class Engine < ::Rails::Engine
isolate_namespace TweetEngine
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tweet_engine/lib/tweet_engine/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module TweetEngine
VERSION = "0.0.1"
end
8 changes: 8 additions & 0 deletions tweet_engine/script/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/tweet_engine/engine', __FILE__)

require 'rails/all'
require 'rails/engine/commands'
Loading