Skip to content

Commit 7991f9a

Browse files
committed
Merge pull request #25 from offthread/development
1.0 Version Release
2 parents ecbc9a8 + 9e2433c commit 7991f9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1946
-0
lines changed

.env.sample

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SECRET_KEY_BASE=a87768df4d78017cbaa6917e874b149b0d4ea40b17e7c5df68cd1560fd648c8e61b4afb675db410ae5b461c31ab8a5a48633def280f47229b853a35607676b1d
2+
3+
DEV_BOT_TOKEN=<The token of your bot used for development purposes">
4+
DEV_BOT_USERNAME=<The username of your bot used for development purposes">
5+
6+
TEST_BOT_TOKEN=<The token of your bot used for test purposes">
7+
TEST_BOT_USERNAME=<The username of your bot used for test purposes">
8+
9+
PRODUCTION_BOT_TOKEN=<The token of your bot used for production purposes">
10+
PRODUCTION_BOT_USERNAME=<The username of your bot used for production purposes">

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ bower.json
3333

3434
# Ignore pow environment settings
3535
.powenv
36+
.env

Gemfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
source 'https://rubygems.org'
2+
3+
4+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5+
gem 'rails', '4.2.6'
6+
# Use sqlite3 as the database for Active Record
7+
gem 'sqlite3'
8+
# Use SCSS for stylesheets
9+
gem 'sass-rails', '~> 5.0'
10+
# Use Uglifier as compressor for JavaScript assets
11+
gem 'uglifier', '>= 1.3.0'
12+
# Use CoffeeScript for .coffee assets and views
13+
gem 'coffee-rails', '~> 4.1.0'
14+
# See https://github.com/rails/execjs#readme for more supported runtimes
15+
# gem 'therubyracer', platforms: :ruby
16+
17+
# Use jquery as the JavaScript library
18+
gem 'jquery-rails'
19+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20+
gem 'turbolinks'
21+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22+
gem 'jbuilder', '~> 2.0'
23+
# bundle exec rake doc:rails generates the API under doc/api.
24+
gem 'sdoc', '~> 0.4.0', group: :doc
25+
gem 'telegram-bot'
26+
gem 'rails-i18n'
27+
gem 'dotenv-rails'
28+
29+
# Use ActiveModel has_secure_password
30+
# gem 'bcrypt', '~> 3.1.7'
31+
32+
# Use Unicorn as the app server
33+
# gem 'unicorn'
34+
35+
# Use Capistrano for deployment
36+
# gem 'capistrano-rails', group: :development
37+
38+
group :development, :test do
39+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
40+
gem 'byebug'
41+
end
42+
43+
group :development do
44+
# Access an IRB console on exception pages or by using <%= console %> in views
45+
gem 'web-console', '~> 2.0'
46+
47+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
48+
gem 'spring'
49+
end
50+

