jekyll-generator 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.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/bin/jgen +37 -0
  3. metadata +45 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTBlMWNmNTg2MjJjNTA5NjdjNTM4OTM3ZGRkYzZhZmI1NWU5ZTJmOQ==
5
+ data.tar.gz: !binary |-
6
+ MWUwMzdlMDJjNTdiM2I4NWIzNDZkYmI4NDkwMTBhNTMxODQyYTNhYg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZmNlMmI0MDU4ODMzMGNhOGIxYjY2ZTgyZTc4ODM3ZWE3ODk0MjY3MzA0OTU5
10
+ ZTE1ZTk4MDdkMzA3N2NhMDAyYTc4ZjFjYWVkOTA1NzE0ZWM3Y2JkMzM2NzI2
11
+ MGJlZGMxMjc2YTE5NDUyNzI3ZTZmOTg5YjY5OTkwNzBiM2I3MzY=
12
+ data.tar.gz: !binary |-
13
+ OTJiYTczMjY3ZDU4MzNlMTA2NTk1ODgwMzExMzYxNGRjMTg2ZTUxNWEzNmVl
14
+ NjRjZDBiYWZkOTYxOTRhOTBiN2Y5ZmI4YTEyNWFhMzcxZjA3NGJhZjQ5NmRm
15
+ Mjc5NTM5ZDA4YmJjMzI2OWI5NDExNTRlMzU5YTVlMDMzNzIxNmU=
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ statement = ARGV[0]
4
+
5
+ case statement
6
+
7
+ when "post"
8
+ puts "enter a name for the post:"
9
+ # Get Title
10
+ name = $stdin.gets.chomp
11
+ filename = name.downcase
12
+ filename.gsub! " ", "-"
13
+ filename.gsub! /([^A-Z^a-z^0-9^\-])/, ""
14
+ filename = Time.now.strftime("%Y-%m-%d-") + filename + ".md"
15
+
16
+
17
+ puts "enter categories, separated by comma"
18
+ categories = $stdin.gets.chomp
19
+
20
+ # Creating the Post
21
+ puts "creating post with\n \tname:\t " + name + "\n \tfilename: " + filename
22
+ content = "---\n"
23
+ content += "layout: post\n"
24
+ content += "title: " + "\"" + name + "\"\n"
25
+ content += "date: " + Time.now.strftime("%Y-%m-%d %l:%M %P") + "\n"
26
+ content += "categories: " + categories + "\n"
27
+ content +="---\n\n"
28
+ begin
29
+ File.open("_posts/"+filename, 'w') {|f| f.write(content) }
30
+ rescue => e
31
+ puts "error: you must run the generator in a jekyll directory"
32
+ end
33
+ when String
34
+ puts "error: unknown type"
35
+ else
36
+ puts "usage: please specific type, i.e. post"
37
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Will Potter
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple generator for Jekyll content
14
+ email: will@willpotter.co
15
+ executables:
16
+ - jgen
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/jgen
21
+ homepage: http://rubygems.org/gems/jekyll-generator
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.0.7
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Jekyll Generator
45
+ test_files: []