Skip to content
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
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.3
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ before_install:
- gem --version
- gem install bundler
rvm:
- 2.1.2
- 2.2.2
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source 'https://rubygems.org'
ruby '2.1.2'
ruby '2.2.2'

# Rails
gem 'rails', '4.0.0'
gem 'rails', '4.2.1'

# Postgres
gem 'pg'
Expand All @@ -18,6 +18,9 @@ gem 'jquery-rails'
gem "oauth"
gem "omniauth-twitter"

# Responders
gem 'responders'

# Pagination
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
Expand All @@ -31,6 +34,9 @@ gem 'jbuilder', '~> 1.2'
# Giver user.show a friendly URL
gem 'friendly_id', "~> 5.0.0"

# Display emoji
gem 'gemoji'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
Expand Down
221 changes: 123 additions & 98 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,127 +1,152 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.0)
actionpack (= 4.0.0)
mail (~> 2.5.3)
actionpack (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
actionmailer (4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.1)
actionview (= 4.2.1)
activesupport (= 4.2.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.1)
activesupport (= 4.2.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.1)
activesupport (= 4.2.1)
globalid (>= 0.3.0)
activemodel (4.2.1)
activesupport (= 4.2.1)
builder (~> 3.1)
activerecord (4.2.1)
activemodel (= 4.2.1)
activesupport (= 4.2.1)
arel (~> 6.0)
activesupport (4.2.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.0)
bootstrap-sass (2.3.2.0)
sass (~> 3.2)
bootstrap-will_paginate (0.0.9)
will_paginate
builder (3.1.4)
builder (3.2.2)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.3)
childprocess (0.5.6)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.7.0)
database_cleaner (1.3.0)
coffee-script-source (1.9.1.1)
database_cleaner (1.4.1)
diff-lcs (1.2.5)
docile (1.1.4)
dotenv (0.11.1)
dotenv-deployment (~> 0.0.2)
dotenv-deployment (0.0.2)
dotenv-rails (0.11.1)
dotenv (= 0.11.1)
docile (1.1.5)
dotenv (2.0.1)
dotenv-rails (2.0.1)
dotenv (= 2.0.1)
erubis (2.7.0)
execjs (2.2.0)
execjs (2.5.2)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.2.0)
i18n (~> 0.5)
ffi (1.9.3)
friendly_id (5.0.4)
ffi (1.9.8)
friendly_id (5.0.5)
activerecord (>= 4.0.0)
hashie (2.1.2)
gemoji (2.1.0)
globalid (0.3.5)
activesupport (>= 4.1.0)
hashie (3.4.1)
hike (1.2.3)
i18n (0.6.9)
i18n (0.7.0)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
jquery-rails (4.0.3)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
json (1.8.2)
loofah (2.0.1)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (4.7.5)
multi_json (1.10.1)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
mime-types (2.5)
mini_portile (0.6.2)
minitest (5.6.1)
multi_json (1.11.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
oauth (0.4.7)
omniauth (1.2.1)
hashie (>= 1.2, < 3)
omniauth (1.2.2)
hashie (>= 1.2, < 4)
rack (~> 1.0)
omniauth-oauth (1.0.1)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-twitter (1.0.1)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
pg (0.17.1)
polyglot (0.3.5)
pry (0.10.0)
omniauth-twitter (1.2.0)
json (~> 1.3)
omniauth-oauth (~> 1.1)
pg (0.18.1)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.5.2)
rack-test (0.6.2)
rack (1.6.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.0)
actionmailer (= 4.0.0)
actionpack (= 4.0.0)
activerecord (= 4.0.0)
activesupport (= 4.0.0)
rails (4.2.1)
actionmailer (= 4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
activemodel (= 4.2.1)
activerecord (= 4.2.1)
activesupport (= 4.2.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.0)
sprockets-rails (~> 2.0.0)
railties (4.0.0)
actionpack (= 4.0.0)
activesupport (= 4.0.0)
railties (= 4.2.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.1)
actionpack (= 4.2.1)
activesupport (= 4.2.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
rdoc (4.1.1)
json (~> 1.4)
rake (10.4.2)
rdoc (4.2.0)
responders (2.1.0)
railties (>= 4.2.0, < 5)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
Expand All @@ -136,44 +161,42 @@ GEM
rspec-mocks (~> 2.14.0)
rubyzip (0.9.9)
sass (3.2.19)
sass-rails (4.0.3)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
selenium-webdriver (2.35.1)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip (< 1.0.0)
websocket (~> 1.0.4)
simplecov (0.8.2)
simplecov (0.10.0)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.5.0)
sprockets (2.11.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
sprockets-rails (2.2.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sprockets (>= 2.8, < 4.0)
thor (0.19.1)
thread_safe (0.3.4)
thread_safe (0.3.5)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
turbolinks (2.5.3)
coffee-rails
tzinfo (0.3.39)
uglifier (2.5.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
websocket (1.0.7)
Expand All @@ -194,14 +217,16 @@ DEPENDENCIES
factory_girl_rails (= 4.2.1)
faker (= 1.2.0)
friendly_id (~> 5.0.0)
gemoji
jbuilder (~> 1.2)
jquery-rails
oauth
omniauth-twitter
pg
pry
rails (= 4.0.0)
rails (= 4.2.1)
rake
responders
rspec-rails (~> 2.14.0)
sass-rails (~> 4.0.0)
sdoc
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ rake db:test:prepare
```bash
rake db:populate
```
```

These commands do the following:
1. Install all of the necessary gems listed in the Gemfile
Expand All @@ -40,6 +39,12 @@ TWITTER_KEY=
TWITTER_SECRET=
```

Copy images for emoji

```
rake emoji
```

## Authors
* Melissa Holmes [@meltar](https://github.com/meltar)
* Kylie Stradley [@kstradley](https://github.com/kstradley)
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

require File.expand_path('../config/application', __FILE__)

load 'tasks/emoji.rake'

ChallegeMe::Application.load_tasks

4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ def current_user?(user)
false
end
end

def champion(user)
emojify ":#{user.champion.name.downcase.tr(" ", "_")}:"
end
end
11 changes: 11 additions & 0 deletions app/helpers/emoji_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module EmojiHelper
def emojify(content)
h(content).to_str.gsub(/:([\w+-]+):/) do |match|
if emoji = Emoji.find_by_alias($1)
%(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
else
match
end
end.html_safe if content.present?
end
end
Loading