Gemfile.lock

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actionmailer (4.2.6)
5+
actionpack (= 4.2.6)
6+
actionview (= 4.2.6)
7+
activejob (= 4.2.6)
8+
mail (~> 2.5, >= 2.5.4)
9+
rails-dom-testing (~> 1.0, >= 1.0.5)
10+
actionpack (4.2.6)
11+
actionview (= 4.2.6)
12+
activesupport (= 4.2.6)
13+
rack (~> 1.6)
14+
rack-test (~> 0.6.2)
15+
rails-dom-testing (~> 1.0, >= 1.0.5)
16+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
17+
actionview (4.2.6)
18+
activesupport (= 4.2.6)
19+
builder (~> 3.1)
20+
erubis (~> 2.7.0)
21+
rails-dom-testing (~> 1.0, >= 1.0.5)
22+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
23+
activejob (4.2.6)
24+
activesupport (= 4.2.6)
25+
globalid (>= 0.3.0)
26+
activemodel (4.2.6)
27+
activesupport (= 4.2.6)
28+
builder (~> 3.1)
29+
activerecord (4.2.6)
30+
activemodel (= 4.2.6)
31+
activesupport (= 4.2.6)
32+
arel (~> 6.0)
33+
activesupport (4.2.6)
34+
i18n (~> 0.7)
35+
json (~> 1.7, >= 1.7.7)
36+
minitest (~> 5.1)
37+
thread_safe (~> 0.3, >= 0.3.4)
38+
tzinfo (~> 1.1)
39+
arel (6.0.3)
40+
binding_of_caller (0.7.2)
41+
debug_inspector (>= 0.0.1)
42+
builder (3.2.2)
43+
byebug (9.0.1)
44+
coffee-rails (4.1.1)
45+
coffee-script (>= 2.2.0)
46+
railties (>= 4.0.0, < 5.1.x)
47+
coffee-script (2.4.1)
48+
coffee-script-source
49+
execjs
50+
coffee-script-source (1.10.0)
51+
concurrent-ruby (1.0.2)
52+
debug_inspector (0.0.2)
53+
erubis (2.7.0)
54+
execjs (2.6.0)
55+
globalid (0.3.6)
56+
activesupport (>= 4.1.0)
57+
httpclient (2.8.0)
58+
i18n (0.7.0)
59+
jbuilder (2.4.1)
60+
activesupport (>= 3.0.0, < 5.1)
61+
multi_json (~> 1.2)
62+
jquery-rails (4.1.1)
63+
rails-dom-testing (>= 1, < 3)
64+
railties (>= 4.2.0)
65+
thor (>= 0.14, < 2.0)
66+
json (1.8.3)
67+
loofah (2.0.3)
68+
nokogiri (>= 1.5.9)
69+
mail (2.6.4)
70+
mime-types (>= 1.16, < 4)
71+
mime-types (3.0)
72+
mime-types-data (~> 3.2015)
73+
mime-types-data (3.2016.0221)
74+
mini_portile2 (2.0.0)
75+
minitest (5.8.4)
76+
multi_json (1.12.0)
77+
nokogiri (1.6.7.2)
78+
mini_portile2 (~> 2.0.0.rc2)
79+
rack (1.6.4)
80+
rack-test (0.6.3)
81+
rack (>= 1.0)
82+
rails (4.2.6)
83+
actionmailer (= 4.2.6)
84+
actionpack (= 4.2.6)
85+
actionview (= 4.2.6)
86+
activejob (= 4.2.6)
87+
activemodel (= 4.2.6)
88+
activerecord (= 4.2.6)
89+
activesupport (= 4.2.6)
90+
bundler (>= 1.3.0, < 2.0)
91+
railties (= 4.2.6)
92+
sprockets-rails
93+
rails-deprecated_sanitizer (1.0.3)
94+
activesupport (>= 4.2.0.alpha)
95+
rails-dom-testing (1.0.7)
96+
activesupport (>= 4.2.0.beta, < 5.0)
97+
nokogiri (~> 1.6.0)
98+
rails-deprecated_sanitizer (>= 1.0.1)
99+
rails-html-sanitizer (1.0.3)
100+
loofah (~> 2.0)
101+
rails-i18n (4.0.8)
102+
i18n (~> 0.7)
103+
railties (~> 4.0)
104+
railties (4.2.6)
105+
actionpack (= 4.2.6)
106+
activesupport (= 4.2.6)
107+
rake (>= 0.8.7)
108+
thor (>= 0.18.1, < 2.0)
109+
rake (11.1.2)
110+
rdoc (4.2.2)
111+
json (~> 1.4)
112+
sass (3.4.22)
113+
sass-rails (5.0.4)
114+
railties (>= 4.0.0, < 5.0)
115+
sass (~> 3.1)
116+
sprockets (>= 2.8, < 4.0)
117+
sprockets-rails (>= 2.0, < 4.0)
118+
tilt (>= 1.1, < 3)
119+
sdoc (0.4.1)
120+
json (~> 1.7, >= 1.7.7)
121+
rdoc (~> 4.0)
122+
spring (1.7.1)
123+
sprockets (3.6.0)
124+
concurrent-ruby (~> 1.0)
125+
rack (> 1, < 3)
126+
sprockets-rails (3.0.4)
127+
actionpack (>= 4.0)
128+
activesupport (>= 4.0)
129+
sprockets (>= 3.0.0)
130+
sqlite3 (1.3.11)
131+
telegram-bot (0.6.0)
132+
actionpack (~> 4.0)
133+
activesupport (~> 4.0)
134+
httpclient (~> 2.7)
135+
thor (0.19.1)
136+
thread_safe (0.3.5)
137+
tilt (2.0.3)
138+
turbolinks (2.5.3)
139+
coffee-rails
140+
tzinfo (1.2.2)
141+
thread_safe (~> 0.1)
142+
uglifier (3.0.0)
143+
execjs (>= 0.3.0, < 3)
144+
web-console (2.3.0)
145+
activemodel (>= 4.0)
146+
binding_of_caller (>= 0.7.2)
147+
railties (>= 4.0)
148+
sprockets-rails (>= 2.0, < 4.0)
149+
150+
PLATFORMS
151+
ruby
152+
153+
DEPENDENCIES
154+
byebug
155+
coffee-rails (~> 4.1.0)
156+
jbuilder (~> 2.0)
157+
jquery-rails
158+
rails (= 4.2.6)
159+
rails-i18n
160+
sass-rails (~> 5.0)
161+
sdoc (~> 0.4.0)
162+
spring
163+
sqlite3
164+
telegram-bot
165+
turbolinks
166+
uglifier (>= 1.3.0)
167+
web-console (~> 2.0)
168+
169+
BUNDLED WITH
170+
1.12.3

