bradshaw 0.0.3

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjgwZWNlMzhhNWUzNDYzMmVjNmQxNGI3NDkyZTRlNjhiNjQzYWI3Yw==
5
+ data.tar.gz: !binary |-
6
+ NzJmZTQxNmJhMGU5M2NhNjcyYjc5NzkxMDY1Mzc0NjAwNzI3ZTA2OQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NTMzY2NjYTkwYjhjNDc3ZWYyYmEyMGQwNDNkOWQ0YjA4ZmY3OTY4Mzg3ZTli
10
+ ZjZiZmYzZjUwMmUxYzg3NjlhZmExMzVmNzdmN2E0NTA3N2NjYWMwNTY4M2Qw
11
+ ZGI4MmQxZTNlMjYyNTVjZTY4ZmE3MDM2YjU5NjkyZjYwMTM3NzE=
12
+ data.tar.gz: !binary |-
13
+ NDAwNTFjNTZiMzA3NGI0YzgyMzZkMGE2MzNjMmEwNWViYmIzYTNhMjY1YWZm
14
+ MmI3MjEzN2VlZmM2YWUxMDBlZjJiOWE3ZGExZjI5NTVlNmJhMmE2NGJiZDUx
15
+ ZTU1OTRkZWRkZTdhNDQ5ZGY4NTdhYjQ4NmVhYTgwYjFiY2Q0ZTM=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in poole.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 l3kn
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Poole
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'poole'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install poole
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/bradshaw ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bradshaw'
3
+ require 'chronic'
4
+ require 'optparse'
5
+
6
+ $options = {}
7
+
8
+ opts = OptionParser.new do |opt|
9
+ opt.banner = 'Usage: poole [OPTIONS]'
10
+ opt.on('-v', '--version', 'display current version') do
11
+ puts "poole #{Bradshaw::VERSION}"
12
+ exit 0
13
+ end
14
+ # opt.on('-t', '--title TITLE', 'set the title') do |t|
15
+ # $options['title'] = t
16
+ # end
17
+ # opt.on('-d', '--date DATE', 'set the date') do |t|
18
+ # $options['date'] = d
19
+ # end
20
+ end
21
+
22
+ opts.parse!
23
+
24
+ def set_defaults
25
+ $options['layout'] = 'post'
26
+ $options['category'] = 'blog'
27
+ end
28
+
29
+ def get_option(name)
30
+ print "#{name}: "
31
+ $stdin.gets.chomp
32
+ end
33
+
34
+ def get_date
35
+ print 'date: '
36
+ Chronic.parse($stdin.gets.chomp) || Time.now
37
+ end
38
+
39
+ set_defaults
40
+
41
+ case ARGV[0]
42
+ when 'min'
43
+ $options['title'] = get_option('title')
44
+ date = get_date.strftime('%Y-%m-%d')
45
+ path = get_option(:path)
46
+ path == '' ? dir = '.' : dir = path
47
+ puts "-#{dir}-"
48
+ name = date + '-' + $options['title'].gsub(' ','_') + '.markdown'
49
+
50
+ post = Bradshaw::Post.new
51
+ post.options = $options
52
+ path = dir + '/' + name
53
+
54
+ post.save(path)
55
+ puts "saved to #{path}"
56
+
57
+ editor = Bradshaw::Editor.new
58
+ editor.open(path)
59
+ else
60
+ puts opts
61
+ end
62
+
data/bradshaw.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bradshaw/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'bradshaw'
8
+ gem.version = Bradshaw::VERSION
9
+ gem.authors = ['Leon Rische']
10
+ gem.email = ['gems@l3kn.de']
11
+ gem.description = %q{A servant for Jekyll}
12
+ gem.summary = %q{A servart for Jekyll}
13
+ gem.homepage = 'http://www.l3kn.de'
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = ['bradshaw'] #gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency 'chronic'
21
+ end
@@ -0,0 +1,3 @@
1
+ module Bradshaw
2
+ VERSION = '0.0.3'
3
+ end
data/lib/bradshaw.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'bradshaw/version'
2
+
3
+ module Bradshaw
4
+ class Editor
5
+ def open(file)
6
+ system("vim #{file}")
7
+ end
8
+ end
9
+ class Post
10
+ attr_accessor :options, :content
11
+ def save(path)
12
+ puts @options
13
+ full = "#{@options.to_yaml}---\n"
14
+ File.open(path, 'w') {|f| f.write(full) }
15
+ end
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bradshaw
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Leon Rische
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chronic
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A servant for Jekyll
28
+ email:
29
+ - gems@l3kn.de
30
+ executables:
31
+ - bradshaw
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - .gitignore
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - bin/bradshaw
41
+ - bradshaw.gemspec
42
+ - lib/bradshaw.rb
43
+ - lib/bradshaw/version.rb
44
+ homepage: http://www.l3kn.de
45
+ licenses: []
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.0.3
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: A servart for Jekyll
67
+ test_files: []