pacino 0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ *.gem
2
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in packmule.gemspec
4
+ gemspec
@@ -0,0 +1,48 @@
1
+ Pacino
2
+ ======
3
+
4
+ Pacino is a simple "blog" powered by Sinatra.
5
+
6
+ Installation
7
+ ------------
8
+
9
+ Simply run `gem install pacino`
10
+
11
+ Setup
12
+ ------
13
+
14
+ Setting up Pacino is easy.
15
+
16
+ Create a directory you want to run Pacino from with,
17
+ inside it create the following files and directories:
18
+
19
+ - posts/
20
+ - config.yml
21
+ - config.ru
22
+ - app.rb
23
+
24
+ Inside the `posts/` directory, create a file named `1.yml`
25
+ and place the following inside it:
26
+
27
+ title: My first post
28
+ slug: my-first-post
29
+ body: |
30
+ This is my _first_ post!
31
+
32
+ Totally **AWESOME**.
33
+
34
+ Inside `app.rb` put:
35
+
36
+ require 'pacino'
37
+ Pacino.run
38
+
39
+ Inside `config.ru` put:
40
+
41
+ require './app.rb'
42
+ run Sinatra::Application
43
+
44
+ And inside `config.yml` put:
45
+
46
+ title: My Blog Name
47
+
48
+ And you're good to go.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -1,8 +1,65 @@
1
+ #
2
+ # Pacino
3
+ # Copyright (c) 2011-2012 Jack Polgar
4
+ #
5
+ # Pacino is released under
6
+ # the GPLv3 only license.
7
+ #
8
+
9
+ require 'pacino/version'
1
10
  require 'sinatra'
11
+ require 'rocketeer'
12
+ require 'yaml'
13
+ require 'redcarpet/compat'
14
+
2
15
  module Pacino
3
- get '/' do
4
- "Say hello to my little friend! - actually we'll be online shortly."
16
+ class << self
17
+ attr_accessor :title
18
+
19
+ ##
20
+ # Runs Pacino
21
+ def run
22
+ # Configure the app
23
+ configure do
24
+ @DIR = File.dirname(__FILE__)
25
+
26
+ # Load the config file
27
+ conf = YAML.load_file Dir.pwd + '/config.yml'
28
+ self.title = conf['title']
29
+
30
+ set :views => @DIR + '/pacino/views'
31
+ end
32
+
33
+ # Helpers
34
+ helpers do
35
+ ##
36
+ # Markdown helper
37
+ def mrkdwn(txt)
38
+ ::Markdown.new(txt).to_html
39
+ end
40
+ end
41
+
42
+ ## Do stuff before every page
43
+ before do
44
+ # Get the posts
45
+ @posts = {}
46
+ Dir.glob('posts/*.yml').reverse.each do |p|
47
+ # Load the post file
48
+ post = YAML.load_file p
49
+ # Add it to the posts hash
50
+ @posts[:"#{post['slug']}"] = post
51
+ end
52
+ end
53
+
54
+ # Index page
55
+ get '/' do
56
+ erb :index, :layout => :'layouts/default'
57
+ end
58
+
59
+ # Style file
60
+ get '/css/style.css' do
61
+ scss :'css/style'
62
+ end
63
+ end
5
64
  end
6
- end
7
-
8
- require 'pacino/version'
65
+ end
@@ -1,3 +1,11 @@
1
+ #
2
+ # Pacino
3
+ # Copyright (c) 2011-2012 Jack Polgar
4
+ #
5
+ # Pacino is released under
6
+ # the GPLv3 only license.
7
+ #
8
+
1
9
  module Pacino
2
- VERSION = '0.1'
10
+ VERSION = '0.2.0'
3
11
  end
