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
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

18 changes: 15 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
source :rubygems
# frozen_string_literal: true
source "https://rubygems.org"

gem 'rack-contrib'
gem 'shotgun', group: :development
gem "redcarpet"
gem "haml"
gem "rack"
gem "rack-contrib"

group :development do
gem "shotgun"
gem "awesome_print"
end

group :development, :test do
gem "rspec"
end
28 changes: 26 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
awesome_print (1.7.0)
diff-lcs (1.3)
haml (4.0.7)
tilt
rack (2.0.1)
rack-contrib (1.2.0)
rack (>= 0.9.1)
redcarpet (3.4.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
shotgun (0.9.2)
rack (>= 1.0)
tilt (2.0.6)

PLATFORMS
ruby

DEPENDENCIES
awesome_print
haml
rack
rack-contrib
redcarpet
rspec
shotgun

BUNDLED WITH
1.13.7
1.14.3
10 changes: 0 additions & 10 deletions NOTES

This file was deleted.

77 changes: 19 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,39 @@
# devpunks

### DSL (Domain Specific Language) for ([config.ru](https://github.com/NYCrb/devpunks/blob/master/config.ru))
Inspired by Express.js _(http://expressjs.com/)_ routing.
> devpunk starts with just a rack app and a dream

#### static!
Expose static files _(defaults to ./public)_
```ruby
static!
````
Right now, this codebase only exists to serve the website for devpunks dot com.

#### four_oh_four!
Fallback error page for missing route definitions.
```ruby
four_oh_four! # /not-found => 404 & renders ./public/404.html
````
But five minutes from now, it could be anything!

#### route
Define handler for route URI
```ruby
route ('/foo') { 'devPunks' }
````
# Contributing

#### params
Access to _(GET, POST, PUT, & PATCH)_ request parameters
```ruby
route ('/echo?value=Hello') { "#{params[:value]} World!" }
````
The site copy and configuration are stored in YAML files under `data/`.

#### status
Get or set the response code.
```ruby
status 201 #=> Responds with 201 CREATED
````
devpunk uses `EasyData` to massage info from these files for use in templates.

#### json
Responds with a JSON body
```ruby
json(foo: 'bar', baz: 'bat') #=> "{\"foo\":\"bar\", \"baz\":\"bat\"}"
````
See `homepage.rb` and `events.rb` for examples of endpoints.

#### run!
Run the Application
```ruby
run!
````
See `config.ru` for how to add and route to endpoints.

### Install
```bash
$ bundle
```

### Running Server
#### Development
# Running
## Development
```bash
$ bundle exec shotgun
```

#### Production
## Production
```bash
$ rackup
```

### Dependencies
- [Rack](https://rack.github.io)

#### Development
- [Shotgun](https://github.com/rtomayko/shotgun#shotgun)

### Skeleton Framework: or...Why Rack?
Web Servers vs. App Servers
http://www.justinweiss.com/articles/a-web-server-vs-an-app-server/
# Dependencies
- [Rack](https://rack.github.io)

Rails vs. Sinatra
https://blog.engineyard.com/2014/rails-vs-sinatra
## Development
- [Shotgun](https://github.com/rtomayko/shotgun#shotgun)

How Does Rack Work?
https://blog.engineyard.com/2015/understanding-rack-apps-and-middleware
# Skeleton Framework: or...Why Rack?
- [Web Servers vs. App Servers](http://www.justinweiss.com/articles/a-web-server-vs-an-app-server/)
- [Rails vs. Sinatra](https://blog.engineyard.com/2014/rails-vs-sinatra)
- [How Does Rack Work?](https://blog.engineyard.com/2015/understanding-rack-apps-and-middleware)
38 changes: 0 additions & 38 deletions action.rb

This file was deleted.

1 change: 0 additions & 1 deletion application.rb

This file was deleted.

29 changes: 19 additions & 10 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
%w[hash]
.each { |extension| require_relative "./extensions/#{extension}" }
require "rack"
require "rack/contrib"

%w[events]
.each { |store| require_relative "./stores/#{store}" }
require "./homepage"
require "./events"

require_relative './helpers'
use Rack::ShowExceptions

static!
use Rack::TryStatic,
root: "public",
urls: %w[/]

four_oh_four!
map "/events" do
run DevPunks::Events.new
end

route ('/events') { json Events }

run!
run lambda { |env|
case env["PATH_INFO"]
when "/"
DevPunks::HomePage.new
else
Rack::NotFound.new("public/404.html")
end.call env
}
40 changes: 40 additions & 0 deletions data/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
title: devpunks \m/
blurb: The first technology show from junior to super senior developer in 15 minutes.

mission: >
Devpunks include a diverse array of ideologies, fashions and forms of
expression, including visual art, literature, and film. Devpunk are largely
characterized by **anti-establishment** views and the promotion of
**individual freedom**. The devpunk is centered on a loud, aggressive genre
of developers. It is usually played by small teams consisting of a junior,
one or two seniors, and a hiring manager.

politics: >
devpunk politics cover the entire political spectrum. devpunk-related
ideologies are mostly concerned with individual freedom and
anti-establishment views. Common devpunk viewpoints include
anti-authoritarianism, a DIY ethic, non-conformity, direct action and not
selling out.

community: >
devpunks can come from any and all walks of life and economic classes.
Compared to some alternative cultures, devpunk is much closer to being gender
equalist in terms of its ideology.

One part of devpunk is creating explicitly outward identities of mentality.
Everything that was normally supposed to be hidden was brought to the front,
both literally and figuratively.

media: >
Devpunks often follow a DIY policy of filming the footage first, without
permission, and also posting it without permission, but will generally take
down material if asked. Founder Joly MacFie argues that this serves an
important archival purpose.

Devpunk Communities use collaborative podcasts &amp; vocasts to support
multiple contributors podcasting through generally simplified processes, and
without having to host their own individual feeds. A community podcast can
also allow members of the community (related to the podcast topic) to
contribute to the podcast in many different ways. This method was first used
for a series of podcasts hosted by the Regional Educational Technology Center
at Fordham University in 2005.
33 changes: 33 additions & 0 deletions data/site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
links:
twitter:
icon: 🐦
url: http://twitter.com/devpunks
title: Twitter
github:
icon: 💾
url: http://github.com/nycrb/devpunks
title: GitHub
youtube:
icon: 🎬
url: https://www.youtube.com/channel/UCdbw8GpAB4pjVacUTtGUemQ
title: YouTube
email:
icon: 📨
url: mailto:[email protected]
title: E-Mail

sponsors:
pivotal:
title: Pivotal Labs
url: http://pivotal.io

posts:
decaf:
title: Rails Decaf *(sans CoffeeScript &amp; Sprockets)*
url: http://blog.arkency.com/2015/03/gulp-modern-approach-to-asset-pipeline-for-rails-developers/

tools:
termjs:
title: term.js
url: https://github.com/chjj/term.js
blurb: A terminal written in JavaScript
Loading