README.rdoc

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
== README
2+
3+
Do you want to stay tuned about the big events that will be happening at Parque do Povo during the biggest São João in the World - Campina Grande?
4+
5+
We can help you to find the shows of Parque do Povo - Campina Grande/PB with this Telegram Bot, pphoje_bot.
6+
7+
If you are a Telegram user, you can include this bot into a channel or write commands directly on a private chat.
8+
9+
We support the following commands:
10+
11+
* /start - To start the bot
12+
13+
* /help - To check the supported commands
14+
15+
* /shows {day_number} {week_day} {next_day} - To check the shows for a specific date. The arguments are optional and you can inform one of the commands as the example.
16+
{day_number} -> Integer value, representing the day of a month. [1, 2, 3, 4, ..., 30]
17+
{week_day} -> String value, representing the day of a week. [{seg, mon}, {ter, tue}, {qua, wed}, {qui, thu}, {sex, fri}, {sab, sat}, {dom, sun}]
18+
{next_day} -> String value, representing the day after today. [{amanha, tomorrow}]
19+
20+
Example of usage:
21+
/shows -> returns the shows for the current day
22+
/shows 21 -> returns the shows for the 21th day of the current month
23+
/shows amanha -> returns the shows for the next day
24+
/shows mon -> returns the shows on Monday (current day, if it's Monday or next Monday otherwise)
25+
26+
This project is configured to run using the following configuration:
27+
28+
* Ruby version - 2.3.0
29+
30+
* Configuration
31+
32+
* Database creation:
33+
You should run the following commands to start the project correctly: rake db:create
34+
35+
* Database initialization
36+
You should run the following commands to start the project correctly: rake db:migrate -> rake db:seed
37+
38+
* Deployment instructions
39+
Just run bin/rake telegram:bot:poller to start the project
40+
41+
* License
42+
This software is licensed under the Apache 2 license, quoted below.
43+
44+
Copyright 2016 OFF Thread <[email protected]>
45+
46+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
47+
use this file except in compliance with the License. You may obtain a copy of
48+
the License at
49+
50+
http://www.apache.org/licenses/LICENSE-2.0
51+
52+
Unless required by applicable law or agreed to in writing, software
53+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
54+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
55+
License for the specific language governing permissions and limitations under
56+
the License.
57+
58+
* Contributing
59+
60+
Feel free to contribute using your own bot, as we should change the bot secret soon (should be configured in system variables environment).

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require File.expand_path('../config/application', __FILE__)
5+
6+
Rails.application.load_tasks

app/assets/images/.keep

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require jquery
14+
//= require jquery_ujs
15+
//= require turbolinks
16+
//= require_tree .
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
*/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class ApplicationController < ActionController::Base
2+
# Prevent CSRF attacks by raising an exception.
3+
# For APIs, you may want to use :null_session instead.
4+
protect_from_forgery with: :exception
5+
end

0 commit comments

Comments
 (0)