exctl 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,6 +11,16 @@ runtime tasks (such as running the application).
11
11
 
12
12
  Why? Because I've reimplemented this so many times for specific projects that I'm finally abstracting it.
13
13
 
14
+
15
+ command-line usage
16
+ ------------------
17
+
18
+ `exctl init my-project`
19
+
20
+ Inits (in this case) the current directory. Installs or updates local copies of exctl-dispatch and its auxiliary files.
21
+
22
+
23
+
14
24
  Copyright
15
25
  ---------
16
26
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bin/exctl ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH << File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib')
3
+ require 'exctl'
4
+ Exctl.cli ARGV
data/exctl.gemspec ADDED
@@ -0,0 +1,65 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "exctl"
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Joseph Wecker"]
12
+ s.date = "2013-11-12"
13
+ s.description = "Allows you to create a command-line dispatcher for a project to consolidate dev, release, and runtime workflows."
14
+ s.email = "joseph.wecker@gmail.com"
15
+ s.executables = ["exctl"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".attic/c_src/get-version.c",
22
+ ".document",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "OPERUM.md",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/exctl",
31
+ "exctl.gemspec",
32
+ "lib/exctl.rb",
33
+ "lib/exctl/cli.rb",
34
+ "notes.md",
35
+ "test/helper.rb",
36
+ "test/test_exctl.rb"
37
+ ]
38
+ s.homepage = "http://github.com/josephwecker/exctl"
39
+ s.licenses = ["MIT"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = "1.8.25"
42
+ s.summary = "Project-specific command-line task dispatcher generator."
43
+
44
+ if s.respond_to? :specification_version then
45
+ s.specification_version = 3
46
+
47
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
49
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
52
+ else
53
+ s.add_dependency(%q<shoulda>, [">= 0"])
54
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
55
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
57
+ end
58
+ else
59
+ s.add_dependency(%q<shoulda>, [">= 0"])
60
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
61
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
62
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
63
+ end
64
+ end
65
+
data/lib/exctl/cli.rb ADDED
@@ -0,0 +1,48 @@
1
+ # TODO: Yes, at some point this will be bootstrapped by exctl itself.
2
+
3
+ module Exctl
4
+ def self.cli(argv) Exctl::CLI.new(argv).run! end
5
+
6
+ class CLI
7
+ def initialize(argv)
8
+ @args = argv.clone
9
+ @cmd = (@args.shift || 'help').strip.downcase
10
+ @cmd = 'help' if [nil,'-h','--help','h'].include?(@cmd)
11
+ @cmd = 'version' if [nil,'-v','--version','v'].include?(@cmd)
12
+ @cmd = ('cmd_' + @cmd.gsub(/^-+/,'').gsub('-','_')).to_sym
13
+ @opts = {}
14
+ end
15
+
16
+ def run!()
17
+ if self.respond_to?(@cmd) then self.send @cmd
18
+ else
19
+ $stderr.puts "ERROR: Command '#{@cmd}' not implemented."
20
+ $stderr.puts "USAGE: exctl (#{avail_cmds.join('|')}) [OPTIONS]"
21
+ exit 1
22
+ end
23
+ end
24
+
25
+ def avail_cmds()
26
+ @avail_cmds ||= (self.methods-Object.methods).map(&:to_s).select{|m|m[0..3]=='cmd_'}.map{|m|m[4..-1]}
27
+ end
28
+
29
+ def doc_help; 'Output this help.' end
30
+ def cmd_help
31
+ puts "exctl - Execution control; project command-line generator."
32
+ puts " v#{Exctl.version}\n\n"
33
+ puts "USAGE: exctl (#{avail_cmds.join('|')}) [OPTIONS]\n\n"
34
+ puts avail_cmds.map{|c| hc='doc_'+c; respond_to?(hc) ? ' ' + c.ljust(10) + ': ' + send(hc) : nil}.compact.join("\n") + "\n\n"
35
+ end
36
+
37
+ def cmd_version
38
+ puts Exctl.version
39
+ end
40
+
41
+ def doc_init; 'BIN-NAME [DIR=.] - Creates/updates main ctl script and support files in the given DIR.' end
42
+ def cmd_init
43
+
44
+ $stderr.puts "just kidding, not implemented yet."
45
+ exit 1
46
+ end
47
+ end
48
+ end
data/lib/exctl.rb CHANGED
@@ -0,0 +1,7 @@
1
+ module Exctl
2
+ VERSION = File.exist?(File.join(File.dirname(__FILE__),'..','VERSION')) ? File.read(File.join(File.dirname(__FILE__),'..','VERSION')) : ""
3
+ def self.version() Exctl::VERSION end
4
+ end
5
+
6
+ require 'exctl/cli'
7
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -78,7 +78,8 @@ dependencies:
78
78
  description: Allows you to create a command-line dispatcher for a project to consolidate
79
79
  dev, release, and runtime workflows.
80
80
  email: joseph.wecker@gmail.com
81
- executables: []
81
+ executables:
82
+ - exctl
82
83
  extensions: []
83
84
  extra_rdoc_files:
84
85
  - LICENSE
@@ -93,7 +94,10 @@ files:
93
94
  - README.md
94
95
  - Rakefile
95
96
  - VERSION
97
+ - bin/exctl
98
+ - exctl.gemspec
96
99
  - lib/exctl.rb
100
+ - lib/exctl/cli.rb
97
101
  - notes.md
98
102
  - test/helper.rb
99
103
  - test/test_exctl.rb
@@ -112,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
116
  version: '0'
113
117
  segments:
114
118
  - 0
115
- hash: -3627039586448779554
119
+ hash: -3768507583342469896
116
120
  required_rubygems_version: !ruby/object:Gem::Requirement
117
121
  none: false
118
122
  requirements: