Browse Source

Initial commit

master
Peter J. Jones 8 years ago
commit
d050d8a7a2
6 changed files with 105 additions and 0 deletions
  1. 22
    0
      LICENSE.md
  2. 0
    0
      README.md
  3. 53
    0
      bin/edify
  4. 23
    0
      edify.gemspec
  5. 2
    0
      lib/edify.rb
  6. 5
    0
      lib/edify/version.rb

+ 22
- 0
LICENSE.md View File

@@ -0,0 +1,22 @@
# Edify License

Copyright (C) 2011 pmade inc. (Peter Jones pjones@pmade.com)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 0
README.md View File


+ 53
- 0
bin/edify View File

@@ -0,0 +1,53 @@
#!/usr/bin/env ruby

################################################################################
require('ostruct')
require('optparse')
require('edify')

################################################################################
class CommandRunner

##############################################################################
COMMANDS_DIR = File.expand_path('../commands', File.dirname(__FILE__))
##############################################################################
ABBREVIATIONS = {
's' => 'server',
'g' => 'generate',
}
##############################################################################
DEFAULT_OPTIONS = {
:version => false,
:list => false,
}
##############################################################################
def initialize
@options = OpenStruct.new(DEFAULT_OPTIONS)
OptionParser.new do |p|
p.banner = 'Usage: edify <command> [options]'
p.on('-h', '--help', 'This message') {$stdout.puts(p); exit}
p.on('-l', '--list', 'List all commands') {|l| @options.list = l}
p.on('-v', '--version', 'Print version number and exit') {|v| @options.version = v}
end.order!(ARGV)
end

##############################################################################
def run
if @options.version
$stdout.puts("Edify #{Edify::VERSION}")
exit
end
end
end

################################################################################
begin
CommandRunner.new.run
rescue RuntimeError => e
$stderr.puts(File.basename($0) + ": ERROR: #{e}")
exit(1)
end

+ 23
- 0
edify.gemspec View File

@@ -0,0 +1,23 @@
################################################################################
$:.unshift(File.expand_path('../lib', File.dirname(__FILE__)))
require('edify/version')

################################################################################
Gem::Specification.new do |gem|
gem.name = 'edify'
gem.version = Edify::VERSION
gem.platform = Gem::Platform::RUBY
gem.authors = ['Peter Jones']
gem.email = ['pjones@pmade.com']
gem.homepage = 'http://github.com/pjones/edify'
gem.summary = 'Write articles and other content for devalot.com'
gem.description = 'Edify is an internal tool for authors working with devalot.com'
gem.files = Dir.glob('{bin,commands,lib}/**/*') + %w(README.md LICENSE.md)
gem.executables = ['edify']
gem.require_path = 'lib'
gem.add_dependency('sinatra', '>= 1.3.1')
gem.add_dependency('json', '>= 1.6.1')
gem.add_dependency('rest-client', '>= 1.6.7')
gem.add_dependency('rdiscount', '>= 1.6.8')
end

+ 2
- 0
lib/edify.rb View File

@@ -0,0 +1,2 @@
################################################################################
require('edify/version')

+ 5
- 0
lib/edify/version.rb View File

@@ -0,0 +1,5 @@
module Edify
VERSION = '0.1.0'
end

Loading…
Cancel
Save