teejayvanslyke-sassafras 0.1.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.
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2008-12-14
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/License.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 FIXME full name
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest.txt ADDED
@@ -0,0 +1,32 @@
1
+ History.txt
2
+ License.txt
3
+ Manifest.txt
4
+ PostInstall.txt
5
+ README.txt
6
+ Rakefile
7
+ bin/sassafras
8
+ config/hoe.rb
9
+ config/requirements.rb
10
+ examples/analogous_red.html
11
+ examples/split_complementary_blue.html
12
+ lib/sassafras.rb
13
+ lib/sassafras/swatch.html.erb
14
+ lib/sassafras/version.rb
15
+ script/console
16
+ script/destroy
17
+ script/generate
18
+ script/txt2html
19
+ setup.rb
20
+ spec/sassafras_spec.rb
21
+ spec/spec.opts
22
+ spec/spec_helper.rb
23
+ tasks/deployment.rake
24
+ tasks/environment.rake
25
+ tasks/examples.rake
26
+ tasks/rspec.rake
27
+ tasks/website.rake
28
+ website/index.html
29
+ website/index.txt
30
+ website/javascripts/rounded_corners_lite.inc.js
31
+ website/stylesheets/screen.css
32
+ website/template.html.erb
data/PostInstall.txt ADDED
@@ -0,0 +1,3 @@
1
+
2
+ For more information on sassafras, see http://github.com/teejayvanslyke/sassafras/
3
+
data/README.txt ADDED
@@ -0,0 +1,86 @@
1
+ = sassafras
2
+
3
+ * http://www.elctech.com/projects/instant-sass-color-palettes-with-sassafras
4
+
5
+ == DESCRIPTION:
6
+
7
+ After spending hours copying and pasting hex values into my Sass stylesheets,
8
+ I knew there had to be a better way. Enter Sassafras, the Sass color scheme
9
+ generator.
10
+
11
+ Sassafras will generate any of the following types of color schemes and create
12
+ logically-named Sass variables for varying lightnesses:
13
+
14
+ * basic
15
+ * complementary
16
+ * analogous
17
+ * triadic
18
+ * split complementary
19
+ * rectangle
20
+ * square
21
+
22
+ == FEATURES/PROBLEMS:
23
+
24
+ == SYNOPSIS:
25
+
26
+ Generate basic variants of red:
27
+
28
+ $ sassafras -b red
29
+
30
+ # Generated by Sassafras
31
+ # base
32
+ !base_light = #ff8080
33
+ !base_darkest = #1a0000
34
+ !base_dark = #800000
35
+ !base_darker = #4d0000
36
+ !base_lightest = #ffe6e6
37
+ !base_mid = #ff0000
38
+ !base_lighter = #ffb3b3
39
+
40
+ Generate basic variants of red and green:
41
+
42
+ $ sassafras -t complementary -b red
43
+
44
+ Sassafras can also generate an HTML reference sheet with color swatches:
45
+
46
+ $ sassafras -t split_complementary -b blue -f html
47
+
48
+ For more information on the various types of color schemes supported by Sassafras,
49
+ please see the color theory tutorial on which Sassafras was based at http://www.tigercolor.com/color-lab/color-theory/color-theory-intro.htm
50
+
51
+ == REQUIREMENTS:
52
+
53
+ * color-tools
54
+ * activesupport
55
+
56
+ == INSTALL:
57
+
58
+ Note: Make sure you're using RubyGems >= 1.2.0.
59
+
60
+ $ sudo gem sources -a http://gems.github.com
61
+ $ sudo gem install teejayvanslyke-sassafras
62
+
63
+ == LICENSE:
64
+
65
+ (The MIT License)
66
+
67
+ Copyright (c) 2008 FIX
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining
70
+ a copy of this software and associated documentation files (the
71
+ 'Software'), to deal in the Software without restriction, including
72
+ without limitation the rights to use, copy, modify, merge, publish,
73
+ distribute, sublicense, and/or sell copies of the Software, and to
74
+ permit persons to whom the Software is furnished to do so, subject to
75
+ the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be
78
+ included in all copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
81
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
82
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
83
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
84
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
85
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
86
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'config/requirements'
2
+ require 'config/hoe' # setup Hoe + all gem configuration
3
+
4
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
data/bin/sassafras ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created on 2008-12-14.
4
+ # Copyright (c) 2008. All rights reserved.
5
+
6
+ begin
7
+ require 'rubygems'
8
+ require File.dirname(__FILE__) + '/../lib/sassafras/version.rb'
9
+ require File.dirname(__FILE__) + '/../lib/sassafras'
10
+ rescue LoadError
11
+ # no rubygems to load, so we fail silently
12
+ end
13
+
14
+ require 'optparse'
15
+
16
+ # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
17
+
18
+ OPTIONS = {
19
+ :type => 'basic',
20
+ :format => 'sass'
21
+ }
22
+ MANDATORY_OPTIONS = %w(base)
23
+
24
+ parser = OptionParser.new do |opts|
25
+ opts.banner = <<BANNER
26
+
27
+ Sassafras v#{Sassafras::VERSION::STRING} makes you sexy!
28
+
29
+ Usage: #{File.basename($0)} [options]
30
+
31
+ Options are:
32
+ BANNER
33
+ opts.separator ""
34
+ opts.on("-b", "--base=BASE", String,
35
+ "The base color for the color theme",
36
+ "Required.") { |OPTIONS[:base]| }
37
+ opts.on("-t", "--type=TYPE", String,
38
+ "Type of color scheme (basic|complementary|analogous|triadic|split_complementary|rectangle|square)",
39
+ "Default: basic") { |OPTIONS[:type]| }
40
+ opts.on('-f', '--format=FORMAT', String,
41
+ "Format (sass|html)",
42
+ "Default: sass") { |OPTIONS[:format]| }
43
+ opts.on("-h", "--help",
44
+ "Show this help message.") { puts opts; exit }
45
+ opts.parse!(ARGV)
46
+
47
+ if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
48
+ puts opts; exit
49
+ end
50
+ end
51
+
52
+ path = OPTIONS[:path]
53
+
54
+ theme = Sassafras::Theme.create(OPTIONS[:type], OPTIONS[:base])
55
+
56
+ if OPTIONS[:format] == 'html'
57
+ Sassafras::HTMLSwatch.new(theme)
58
+ else
59
+ puts theme.sass
60
+ end
61
+
62
+
data/config/hoe.rb ADDED
@@ -0,0 +1,74 @@
1
+ require 'sassafras/version'
2
+
3
+ AUTHOR = 'T.J. VanSlyke' # can also be an array of Authors
4
+ EMAIL = "tj@elctech.com"
5
+ DESCRIPTION = "Sass color scheme generator"
6
+ GEM_NAME = 'sassafras' # what ppl will type to install your gem
7
+ RUBYFORGE_PROJECT = 'sassafras' # The unix name for your project
8
+ HOMEPATH = "http://github.com/teejayvanslyke/#{RUBYFORGE_PROJECT}"
9
+ DOWNLOAD_PATH = "http://github.com/teejayvanslyke/#{RUBYFORGE_PROJECT}"
10
+ EXTRA_DEPENDENCIES = [
11
+ [ 'color-tools', '>= 1.3.0' ],
12
+ [ 'activesupport', '>= 1.3.0' ]
13
+ ] # An array of rubygem dependencies [name, version]
14
+
15
+ @config_file = "~/.rubyforge/user-config.yml"
16
+ @config = nil
17
+ RUBYFORGE_USERNAME = "unknown"
18
+ def rubyforge_username
19
+ unless @config
20
+ begin
21
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
22
+ rescue
23
+ puts <<-EOS
24
+ ERROR: No rubyforge config file found: #{@config_file}
25
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
26
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
27
+ EOS
28
+ exit
29
+ end
30
+ end
31
+ RUBYFORGE_USERNAME.replace @config["username"]
32
+ end
33
+
34
+
35
+ REV = nil
36
+ # UNCOMMENT IF REQUIRED:
37
+ # REV = YAML.load(`svn info`)['Revision']
38
+ VERS = Sassafras::VERSION::STRING + (REV ? ".#{REV}" : "")
39
+ RDOC_OPTS = ['--quiet', '--title', 'sassafras documentation',
40
+ "--opname", "index.html",
41
+ "--line-numbers",
42
+ "--main", "README",
43
+ "--inline-source"]
44
+
45
+ class Hoe
46
+ def extra_deps
47
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
48
+ @extra_deps
49
+ end
50
+ end
51
+
52
+ # Generate all the Rake tasks
53
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
54
+ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
55
+ p.developer(AUTHOR, EMAIL)
56
+ p.description = DESCRIPTION
57
+ p.summary = DESCRIPTION
58
+ p.url = HOMEPATH
59
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
60
+ p.test_globs = ["test/**/test_*.rb"]
61
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
62
+
63
+ # == Optional
64
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
65
+ #p.extra_deps = EXTRA_DEPENDENCIES
66
+
67
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
68
+ end
69
+
70
+ CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
71
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
72
+ $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
73
+ $hoe.rsync_args = '-av --delete --ignore-errors'
74
+ $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
@@ -0,0 +1,15 @@
1
+ require 'fileutils'
2
+ include FileUtils
3
+
4
+ require 'rubygems'
5
+ %w[rake hoe newgem rubigen].each do |req_gem|
6
+ begin
7
+ require req_gem
8
+ rescue LoadError
9
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
+ puts "Installation: gem install #{req_gem} -y"
11
+ exit
12
+ end
13
+ end
14
+
15
+ $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -0,0 +1,298 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
+ <head>
5
+ <title>Sassafras Swatch</title>
6
+ <meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
7
+ <meta http-equiv="imagetoolbar" content="no" />
8
+ <meta name="distribution" content="all" />
9
+ <meta name="robots" content="all" />
10
+ <meta name="resource-type" content="document" />
11
+ <meta name="MSSmartTagsPreventParsing" content="true" />
12
+ <style type="text/css">
13
+ body {
14
+ font-family: Helvetica, Verdana, Sans-serif;
15
+ text-align: center;
16
+ }
17
+ .container {
18
+ width: 600px;
19
+ }
20
+ th {
21
+ text-align: left;
22
+ }
23
+ td.swatch {
24
+ width: 10em;
25
+ }
26
+ td.hex {
27
+ font-family: "Courier New", Fixed;
28
+ }
29
+ pre {
30
+ text-align: left;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body>
35
+ <div align="center">
36
+ <div class="container">
37
+ <h1>Sassafras</h1>
38
+ <table width="100%">
39
+
40
+ <tr>
41
+ <th colspan="3">accent</td>
42
+ </tr>
43
+
44
+ <tr>
45
+ <td>
46
+ dark
47
+ </td>
48
+ <td class="hex">
49
+ #802a00
50
+ </td>
51
+ <td class="swatch" style="background-color: #802a00;">&nbsp;</td>
52
+ </tr>
53
+
54
+ <tr>
55
+ <td>
56
+ darker
57
+ </td>
58
+ <td class="hex">
59
+ #4d1900
60
+ </td>
61
+ <td class="swatch" style="background-color: #4d1900;">&nbsp;</td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <td>
66
+ light
67
+ </td>
68
+ <td class="hex">
69
+ #ffaa80
70
+ </td>
71
+ <td class="swatch" style="background-color: #ffaa80;">&nbsp;</td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td>
76
+ lightest
77
+ </td>
78
+ <td class="hex">
79
+ #ffeee6
80
+ </td>
81
+ <td class="swatch" style="background-color: #ffeee6;">&nbsp;</td>
82
+ </tr>
83
+
84
+ <tr>
85
+ <td>
86
+ lighter
87
+ </td>
88
+ <td class="hex">
89
+ #ffccb3
90
+ </td>
91
+ <td class="swatch" style="background-color: #ffccb3;">&nbsp;</td>
92
+ </tr>
93
+
94
+ <tr>
95
+ <td>
96
+ mid
97
+ </td>
98
+ <td class="hex">
99
+ #ff5500
100
+ </td>
101
+ <td class="swatch" style="background-color: #ff5500;">&nbsp;</td>
102
+ </tr>
103
+
104
+ <tr>
105
+ <td>
106
+ darkest
107
+ </td>
108
+ <td class="hex">
109
+ #1a0800
110
+ </td>
111
+ <td class="swatch" style="background-color: #1a0800;">&nbsp;</td>
112
+ </tr>
113
+
114
+
115
+ <tr>
116
+ <th colspan="3">support</td>
117
+ </tr>
118
+
119
+ <tr>
120
+ <td>
121
+ dark
122
+ </td>
123
+ <td class="hex">
124
+ #80002a
125
+ </td>
126
+ <td class="swatch" style="background-color: #80002a;">&nbsp;</td>
127
+ </tr>
128
+
129
+ <tr>
130
+ <td>
131
+ darker
132
+ </td>
133
+ <td class="hex">
134
+ #4d0019
135
+ </td>
136
+ <td class="swatch" style="background-color: #4d0019;">&nbsp;</td>
137
+ </tr>
138
+
139
+ <tr>
140
+ <td>
141
+ light
142
+ </td>
143
+ <td class="hex">
144
+ #ff80aa
145
+ </td>
146
+ <td class="swatch" style="background-color: #ff80aa;">&nbsp;</td>
147
+ </tr>
148
+
149
+ <tr>
150
+ <td>
151
+ lightest
152
+ </td>
153
+ <td class="hex">
154
+ #ffe6ee
155
+ </td>
156
+ <td class="swatch" style="background-color: #ffe6ee;">&nbsp;</td>
157
+ </tr>
158
+
159
+ <tr>
160
+ <td>
161
+ lighter
162
+ </td>
163
+ <td class="hex">
164
+ #ffb3cc
165
+ </td>
166
+ <td class="swatch" style="background-color: #ffb3cc;">&nbsp;</td>
167
+ </tr>
168
+
169
+ <tr>
170
+ <td>
171
+ mid
172
+ </td>
173
+ <td class="hex">
174
+ #ff0055
175
+ </td>
176
+ <td class="swatch" style="background-color: #ff0055;">&nbsp;</td>
177
+ </tr>
178
+
179
+ <tr>
180
+ <td>
181
+ darkest
182
+ </td>
183
+ <td class="hex">
184
+ #1a0008
185
+ </td>
186
+ <td class="swatch" style="background-color: #1a0008;">&nbsp;</td>
187
+ </tr>
188
+
189
+
190
+ <tr>
191
+ <th colspan="3">base</td>
192
+ </tr>
193
+
194
+ <tr>
195
+ <td>
196
+ dark
197
+ </td>
198
+ <td class="hex">
199
+ #800000
200
+ </td>
201
+ <td class="swatch" style="background-color: #800000;">&nbsp;</td>
202
+ </tr>
203
+
204
+ <tr>
205
+ <td>
206
+ darker
207
+ </td>
208
+ <td class="hex">
209
+ #4d0000
210
+ </td>
211
+ <td class="swatch" style="background-color: #4d0000;">&nbsp;</td>
212
+ </tr>
213
+
214
+ <tr>
215
+ <td>
216
+ light
217
+ </td>
218
+ <td class="hex">
219
+ #ff8080
220
+ </td>
221
+ <td class="swatch" style="background-color: #ff8080;">&nbsp;</td>
222
+ </tr>
223
+
224
+ <tr>
225
+ <td>
226
+ lightest
227
+ </td>
228
+ <td class="hex">
229
+ #ffe6e6
230
+ </td>
231
+ <td class="swatch" style="background-color: #ffe6e6;">&nbsp;</td>
232
+ </tr>
233
+
234
+ <tr>
235
+ <td>
236
+ lighter
237
+ </td>
238
+ <td class="hex">
239
+ #ffb3b3
240
+ </td>
241
+ <td class="swatch" style="background-color: #ffb3b3;">&nbsp;</td>
242
+ </tr>
243
+
244
+ <tr>
245
+ <td>
246
+ mid
247
+ </td>
248
+ <td class="hex">
249
+ #ff0000
250
+ </td>
251
+ <td class="swatch" style="background-color: #ff0000;">&nbsp;</td>
252
+ </tr>
253
+
254
+ <tr>
255
+ <td>
256
+ darkest
257
+ </td>
258
+ <td class="hex">
259
+ #1a0000
260
+ </td>
261
+ <td class="swatch" style="background-color: #1a0000;">&nbsp;</td>
262
+ </tr>
263
+
264
+
265
+ </table>
266
+ <pre># Generated by Sassafras
267
+ # accent
268
+ !accent_dark = #802a00
269
+ !accent_darker = #4d1900
270
+ !accent_light = #ffaa80
271
+ !accent_lightest = #ffeee6
272
+ !accent_lighter = #ffccb3
273
+ !accent_mid = #ff5500
274
+ !accent_darkest = #1a0800
275
+
276
+ # support
277
+ !support_dark = #80002a
278
+ !support_darker = #4d0019
279
+ !support_light = #ff80aa
280
+ !support_lightest = #ffe6ee
281
+ !support_lighter = #ffb3cc
282
+ !support_mid = #ff0055
283
+ !support_darkest = #1a0008
284
+
285
+ # base
286
+ !base_dark = #800000
287
+ !base_darker = #4d0000
288
+ !base_light = #ff8080
289
+ !base_lightest = #ffe6e6
290
+ !base_lighter = #ffb3b3
291
+ !base_mid = #ff0000
292
+ !base_darkest = #1a0000
293
+
294
+ </pre>
295
+ </div>
296
+ </div>
297
+ </body>
298
+ </html>