hazel 0.0.1

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.
data/MIT-LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2010 Peter Hellberg
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,49 @@
1
+ = WARNING: Not working yet :)
2
+
3
+ = Hazel
4
+
5
+ Hazel is a Sinatra application that handles asset management, mainly images,
6
+ for a number of users. It also includes a bookmarklet for quick and easy
7
+ uploading and embedding of files using Markdown or HTML markup.
8
+
9
+ == Installation
10
+
11
+ gem install hazel
12
+
13
+ == Dependencies
14
+
15
+ * Sinatra
16
+ * Haml
17
+ * Sinatra Warden
18
+ * Warden
19
+
20
+ == Getting started
21
+
22
+ hazel setup [path]
23
+
24
+ == TODO
25
+
26
+ * Initial Hazel backend using Sinatra + relevant libraries
27
+ * Hazel bookmarklet
28
+
29
+ == LICENCE
30
+
31
+ Copyright (c) 2010 Peter Hellberg
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining a copy
34
+ of this software and associated documentation files (the "Software"), to deal
35
+ in the Software without restriction, including without limitation the rights
36
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
+ copies of the Software, and to permit persons to whom the Software is
38
+ furnished to do so, subject to the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be included in
41
+ all copies or substantial portions of the Software.
42
+
43
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
49
+ THE SOFTWARE.
data/app/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source :gemcutter
2
+ gem 'rack', '>= 1.2.1'
3
+ gem 'sinatra', '~> 1.1.0'
4
+ gem 'sinatra_warden', '~> 0.3.1'
5
+ gem 'haml', '~> 3.0.23'
data/app/Gemfile.lock ADDED
@@ -0,0 +1,23 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ haml (3.0.23)
5
+ rack (1.2.1)
6
+ sinatra (1.1.0)
7
+ rack (~> 1.1)
8
+ tilt (~> 1.1)
9
+ sinatra_warden (0.3.2)
10
+ sinatra (>= 1.0.0)
11
+ warden (~> 1.0)
12
+ tilt (1.1)
13
+ warden (1.0.2)
14
+ rack (>= 1.0.0)
15
+
16
+ PLATFORMS
17
+ ruby
18
+
19
+ DEPENDENCIES
20
+ haml (~> 3.0.23)
21
+ rack (>= 1.2.1)
22
+ sinatra (~> 1.1.0)
23
+ sinatra_warden (~> 0.3.1)
data/app/config.ru ADDED
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require
5
+
6
+ require 'hazel.rb'
7
+ run Hazel
data/app/hazel.rb ADDED
@@ -0,0 +1,23 @@
1
+ class Hazel < Sinatra::Base
2
+ get '/' do
3
+ haml :index, :locals => { :body_class => 'home' }
4
+ end
5
+
6
+ get '/manage' do
7
+ haml :manage, :locals => { :body_class => 'manage' }
8
+ end
9
+
10
+ helpers do
11
+ def base_url
12
+ @base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
13
+ end
14
+
15
+ def bookmarklet
16
+ haml(:bookmarklet, :locals => {
17
+ :url => "#{base_url}/manage",
18
+ :window_name => 'hazel-bookmarklet',
19
+ :width => 500, :height => 600
20
+ }).to_s.gsub('\n', '')
21
+ end
22
+ end
23
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,40 @@
1
+ .button, .button:visited {
2
+ color: #333;
3
+ display: inline-block;
4
+ text-decoration: none;
5
+ font-weight: normal;
6
+ line-height: 1;
7
+ font-size: 0.9em;
8
+
9
+ -moz-border-radius: 5px;
10
+ -webkit-border-radius: 5px;
11
+ -moz-box-shadow: 0 0px 2px rgba(0,0,0,0.2);
12
+ -webkit-box-shadow: 0 0px 2px rgba(0,0,0,0.2);
13
+
14
+ text-shadow: 0 -1px 1px rgba(255,255,255,1);
15
+
16
+ background: -moz-linear-gradient(100% 100% 90deg, #eee, #fff);
17
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee));
18
+
19
+ position: relative;
20
+ cursor: pointer;
21
+
22
+ border: 0;
23
+
24
+ padding: 4px 10px;
25
+ }
26
+
27
+ .button:hover {
28
+ color: #000;
29
+ -moz-box-shadow: 0 0px 2px rgba(0,0,0,0.4);
30
+ -webkit-box-shadow: 0 0px 2px rgba(0,0,0,0.4);
31
+ }
32
+
33
+ .button:active {
34
+ background: -moz-linear-gradient(100% 100% 90deg, #fff, #eee);
35
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#eee), to(#fff));
36
+ }
37
+
38
+ .button:active, .button:focus {
39
+ outline: none;
40
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ html5doctor.com Reset Stylesheet
3
+ v1.6
4
+ Last Updated: 2010-08-18
5
+ Author: Richard Clark - http://richclarkdesign.com
6
+ Twitter: @rich_clark
7
+ */
8
+
9
+ html, body, div, span, object, iframe,
10
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
11
+ abbr, address, cite, code,
12
+ del, dfn, em, img, ins, kbd, q, samp,
13
+ small, strong, sub, sup, var,
14
+ b, i,
15
+ dl, dt, dd, ol, ul, li,
16
+ fieldset, form, label, legend,
17
+ table, caption, tbody, tfoot, thead, tr, th, td,
18
+ article, aside, canvas, details, figcaption, figure,
19
+ footer, header, hgroup, menu, nav, section, summary,
20
+ time, mark, audio, video {
21
+ margin:0;
22
+ padding:0;
23
+ border:0;
24
+ outline:0;
25
+ font-size:100%;
26
+ vertical-align:baseline;
27
+ background:transparent;
28
+ }
29
+
30
+ body {
31
+ line-height:1;
32
+ }
33
+
34
+ article,aside,details,figcaption,figure,
35
+ footer,header,hgroup,menu,nav,section {
36
+ display:block;
37
+ }
38
+
39
+ nav ul {
40
+ list-style:none;
41
+ }
42
+
43
+ blockquote, q {
44
+ quotes:none;
45
+ }
46
+
47
+ blockquote:before, blockquote:after,
48
+ q:before, q:after {
49
+ content:'';
50
+ content:none;
51
+ }
52
+
53
+ a {
54
+ margin:0;
55
+ padding:0;
56
+ font-size:100%;
57
+ vertical-align:baseline;
58
+ background:transparent;
59
+ }
60
+
61
+ /* change colours to suit your needs */
62
+ ins {
63
+ background-color:#ff9;
64
+ color:#000;
65
+ text-decoration:none;
66
+ }
67
+
68
+ /* change colours to suit your needs */
69
+ mark {
70
+ background-color:#ff9;
71
+ color:#000;
72
+ font-style:italic;
73
+ font-weight:bold;
74
+ }
75
+
76
+ del {
77
+ text-decoration: line-through;
78
+ }
79
+
80
+ abbr[title], dfn[title] {
81
+ border-bottom:1px dotted inherit;
82
+ cursor:help;
83
+ }
84
+
85
+ table {
86
+ border-collapse:collapse;
87
+ border-spacing:0;
88
+ }
89
+
90
+ /* change border colour to suit your needs */
91
+ hr {
92
+ display:block;
93
+ height:1px;
94
+ border:0;
95
+ border-top:1px solid #cccccc;
96
+ margin:1em 0;
97
+ padding:0;
98
+ }
99
+
100
+ input, select {
101
+ vertical-align:middle;
102
+ }
103
+
104
+ header, nav, section, aside, footer { display: block; }
@@ -0,0 +1 @@
1
+ html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}nav ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted inherit;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #cccccc;margin:1em 0;padding:0}input,select{vertical-align:middle}header,nav,section,aside,footer{display:block}.button,.button:visited{color:#333;display:inline-block;text-decoration:none;font-weight:normal;line-height:1;font-size:0.9em;-moz-border-radius:5px;-webkit-border-radius:5px;-moz-box-shadow:0 0px 2px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 0px 2px rgba(0, 0, 0, 0.2);text-shadow:0 -1px 1px white;background:-moz-linear-gradient(100% 100% 90deg, #eeeeee, white);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#eeeeee));position:relative;cursor:pointer;border:0;padding:4px 10px}.button:hover{color:#000;-moz-box-shadow:0 0px 2px rgba(0, 0, 0, 0.4);-webkit-box-shadow:0 0px 2px rgba(0, 0, 0, 0.4)}.button:active{background:-moz-linear-gradient(100% 100% 90deg, white, #eeeeee);background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#eeeeee), to(white))}.button:active,.button:focus{outline:none}a{color:#a4d61a;text-decoration:none}a:hover{color:#bae73c;text-decoration:none}article{margin-bottom:1em;line-height:150%;max-width:30em}body{font-family:Helvetica,Arial,sans-serif;font-size:1.2em;background:white;color:#595959;margin:0;text-rendering:optimizeLegibility}article h2{font-size:2em}article h3{font-size:1.5em}label{font-weight:bold;display:block;margin-bottom:0.3em}.home{padding:1em}.manage{padding:0.4em}.manage section{width:80%}#logo,#small_logo{display:block;text-indent:-9000em}#logo{background:url(/images/hazel.png) no-repeat top left;width:600px;height:270px;margin-bottom:1em}#small_logo{float:right;background:url(/images/hazel_icon.png) no-repeat top left;width:100px;height:100px;margin-bottom:1.5em}#logo:focus,#small_logo:focus{outline:none}
@@ -0,0 +1,81 @@
1
+ @import "reset";
2
+ @import "buttons";
3
+
4
+ $link_color: #a4d61a;
5
+ $background_color: #fff;
6
+ $header_bg_color: #f7f6f3;
7
+
8
+ a {
9
+ color : $link_color;
10
+ text-decoration : none;
11
+ }
12
+
13
+ a:hover {
14
+ color : lighten($link_color, 10);
15
+ text-decoration : none;
16
+ }
17
+
18
+ article {
19
+ margin-bottom : 1em;
20
+ line-height : 150%;
21
+ max-width : 30em;
22
+ }
23
+
24
+ body {
25
+ font-family : Helvetica,Arial,sans-serif;
26
+ font-size : 1.2em;
27
+ background : $background_color;
28
+ color : darken($background_color, 65);
29
+ margin : 0;
30
+ text-rendering : optimizeLegibility;
31
+ }
32
+
33
+ article {
34
+ h2 {
35
+ font-size: 2em;
36
+ }
37
+ h3 {
38
+ font-size: 1.5em;
39
+ }
40
+ }
41
+
42
+ label {
43
+ font-weight : bold;
44
+ display : block;
45
+ margin-bottom : 0.3em;
46
+ }
47
+
48
+ .home {
49
+ padding : 1em;
50
+ }
51
+
52
+ .manage {
53
+ padding : 0.4em;
54
+ section {
55
+ width : 80%;
56
+ }
57
+ }
58
+
59
+ #logo, #small_logo {
60
+ display : block;
61
+ text-indent : -9000em;
62
+ }
63
+
64
+ #logo {
65
+ background : url(/images/hazel.png) no-repeat top left;
66
+ width : 600px;
67
+ height : 270px;
68
+ margin-bottom : 1em;
69
+ }
70
+
71
+ #small_logo {
72
+ float : right;
73
+ background : url(/images/hazel_icon.png) no-repeat top left;
74
+ width : 100px;
75
+ height : 100px;
76
+ margin-bottom : 1.5em;
77
+ }
78
+
79
+ #logo:focus, #small_logo:focus {
80
+ outline : none;
81
+ }
@@ -0,0 +1,8 @@
1
+ :plain
2
+ javascript:hazel=window.open(
3
+ '#{url}',
4
+ '#{window_name}',
5
+ 'height=#{height},width=#{width}');
6
+ if (window.focus) { hazel.focus(); }
7
+
8
+
@@ -0,0 +1,10 @@
1
+ %header
2
+ %h1#logo
3
+ Hazel
4
+ %section
5
+ %article
6
+ %label Protip!
7
+ Drag the
8
+ %a.button{ :href => bookmarklet } Hazel
9
+ bookmarklet to your bookmarks bar to easily manage your asset files.
10
+
@@ -0,0 +1,11 @@
1
+ !!!5
2
+ %html{ :lang => 'en' }
3
+ %head
4
+ %meta{ :charset => 'utf-8' }
5
+ %link{ :rel => "shortcut icon", :href => "/favicon.ico", :type => "image/x-icon" }
6
+ %link{ :rel => "stylesheet", :href => "/stylesheets/all.css", :type => "text/css" }
7
+ /[if lt IE 9]
8
+ %script{:src => "http://html5shiv.googlecode.com/svn/trunk/html5.js"}
9
+ %title Hazel
10
+ %body{ :class => body_class }
11
+ = yield
@@ -0,0 +1,7 @@
1
+ %header
2
+ %h1#small_logo
3
+ Hazel
4
+ %section
5
+ %article
6
+ %h2
7
+ TODO :)
data/bin/hazel ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require "hazel/cli"
5
+ rescue LoadError
6
+ lib_path = File.expand_path('../../lib', __FILE__)
7
+ $:.unshift(lib_path)
8
+ require "hazel/cli"
9
+ end
10
+
11
+ Hazel::CLI.start
data/lib/hazel/cli.rb ADDED
@@ -0,0 +1,30 @@
1
+ $:.unshift(File.expand_path('..', __FILE__))
2
+
3
+ require 'hazel/version'
4
+ require 'rubygems'
5
+ require 'thor'
6
+
7
+ module Hazel
8
+ class CLI < Thor
9
+ include Thor::Base
10
+ include Thor::Actions
11
+
12
+ desc 'setup [PATH]', 'Setup a new Hazel instance'
13
+ def setup(path = "hazel")
14
+ if File.exists? path
15
+ puts "#{path} already exists. Exiting."
16
+ else
17
+ app_files = File.expand_path('../../../app', __FILE__)
18
+
19
+ Hazel::CLI.source_root(app_files)
20
+
21
+ directory(app_files, path)
22
+ end
23
+ end
24
+
25
+ desc :version, "The current version number (#{VERSION::STRING})"
26
+ def version
27
+ puts VERSION::STRING
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,9 @@
1
+ module Hazel
2
+ module VERSION
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hazel
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Peter Hellberg
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-11-15 00:00:00 +01:00
19
+ default_executable: hazel
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: haml
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 41
30
+ segments:
31
+ - 3
32
+ - 0
33
+ - 23
34
+ version: 3.0.23
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: sinatra
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 19
46
+ segments:
47
+ - 1
48
+ - 1
49
+ - 0
50
+ version: 1.1.0
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ description: Hazel is a Sinatra application that handles asset management, mainly images, for a number of (predefined) users.
54
+ email: peter@c7.se
55
+ executables:
56
+ - hazel
57
+ extensions: []
58
+
59
+ extra_rdoc_files:
60
+ - README.rdoc
61
+ - MIT-LICENSE
62
+ files:
63
+ - lib/hazel/cli.rb
64
+ - lib/hazel/version.rb
65
+ - app/config.ru
66
+ - app/Gemfile
67
+ - app/Gemfile.lock
68
+ - app/hazel.rb
69
+ - app/public/favicon.ico
70
+ - app/public/images/hazel.png
71
+ - app/public/images/hazel_icon.png
72
+ - app/public/images/hazel_medium.png
73
+ - app/public/images/hazel_small.png
74
+ - app/public/stylesheets/_buttons.scss
75
+ - app/public/stylesheets/_reset.scss
76
+ - app/public/stylesheets/all.css
77
+ - app/public/stylesheets/all.scss
78
+ - app/views/bookmarklet.haml
79
+ - app/views/index.haml
80
+ - app/views/layout.haml
81
+ - app/views/manage.haml
82
+ - MIT-LICENSE
83
+ - README.rdoc
84
+ - bin/hazel
85
+ has_rdoc: true
86
+ homepage: http://c7.github.com/hazel
87
+ licenses:
88
+ - MIT-LICENSE
89
+ post_install_message:
90
+ rdoc_options:
91
+ - --main
92
+ - README.rdoc
93
+ - --charset=UTF-8
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 3
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ requirements: []
115
+
116
+ rubyforge_project: hazel
117
+ rubygems_version: 1.3.7
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Simple asset management for the rest of us.
121
+ test_files: []
122
+