@@ -0,0 +1,58 @@
1
+ body {
2
+ font-family: Oxygen, sans-serif;
3
+ font-size: 12px;
4
+ background: #eee;
5
+ margin: 0;
6
+ padding: 20px;
7
+ }
8
+
9
+ h1, h2 {
10
+ font-family: 'Dancing Script', Oxygen, sans-serif;
11
+
12
+ a {
13
+ text-decoration: none;
14
+ }
15
+ }
16
+
17
+ #wrapper {
18
+ background: #fff;
19
+ width: 600px;
20
+ margin: 0 auto;
21
+ padding: 30px;
22
+ }
23
+
24
+ a {
25
+ color: #000;
26
+ text-docoration: underline;
27
+
28
+ &:hover {
29
+ text-decoration: none;
30
+ }
31
+ }
32
+
33
+ #header h1 {
34
+ font-size: 45px;
35
+ margin: 0;
36
+ margin-bottom: 25px;
37
+ }
38
+
39
+ article {
40
+ margin-bottom: 15px;
41
+
42
+ h2 {
43
+ font-size: 22px;
44
+ margin: 0;
45
+ margin-bottom: 10px;
46
+ border-bottom: 1px dashed #ccc;
47
+ padding: 0 0 5px;
48
+ }
49
+
50
+ &:last-child {
51
+ margin-bottom: 0;
52
+ }
53
+ }
54
+
55
+ #footer {
56
+ margin-top: 25px;
57
+ color: #777;
58
+ }
@@ -0,0 +1,6 @@
1
+ <% @posts.each do |slug, p| %>
2
+ <article>
3
+ <h2><%= p['title'] %></h2>
4
+ <%= mrkdwn p['body'] %>
5
+ </article>
6
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" dir="ltr">
3
+ <head>
4
+ <title><%= Pacino.title %></title>
5
+ <link href="http://fonts.googleapis.com/css?family=Dancing+Script:700|Oxygen" rel="stylesheet">
6
+ <%= css_link_tag '/css/style.css' %>
7
+ </head>
8
+ <body>
9
+ <div id="wrapper">
10
+ <header id="header">
11
+ <h1><%= link_to Pacino.title, '/' %></h1>
12
+ </header>
13
+ <div id="page">
14
+ <%= yield %>
15
+ <div class="clearfix"></div>
16
+ </div>
17
+ <footer id="footer">
18
+ &copy; <%= Pacino.title %>, powered by Pacino <%= Pacino::VERSION %>
19
+ </footer>
20
+ </div>
21
+ </body>
22
+ </html>
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/pacino/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "pacino"
6
+ gem.version = Pacino::VERSION
7
+ gem.authors = ["Jack Polgar"]
8
+ gem.email = ["nrx@nirix.net"]
9
+ gem.summary = "Simple little blog."
10
+ gem.description = "Simple little blog powered by Sinatra."
11
+ gem.homepage = "https://github.com/nirix/pacino"
12
+
13
+ gem.files = `git ls-files`.split($\)
14
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.add_dependency 'sinatra', '~> 1.3.2'
19
+ gem.add_dependency 'rocketeer', '~> 0.4.0'
20
+ gem.add_dependency 'redcarpet', '~> 2.1.1'
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pacino
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,38 +9,58 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-11 00:00:00.000000000Z
12
+ date: 2012-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: sequel
16
- requirement: &28731132 !ruby/object:Gem::Requirement
15
+ name: sinatra
16
+ requirement: &70337825298380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.28.0
21
+ version: 1.3.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *28731132
24
+ version_requirements: *70337825298380
25
25
  - !ruby/object:Gem::Dependency
26
- name: sinatra
27
- requirement: &28730844 !ruby/object:Gem::Requirement
26
+ name: rocketeer
27
+ requirement: &70337825297880 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.4.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70337825297880
36
+ - !ruby/object:Gem::Dependency
37
+ name: redcarpet
38
+ requirement: &70337825297420 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ~>
31
42
  - !ruby/object:Gem::Version
32
- version: 1.3.1
43
+ version: 2.1.1
33
44
  type: :runtime
34
45
  prerelease: false
35
- version_requirements: *28730844
36
- description: Pacino is a simple Sinatra powered app.
37
- email: nrx@gxr.co
46
+ version_requirements: *70337825297420
47
+ description: Simple little blog powered by Sinatra.
48
+ email:
49
+ - nrx@nirix.net
38
50
  executables: []
39
51
  extensions: []
40
52
  extra_rdoc_files: []
41
53
  files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - README.md
57
+ - Rakefile
42
58
  - lib/pacino.rb
43
59
  - lib/pacino/version.rb
60
+ - lib/pacino/views/css/style.scss
61
+ - lib/pacino/views/index.erb
62
+ - lib/pacino/views/layouts/default.erb
63
+ - pacino.gemspec
44
64
  homepage: https://github.com/nirix/pacino
45
65
  licenses: []
46
66
  post_install_message:
@@ -52,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
72
  requirements:
53
73
  - - ! '>='
54
74
  - !ruby/object:Gem::Version
55
- version: 1.9.2
75
+ version: '0'
56
76
  required_rubygems_version: !ruby/object:Gem::Requirement
57
77
  none: false
58
78
  requirements:
@@ -61,8 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
81
  version: '0'
62
82
  requirements: []
63
83
  rubyforge_project:
64
- rubygems_version: 1.8.7
84
+ rubygems_version: 1.8.11
65
85
  signing_key:
66
86
  specification_version: 3
67
- summary: Sinatra powered.
87
+ summary: Simple little blog.
68
88
  test_files: []