Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Revert "Merge pull request #34 from sfc-rg/demmys/emoji"
Browse files Browse the repository at this point in the history
This reverts commit f312afc, reversing
changes made to 1ce3724.
  • Loading branch information
miyukki committed Sep 19, 2015
1 parent 6819b56 commit 21ebf05
Show file tree
Hide file tree
Showing 31 changed files with 17 additions and 180 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@

/config/oauth.yml
bundle/
public/images/emoji
vendor/assets/bower_components
1 change: 0 additions & 1 deletion Bowerfile

This file was deleted.

3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'turbolinks'
gem 'bower-rails'
gem 'gon'

gem 'jquery-rails'
gem 'bourbon'
Expand All @@ -28,7 +26,6 @@ gem 'jbuilder', '~> 2.2.12'
gem 'yajl-ruby', '~> 1.2.1'
gem 'github-markdown', '~> 0.6.8'
gem 'redcarpet', '~> 3.3.1'
gem 'gemoji'

gem 'omniauth', '~> 1.2.2'
gem 'omniauth-slack', '~> 2.0.0'
Expand Down
14 changes: 0 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ GEM
bourbon (4.2.3)
sass (~> 3.4)
thor
bower-rails (0.10.0)
builder (3.2.2)
bullet (4.14.7)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -92,15 +91,9 @@ GEM
multipart-post (>= 1.2, < 3)
font-awesome-sass (4.3.2.1)
sass (~> 3.2)
gemoji (2.1.0)
github-markdown (0.6.8)
globalid (0.3.5)
activesupport (>= 4.1.0)
gon (6.0.1)
actionpack (>= 3.0)
json
multi_json
request_store (>= 1.0)
haml (4.0.6)
tilt
haml-rails (0.9.0)
Expand Down Expand Up @@ -212,7 +205,6 @@ GEM
rake (10.4.2)
redcarpet (3.3.1)
ref (1.0.5)
request_store (1.2.0)
rsolr (1.0.12)
builder (>= 2.1.2)
rspec-core (3.2.3)
Expand Down Expand Up @@ -289,7 +281,6 @@ DEPENDENCIES
better_errors (= 2.1.1)
binding_of_caller (= 0.7.2)
bourbon
bower-rails
bullet
byebug
capistrano (= 3.4.0)
Expand All @@ -300,9 +291,7 @@ DEPENDENCIES
coffee-rails (~> 4.1.0)
factory_girl_rails (~> 4.5.0)
font-awesome-sass (~> 4.3.0)
gemoji
github-markdown (~> 0.6.8)
gon
haml-rails (~> 0.9.0)
jbuilder (~> 2.2.12)
jquery-rails
Expand Down Expand Up @@ -331,6 +320,3 @@ DEPENDENCIES
unicorn (= 4.8.3)
web-console (~> 2.0)
yajl-ruby (~> 1.2.1)

BUNDLED WITH
1.10.6
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RG Portal

* Ruby 2.2.1
* Bundler
* Bower

### Recommends

Expand All @@ -24,7 +23,7 @@ $ cp config/oauth.yml.sample config/oauth.yml

* Do not create a new authentication yourself. The number of integrations has a limit.

### Gem installation
### Library installation

```
$ bundle install --path=vendor/bundle
Expand All @@ -37,18 +36,6 @@ $ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir
```

### Copy emoji files to public directory

```
$ rake emoji
```

### JavaScript library installation

```
rake bower:install
```

### Database creation

