This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pete Nicholls
committed
Apr 2, 2014
1 parent
3541d92
commit 2a3eb46
Showing
15 changed files
with
99 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
.env | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
source "http://rubygems.org" | ||
source 'https://rubygems.org' | ||
|
||
gem "sinatra" | ||
gem "sass" | ||
gem "tzinfo" | ||
gem "ri_cal" | ||
gem "rdiscount" | ||
|
||
group :development do | ||
gem "foreman" | ||
end | ||
# Specify your gem's dependencies in almanac.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,27 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
almanac (1.0.0.alpha) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
remote: https://rubygems.org/ | ||
specs: | ||
atomic (1.1.14) | ||
dotenv (0.9.0) | ||
foreman (0.63.0) | ||
dotenv (>= 0.7) | ||
thor (>= 0.13.6) | ||
rack (1.5.2) | ||
rack-protection (1.5.1) | ||
rack | ||
rdiscount (2.1.7) | ||
ri_cal (0.8.8) | ||
sass (3.2.12) | ||
sinatra (1.4.4) | ||
rack (~> 1.4) | ||
rack-protection (~> 1.4) | ||
tilt (~> 1.3, >= 1.3.4) | ||
thor (0.18.1) | ||
thread_safe (0.1.3) | ||
atomic | ||
tilt (1.4.1) | ||
tzinfo (1.1.0) | ||
thread_safe (~> 0.1) | ||
diff-lcs (1.2.5) | ||
rake (10.2.2) | ||
rspec (2.14.1) | ||
rspec-core (~> 2.14.0) | ||
rspec-expectations (~> 2.14.0) | ||
rspec-mocks (~> 2.14.0) | ||
rspec-core (2.14.8) | ||
rspec-expectations (2.14.5) | ||
diff-lcs (>= 1.1.3, < 2.0) | ||
rspec-mocks (2.14.6) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
foreman | ||
rdiscount | ||
ri_cal | ||
sass | ||
sinatra | ||
tzinfo | ||
almanac! | ||
bundler (~> 1.5) | ||
rake | ||
rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,29 @@ | ||
# Sinatra GCal | ||
# Almanac | ||
|
||
[![Dependency | ||
Status](https://gemnasium.com/Aupajo/sinatra-gcal.png)](https://gemnasium.com/Aupajo/sinatra-gcal) | ||
TODO: Write a gem description | ||
|
||
Show off your Google Calendar in a nifty, Sinatra-powered events page. | ||
## Installation | ||
|
||
![Sinatra GCal example](http://i.imgur.com/odgyR.png) | ||
Add this line to your application's Gemfile: | ||
|
||
See a demo running at [http://christchurch.events.geek.nz](http://christchurch.events.geek.nz) | ||
gem 'almanac' | ||
|
||
Event descriptions can be formatted in [Markdown](http://daringfireball.net/projects/markdown/basics). | ||
And then execute: | ||
|
||
## Setting up a Sinatra GCal site | ||
$ bundle | ||
|
||
Sinatra GCal is designed to work out-of-the box on a single [Heroku](http://heroku.com/) dyno, effectively making it free to host. | ||
Or install it yourself as: | ||
|
||
With the [Heroku toolbelt](https://toolbelt.heroku.com/) installed, you can get up-and-running-with: | ||
$ gem install almanac | ||
|
||
heroku create --stack cedar | ||
heroku config:add GCAL_CALENDAR_ID=your-calendar-id@group.calendar.google.com | ||
heroku config:add TIMEZONE="Pacific/Auckland" | ||
git push heroku master | ||
heroku open | ||
## Usage | ||
|
||
The two settings you must have are the `GCAL_CALENDAR_ID` and the `TIMEZONE`. | ||
TODO: Write usage instructions here | ||
|
||
The `GCAL_CALENDAR ID` you can find on the Calendar Settings page: | ||
## Contributing | ||
|
||
![Choose "Calendar Settings" from the calendar options disclosure arrow](http://i.imgur.com/evQI5IX.png) | ||
|
||
![Locate the Calendar ID](http://i.imgur.com/UN7d77t.png) | ||
|
||
A list of available timezones can be found at https://gist.github.com/4654510 | ||
|
||
## Available settings | ||
|
||
Options can be set via environment variables. | ||
|
||
* `GCAL_CALENDAR_ID` -- Mandatory, the Google Calendar ID (see above) | ||
* `TIMEZONE` -- Mandatory, the timezone in which to display the calendar | ||
* `DAYS_LOOKAHEAD` -- Optional, how many days ahead to show (default is 30) | ||
* `ALLOW_HTML` -- Optional, whether to allow HTML in event descriptions (default is false) | ||
* `TWITTER` --- Add a link to a Twitter account at the bottom of the page | ||
|
||
## Developing locally | ||
|
||
Sinatra GCal is written in [Ruby](http://ruby-lang.org) (Ruby 1.9.3 recommended). | ||
|
||
With [Bundler](http://gembundler.com) installed: | ||
|
||
bundle install | ||
|
||
Ruby with `ruby server.rb`. If you want to reload the server each request (useful for development), install [Shotgun](http://rubygems.org/gems/shotgun) and run `shotgun server.rb`. | ||
|
||
## Laundry list | ||
|
||
Still to-do: | ||
|
||
* Caching support (currently fetches the calendar every time a request is made) | ||
* Tidy up the request code | ||
1. Fork it ( http://github.com/<my-github-username>/almanac/fork ) | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create new Pull Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'almanac/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "almanac" | ||
spec.version = Almanac::VERSION | ||
spec.authors = ["Pete Nicholls"] | ||
spec.email = ["pete@metanation.com"] | ||
spec.summary = %q{TODO: Write a short summary. Required.} | ||
spec.description = %q{TODO: Write a longer description. Optional.} | ||
spec.homepage = "" | ||
spec.license = "MIT" | ||
|
||
spec.files = `git ls-files -z`.split("\x0") | ||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_development_dependency "bundler", "~> 1.5" | ||
spec.add_development_dependency "rake" | ||
spec.add_development_dependency "rspec" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "almanac/version" | ||
|
||
module Almanac | ||
# Your code goes here... | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Almanac | ||
VERSION = "1.0.0.alpha" | ||
end |
Empty file.
Oops, something went wrong.