mint 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +23 -21
  2. data/bin/mint +40 -2
  3. data/lib/mint.rb +5 -5
  4. metadata +3 -2
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  *The following is a **rough draft** of the current Mint design, along with my future plans for the library and tool.*
2
2
 
3
- Possible taglines
4
- -----------------
3
+ If I believed in slogans...
4
+ ---------------------------
5
5
 
6
6
  I don't actually believe in tag lines, but if Mint were to have one, it might be one of these:
7
7
 
@@ -250,6 +250,8 @@ Normally a style will go best with its complement layout. However, layouts and s
250
250
  V. The `mint` command
251
251
  ---------------------
252
252
 
253
+ *The `mint` command is not yet functional.*
254
+
253
255
  ### The basic `mint` command ###
254
256
 
255
257
  The easiest Mint command doesn't require configuration. It will transform all of your Documents into HTML and link all of them to the default stylesheet, which will be output in the same directory as the source documents.
@@ -387,7 +389,7 @@ Eventually, I want this to include multiple output formats, like HTML4, HTML5, P
387
389
 
388
390
  When that does happen, you'll also be able to set the default version of the document that will open using:
389
391
 
390
- mint set --package-default html5
392
+ mint set --package-default html5
391
393
 
392
394
  ### My dreams about Mint, and where it could go ###
393
395
 
@@ -404,31 +406,31 @@ For this last command, Mint would upload an HTML to a preconfigured FTP server o
404
406
 
405
407
  The configuration file could look something like:
406
408
 
407
- services:
408
- - twitter:
409
- authorization: OAuth
410
- key: etc.
409
+ services:
410
+ - twitter:
411
+ authorization: OAuth
412
+ key: etc.
411
413
 
412
- - openid:
413
- url: http://davejacobs.myopenid.com/
414
- authorization: OAuth
415
- key: etc.
414
+ - openid:
415
+ url: http://davejacobs.myopenid.com/
416
+ authorization: OAuth
417
+ key: etc.
416
418
 
417
419
  Or you could publish multiple output formats, and to multiple locations:
418
420
 
419
- mint publish --ftp default
420
- mint publish --blog personal
421
+ mint publish --ftp default
422
+ mint publish --blog personal
421
423
 
422
424
  The configuration:
423
425
 
424
- publishers:
425
- - ftp:
426
- - default:
427
- server: ftp.provider.com
428
- security: sftp
429
- directory: /home/USERNAME/example.com/documents
430
- - blog:
431
- - personal:
426
+ publishers:
427
+ - ftp:
428
+ - default:
429
+ server: ftp.provider.com
430
+ security: sftp
431
+ directory: /home/USERNAME/example.com/documents
432
+ - blog:
433
+ - personal:
432
434
 
433
435
  Or you could connect to a service to protect your intellectual property rights:
434
436
 
data/bin/mint CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # A script for harnessing Mint at the commandline
3
3
 
4
- $:.unshift File.join(File.dirname(File.readlink(__FILE__)), '..', 'lib')
4
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
5
5
 
6
6
  require 'rubygems'
7
7
  require 'mint'
@@ -39,4 +39,42 @@ module CommandLine
39
39
  end
40
40
  end
41
41
 
42
- CommandLine::DocumentContext.mint_document ARGV[0]
42
+ # --layout, -L
43
+ # --style, -S
44
+ # --root, -R
45
+ # --destination, -D
46
+ # --name, -N
47
+ # --style-destination
48
+ # --style-name
49
+
50
+ options_with_parameters = {
51
+ :template => ['T', 'template'],
52
+ :layout => ['L', 'layout'],
53
+ :style => ['S', 'style'],
54
+ :root => ['R', 'root'],
55
+ :destination => ['D', 'destination'],
56
+ :name => ['N', 'name'],
57
+ :style_destination => ['E', 'style-destination'],
58
+ :style_name => ['A', 'style-name']
59
+ }
60
+
61
+ options_without_parameters = [ :verbose, :simulation ]
62
+
63
+ config = {}
64
+
65
+ optparse = OptionParser.new do |opts|
66
+ opts.banner = 'Usage: mint source [destination] [options]'
67
+
68
+ options_with_parameters.each do |k,v|
69
+ v[0] = "-#{v[0]}"
70
+ v[1] = "--#{v[1]} PARAM"
71
+
72
+ opts.on v[0], v[1], 'Description goes here' do |p|
73
+ config[k] = p
74
+ end
75
+ end
76
+ end
77
+
78
+ puts optparse.parse!
79
+
80
+ CommandLine::DocumentContext.mint_document ARGV[0], config
@@ -307,10 +307,10 @@ module Mint
307
307
  # associate a style with a Document (a style that can be called
308
308
  # from layouts via `stylesheet`) without regenerating that
309
309
  # stylesheet every time Mint runs.
310
- def mint(render_style?=true)
310
+ def mint(render_style=true)
311
311
 
312
312
  resources = [self]
313
- resources << style if render_style?
313
+ resources << style if render_style
314
314
 
315
315
  resources.compact.each do |r|
316
316
  dest = @root + r.destination + r.name
@@ -345,7 +345,7 @@ module Mint
345
345
  $project_default_opts = {}
346
346
 
347
347
  class ProjectDocument < Document
348
- attr_accessor :changed?
348
+ attr_accessor :changed
349
349
  end
350
350
 
351
351
  class Project
@@ -367,8 +367,8 @@ module Mint
367
367
 
368
368
  def mint
369
369
  @documents.each_index do |i|
370
- render_style? = (i == 0)
371
- @documents[i].mint(render_style?)
370
+ render_style = (i == 0)
371
+ @documents[i].mint(render_style)
372
372
  end
373
373
  end
374
374
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mint
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- version: "0.1"
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - David Jacobs