```
Expand Down
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks

load 'tasks/emoji.rake'
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
//= require jquery_ujs
//= require jquery_nested_form
//= require turbolinks
//= require jquery-textcomplete/dist/jquery.textcomplete
//= require_tree .
16 changes: 0 additions & 16 deletions app/assets/javascripts/emoji_complete.js.coffee

This file was deleted.

7 changes: 0 additions & 7 deletions app/assets/stylesheets/_style.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,3 @@ nav {
width: 15%;
}
}

.emoji {
width: 1em;
height: 1em;
margin: 0;
padding: 0;
}
3 changes: 0 additions & 3 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Reset CSS
@import "reset";

// Autocomplete
@import "jquery-textcomplete/dist/jquery.textcomplete.css";

// Bootstrap
@import "bourbon";
@import "neat";
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/concerns/emoji_complete.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class PagesController < ApplicationController
include EmojiComplete
before_action :require_active_current_user
before_action :set_page, only: [:show, :edit, :update]
before_action :set_new_comment, only: :show
before_action :set_emoji_completion, only: [:show, :edit]

def index
@pages = Page.all
Expand Down
7 changes: 4 additions & 3 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class Comment < ActiveRecord::Base
include Emojifier
include MarkdownRender

belongs_to :user
belongs_to :page

Expand All @@ -11,6 +8,10 @@ class Comment < ActiveRecord::Base

MENTION_USER_REGEX = /@[A-z0-9]+/

def render_content
Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(self.content)
end

private

def notify_mentions
Expand Down
13 changes: 0 additions & 13 deletions app/models/concerns/emojifier.rb

This file was deleted.

3 changes: 1 addition & 2 deletions app/models/concerns/markdown_render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module MarkdownRender
HTML_RENDER_OPTIONS = { hard_wrap: true }

def render_content
content = self.class.include?(Emojifier) ? emojify : self.content
Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(HTML_RENDER_OPTIONS), MARKDOWN_RENDER_OPTIONS).render(content)
Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(HTML_RENDER_OPTIONS), MARKDOWN_RENDER_OPTIONS).render(self.content)
end
end
1 change: 0 additions & 1 deletion app/models/page.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Page < ActiveRecord::Base
include Emojifier
include MarkdownRender

has_many :comments
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
.user
.icon= image_tag @current_user.icon_url
.box
= f.text_area :content, rows: 4, class: 'emoji-complete'
= f.text_area :content, rows: 4
= f.submit 'Comment'
1 change: 0 additions & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
= content_for(:css)
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= content_for(:javascript)
= include_gon
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
= form_for @page, url: update_page_path, method: :patch do |f|
= f.hidden_field :path
= f.text_field :title
= f.text_area :content, rows: 30, class: 'emoji-complete'
= f.text_area :content, rows: 30
= f.submit 'Save'
= f.submit 'Draft Save', name: 'draft'
= link_to 'Cancel', page_path(@page.path)
Expand Down
22 changes: 0 additions & 22 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,3 @@
invoke 'unicorn:restart'
end
end

before 'deploy:compile_assets', 'bower:install'
namespace :bower do
task :install do
on roles(:web) do
within release_path do
execute :rake, 'bower:install CI=true'
end
end
end
end

before 'deploy:compile_assets', 'gemoji:install'
namespace :gemoji do
task :install do
on roles(:web) do
within release_path do
execute :rake, 'gemoji'
end
end
end
end
5 changes: 1 addition & 4 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path
Rails.application.config.assets.paths << Emoji.images_path
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')
# Rails.application.config.assets.paths << Emoji.images_path

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w(*.css *.scss)
Rails.application.config.assets.precompile += %w(emoji/*.png)
Rails.application.config.assets.precompile += %w(emoji/**/*.png)
19 changes: 0 additions & 19 deletions config/initializers/bower_rails.rb

This file was deleted.

7 changes: 4 additions & 3 deletions spec/factories/comments.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FactoryGirl.define do
factory :comment do
content 'This is a comment.'
association :user
association :page
user nil
post nil
content "MyText"
end

end
7 changes: 0 additions & 7 deletions spec/factories/pages.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/factories/slack_credentials.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryGirl.define do
factory :slack_credential do
sequence(:slack_user_id) { |n| "U03AE1H0U#{n}" }
user_id 'U03AE1H0U'
end
end
2 changes: 1 addition & 1 deletion spec/models/comment_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rails_helper'

RSpec.describe Comment, type: :model do
it_behaves_like 'emojifier'
pending "add some examples to (or delete) #{__FILE__}"
end
20 changes: 0 additions & 20 deletions spec/models/concerns/emojifier.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/models/page_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rails_helper'

describe Page, type: :model do
it_behaves_like 'emojifier'
pending "add some examples to (or delete) #{__FILE__}"
end
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
Dir[Rails.root.join('spec/models/concerns/**/*.rb')].each { |f| require f }
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
Expand Down
3 changes: 0 additions & 3 deletions vendor/assets/.bowerrc

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/assets/bower.json

This file was deleted.

0 comments on commit 21ebf05

Please sign in to comment.