shnell 0.0.2

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 (8) hide show
  1. data/.gitignore +21 -0
  2. data/LICENSE +20 -0
  3. data/README.rdoc +17 -0
  4. data/Rakefile +33 -0
  5. data/bin/shnell +71 -0
  6. data/lib/shnell.rb +3 -0
  7. data/shnell.gemspec +52 -0
  8. metadata +96 -0
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Johannes J. Schmidt
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = shnell
2
+
3
+ Server Setup and Configuration
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 Johannes J. Schmidt. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,33 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require File.join(File.dirname(__FILE__), 'lib', 'shnell')
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gem|
8
+ gem.name = "shnell"
9
+ gem.version = Shnell::VERSION
10
+ gem.summary = %Q{Server Setup and Configuration tools}
11
+ gem.description = %Q{Ease Server Setup and Configuration}
12
+ gem.email = "schmidt@netzmerk.com"
13
+ gem.homepage = "http://github.com/jo/shnell"
14
+ gem.authors = ["Johannes J. Schmidt"]
15
+ gem.add_dependency "commander", ">= 4.0.2"
16
+ gem.add_dependency "filander", ">= 0.2.0"
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
+ end
22
+
23
+ task :default => :test
24
+
25
+ require 'rake/rdoctask'
26
+ Rake::RDocTask.new do |rdoc|
27
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
28
+
29
+ rdoc.rdoc_dir = 'rdoc'
30
+ rdoc.title = "shnell #{version}"
31
+ rdoc.rdoc_files.include('README*')
32
+ rdoc.rdoc_files.include('lib/**/*.rb')
33
+ end
data/bin/shnell ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'commander/import'
5
+ require File.join(File.dirname(__FILE__), '../lib', 'shnell')
6
+
7
+ program :name, 'shnell'
8
+ program :version, Shnell::VERSION
9
+ program :description, 'Server Setup and Configuration'
10
+ program :help, 'Author', 'Johannes Jörg Schmidt, TF <schmidt@netzmerk.com>'
11
+
12
+ default_command :help
13
+
14
+ SCRIPTS_ROOT = Pathname.new(Dir.pwd)
15
+
16
+ command :list do |c|
17
+ c.syntax = 'shnell list [pattern]'
18
+ c.description = 'List available scripts.'
19
+
20
+ c.action do |args, options|
21
+ pattern = args.shift
22
+
23
+ if pattern
24
+ exp = "**/*#{pattern}*.rb"
25
+ else
26
+ exp = '**/*.rb'
27
+ end
28
+ Dir[SCRIPTS_ROOT.join(exp)].each do |f|
29
+ path = Pathname.new(f)
30
+ name = path.relative_path_from(SCRIPTS_ROOT)
31
+ puts name.sub(/\.rb$/, '')
32
+ end
33
+ end
34
+ end
35
+
36
+ command :run do |c|
37
+ c.syntax = 'shnell run script'
38
+ c.description = 'Run a script.'
39
+
40
+ c.option '-f', '--force', 'Overwrite files that already exist'
41
+ c.option '-p', '--pretend', 'Run but do not make any changes'
42
+ c.option '-q', '--quiet', 'Supress status output'
43
+ c.option '-s', '--skip', 'Skip files that already exist'
44
+
45
+ c.action do |args, options|
46
+ $:.unshift SCRIPTS_ROOT
47
+ script = args.shift
48
+ require 'filander'
49
+ include Filander
50
+
51
+ behavior = :ask
52
+ behavior = :skip if options.skip
53
+ behavior = :pretend if options.pretend
54
+ behavior = :force if options.force
55
+ Filander.behavior = behavior
56
+
57
+ if script == "all"
58
+ Dir[File.join(SCRIPTS_ROOT, '**/*.rb')].sort.each do |file|
59
+ name = Pathname.new(file).relative_path_from(SCRIPTS_ROOT)
60
+ message = "Running #{name.sub(/\.rb$/, '')}..."
61
+ message = $terminal.color(message, :bold) if defined? $terminal
62
+ say message
63
+ Filander.source_root = file.sub(/\.rb$/, '')
64
+ require file
65
+ end
66
+ else
67
+ Filander.source_root = File.join(SCRIPTS_ROOT, script)
68
+ require script
69
+ end
70
+ end
71
+ end
data/lib/shnell.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Shnell
2
+ VERSION = '0.0.2'
3
+ end
data/shnell.gemspec ADDED
@@ -0,0 +1,52 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{shnell}
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 = ["Johannes J. Schmidt"]
12
+ s.date = %q{2010-04-08}
13
+ s.default_executable = %q{shnell}
14
+ s.description = %q{Ease Server Setup and Configuration}
15
+ s.email = %q{schmidt@netzmerk.com}
16
+ s.executables = ["shnell"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "bin/shnell",
27
+ "lib/shnell.rb",
28
+ "shnell.gemspec"
29
+ ]
30
+ s.homepage = %q{http://github.com/jo/shnell}
31
+ s.rdoc_options = ["--charset=UTF-8"]
32
+ s.require_paths = ["lib"]
33
+ s.rubygems_version = %q{1.3.6}
34
+ s.summary = %q{Server Setup and Configuration tools}
35
+
36
+ if s.respond_to? :specification_version then
37
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
38
+ s.specification_version = 3
39
+
40
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
41
+ s.add_runtime_dependency(%q<commander>, [">= 4.0.2"])
42
+ s.add_runtime_dependency(%q<filander>, [">= 0.2.0"])
43
+ else
44
+ s.add_dependency(%q<commander>, [">= 4.0.2"])
45
+ s.add_dependency(%q<filander>, [">= 0.2.0"])
46
+ end
47
+ else
48
+ s.add_dependency(%q<commander>, [">= 4.0.2"])
49
+ s.add_dependency(%q<filander>, [">= 0.2.0"])
50
+ end
51
+ end
52
+
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shnell
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
10
+ platform: ruby
11
+ authors:
12
+ - Johannes J. Schmidt
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-08 00:00:00 +02:00
18
+ default_executable: shnell
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: commander
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 4
29
+ - 0
30
+ - 2
31
+ version: 4.0.2
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: filander
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 2
44
+ - 0
45
+ version: 0.2.0
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ description: Ease Server Setup and Configuration
49
+ email: schmidt@netzmerk.com
50
+ executables:
51
+ - shnell
52
+ extensions: []
53
+
54
+ extra_rdoc_files:
55
+ - LICENSE
56
+ - README.rdoc
57
+ files:
58
+ - .gitignore
59
+ - LICENSE
60
+ - README.rdoc
61
+ - Rakefile
62
+ - bin/shnell
63
+ - lib/shnell.rb
64
+ - shnell.gemspec
65
+ has_rdoc: true
66
+ homepage: http://github.com/jo/shnell
67
+ licenses: []
68
+
69
+ post_install_message:
70
+ rdoc_options:
71
+ - --charset=UTF-8
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ requirements: []
89
+
90
+ rubyforge_project:
91
+ rubygems_version: 1.3.6
92
+ signing_key:
93
+ specification_version: 3
94
+ summary: Server Setup and Configuration tools
95
+ test_files: []
96
+