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

Commit

Permalink
Gem scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Nicholls committed Apr 2, 2014
1 parent 3541d92 commit 2a3eb46
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 386 deletions.
18 changes: 17 additions & 1 deletion .gitignore
@@ -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
13 changes: 3 additions & 10 deletions Gemfile
@@ -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
48 changes: 20 additions & 28 deletions Gemfile.lock
@@ -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
6 changes: 4 additions & 2 deletions LICENSE → LICENSE.txt
@@ -1,4 +1,6 @@
Copyright (c) 2011 Pete Nicholls
Copyright (c) 2014 Pete Nicholls

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -17,4 +19,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

66 changes: 17 additions & 49 deletions README.md
@@ -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
6 changes: 6 additions & 0 deletions Rakefile
@@ -0,0 +1,6 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
24 changes: 24 additions & 0 deletions almanac.gemspec
@@ -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
3 changes: 0 additions & 3 deletions config.ru

This file was deleted.

5 changes: 5 additions & 0 deletions lib/almanac.rb
@@ -0,0 +1,5 @@
require "almanac/version"

module Almanac
# Your code goes here...
end
3 changes: 3 additions & 0 deletions lib/almanac/version.rb
@@ -0,0 +1,3 @@
module Almanac
VERSION = "1.0.0.alpha"
end
Empty file removed public/.gitkeep
Empty file.
115 changes: 0 additions & 115 deletions server.rb

This file was deleted.

0 comments on commit 2a3eb46

Please sign in to comment.