pagoda-jekyll 0.0.6 → 0.0.7

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.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/bin/pagoda +40 -6
  3. data/pagoda.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGJlMzkxOWQ0OGExYzlkM2YwMzE4Y2E0NjIwOWY0Nzc4MWE1NjNjZg==
4
+ YWYwMTVlOGMwNjRjNTdlN2Q4MGI1ZmJkMDE2YmUxNTdlNDYwYjliNQ==
5
5
  data.tar.gz: !binary |-
6
- MjdmYWQ2MGIxY2JmYTlhYjk2YWIwMzU2YjI2OTE0OTMyYWM4NDRmOQ==
6
+ OGU0YTY4NTllYzE0MjNhYzQ5NGFhZDAyYjhmMDZkZDk4MzUyNTY2Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODlhOGFmOGEwZTQzMTRhNGVlNDZhNWJkYzgwMjlkOTYwNzdmZmY2MTZhNDFm
10
- ODBkMTc2NmNkMWI3ZTU2MjI4NWRhODljZTYwYWYzNjU5YzhlMzg2OWVmNjli
11
- MGQ0MGFlYmFhODM3YjNkMDU4MDMwYWM2ZWM2ZTY1Njk3MWE3NzQ=
9
+ ODYxZDU2NjUwZGQwN2M3MWIwOGY3YjJiNzE1NTUyYzUzYzcwYmRlMjBlYWZl
10
+ OTdiMTU4MWI1ZWI4NTlhZWJkMWU4NTg3YmQ1ODIyZTAyNTQ1NGNjMjIyMjUw
11
+ Y2M1Yzk1ZGVkY2NkMTcxM2Q1MDY1MzZlZmNkZGIxYjdlYWZmZDc=
12
12
  data.tar.gz: !binary |-
13
- ZjZkMTY3Y2M2ZWZlOTkyOTg1ZTQ0Yzk5YWQ0NWRhNmVhOGVlMWQ2YjdmMGNj
14
- ZGQ1ZjhjMGM1ZGE5OGU3ZjEyYTAyYjAzZTA4OWRmOGQ0ZmZhYjY0YmUwMTFh
15
- MDAxODk3MGUwNzg4ZTc4ZDFjZDhmZTNlYjZlOTQ5NWViMzhiN2Y=
13
+ ODIyZDkzY2Y4MjVkMGE1OWZmZDkxMzdkZjY5MjYwMjE0Y2U2NTQ0N2E2ZmRh
14
+ MTlkODkxZGE2MjlkOTE5N2Y2YzYwYTY4MDU3MDA3OTk5ODY4Mjk1MzJmMmU5
15
+ N2FkNWMwYTQwMTAzN2E4MzYzMGRiYjg4NzI3YWUzNjViNjQ1ZmM=
data/bin/pagoda CHANGED
@@ -2,14 +2,48 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
4
4
 
5
+
6
+
7
+ help = <<HELP
8
+ Pagoda is a Jekyll editor
9
+
10
+ Basic Command Line Usage:
11
+ pagoda [OPTIONS] [PATH]
12
+
13
+ PATH The path to the Jekyll repository (default .).
14
+
15
+ Options:
16
+ HELP
17
+
18
+ require 'optparse'
5
19
  require 'rubygems'
6
20
  require 'pagoda/app'
7
21
 
8
- #TODO Use options parser
9
- if not ARGV.first
10
- puts "Enter a valid blog path"
11
- else
12
- Shwedagon::App.set :blog, ARGV.first
22
+ options = { 'port' => 4567, 'bind' => '0.0.0.0' }
23
+
24
+ opts = OptionParser.new do |opts|
25
+ opts.banner = help
26
+
27
+ opts.on("--port [PORT]", "Bind port (default 4567).") do |port|
28
+ options['port'] = port.to_i
29
+ end
30
+ end
31
+
32
+ # Read command line options into `options` hash
33
+ begin
34
+ opts.parse!
35
+ jekyll_path = ARGV[0] || Dir.pwd
36
+
37
+ if not File.directory? jekyll_path
38
+ raise OptionParser::InvalidOption.new "Directory '#{jekyll_path}' not found"
39
+ end
40
+
41
+ rescue OptionParser::InvalidOption
42
+ puts "pagoda: #{$!.message}"
43
+ puts "pagoda: try 'pagoda --help' for more information"
44
+ exit
13
45
  end
14
46
 
15
- Shwedagon::App.run!({})
47
+ Shwedagon::App.set :blog, ARGV.first
48
+
49
+ Shwedagon::App.run!(options)
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'pagoda-jekyll'
8
- s.version = '0.0.6'
8
+ s.version = '0.0.7'
9
9
  s.date = '2013-05-04'
10
10
  s.rubyforge_project = 'pagoda-jekyll'
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagoda-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alagu