vzlimit 0.0.2 → 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.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Remo Fritzsche
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 CHANGED
@@ -1,48 +1,7 @@
1
1
  = vzlimit
2
2
 
3
- * http://github.com/#{github_username}/#{project_name}
3
+ A convenience way of managing OpenVZ container resource limits.
4
4
 
5
- == DESCRIPTION:
5
+ == Copyright
6
6
 
7
- FIX (describe your package)
8
-
9
- == FEATURES/PROBLEMS:
10
-
11
- * FIX (list of features or problems)
12
-
13
- == SYNOPSIS:
14
-
15
- FIX (code sample of usage)
16
-
17
- == REQUIREMENTS:
18
-
19
- * FIX (list of requirements)
20
-
21
- == INSTALL:
22
-
23
- * FIX (sudo gem install, anything else)
24
-
25
- == LICENSE:
26
-
27
- (The MIT License)
28
-
29
- Copyright (c) 2010 Remo Fritzsche
30
-
31
- Permission is hereby granted, free of charge, to any person obtaining
32
- a copy of this software and associated documentation files (the
33
- 'Software'), to deal in the Software without restriction, including
34
- without limitation the rights to use, copy, modify, merge, publish,
35
- distribute, sublicense, and/or sell copies of the Software, and to
36
- permit persons to whom the Software is furnished to do so, subject to
37
- the following conditions:
38
-
39
- The above copyright notice and this permission notice shall be
40
- included in all copies or substantial portions of the Software.
41
-
42
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
43
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ Copyright (c) 2010 Remo Fritzsche. See LICENSE for details.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
data/bin/vzlimit CHANGED
@@ -1,10 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- #
3
- # Created by Remo Fritzsche on 2010-1-30.
4
- # Copyright (c) 2010. All rights reserved.
5
-
6
- require 'rubygems'
7
- require File.expand_path(File.dirname(__FILE__) + "/../lib/vzlimit")
8
- require "vzlimit/cli"
9
-
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'lib/vzlimit'
4
+ require 'lib/vzlimit/cli'
10
5
  Vzlimit::CLI.new(STDOUT, ARGV)
6
+
data/lib/vzlimit.rb CHANGED
@@ -4,6 +4,5 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'rubygems'
5
5
 
6
6
  module Vzlimit
7
- VERSION = '0.0.2'
8
-
7
+ VERSION = File.open('VERSION').read
9
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vzlimit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Fritzsche
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
 
12
12
  date: 2010-02-01 00:00:00 +03:00
13
- default_executable:
13
+ default_executable: vzlimit
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -22,16 +22,6 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.5.1
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: rubyforge
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.0.3
34
- version:
35
25
  - !ruby/object:Gem::Dependency
36
26
  name: hirb
37
27
  type: :runtime
@@ -42,75 +32,28 @@ dependencies:
42
32
  - !ruby/object:Gem::Version
43
33
  version: 0.2.9
44
34
  version:
45
- - !ruby/object:Gem::Dependency
46
- name: rubyforge
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 2.0.3
54
- version:
55
- - !ruby/object:Gem::Dependency
56
- name: gemcutter
57
- type: :development
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 0.3.0
64
- version:
65
- - !ruby/object:Gem::Dependency
66
- name: hoe
67
- type: :development
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: 2.5.0
74
- version:
75
- description: FIX (describe your package)
76
- email:
77
- - dev@remofritzsche.com
35
+ description: Display and set OpenVZ container resource limits in a simple, convenience way without the need of understanding of how to create a CPU by hand!
36
+ email: dev@remofritzsche.com
78
37
  executables:
79
38
  - vzlimit
80
39
  extensions: []
81
40
 
82
41
  extra_rdoc_files:
83
- - History.txt
84
- - Manifest.txt
85
- - PostInstall.txt
86
- files:
87
- - History.txt
88
- - Manifest.txt
89
- - PostInstall.txt
42
+ - LICENSE
90
43
  - README.rdoc
91
- - Rakefile
92
- - bin/vzlimit
93
- - config/website.yml
44
+ files:
45
+ - VERSION
94
46
  - lib/vzlimit.rb
95
47
  - lib/vzlimit/cli.rb
96
- - script/console
97
- - script/destroy
98
- - script/generate
99
- - script/txt2html
100
- - test/test_helper.rb
101
- - test/test_vzlimit.rb
102
- - test/test_vzlimit_cli.rb
103
- - vzlimit.gemspec
104
- - website/index.html
105
- - website/index.html$
48
+ - LICENSE
49
+ - README.rdoc
106
50
  has_rdoc: true
107
- homepage: http://github.com/#{github_username}/#{project_name}
51
+ homepage: http://vzlimit.rubyforge.org/
108
52
  licenses: []
109
53
 
110
- post_install_message: PostInstall.txt
54
+ post_install_message:
111
55
  rdoc_options:
112
- - --main
113
- - README.rdoc
56
+ - --charset=UTF-8
114
57
  require_paths:
115
58
  - lib
116
59
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -131,8 +74,6 @@ rubyforge_project: vzlimit
131
74
  rubygems_version: 1.3.5
132
75
  signing_key:
133
76
  specification_version: 3
134
- summary: FIX (describe your package)
135
- test_files:
136
- - test/test_helper.rb
137
- - test/test_vzlimit.rb
138
- - test/test_vzlimit_cli.rb
77
+ summary: A convenience way of managing OpenVZ container resource limits.
78
+ test_files: []
79
+
data/History.txt DELETED
@@ -1,12 +0,0 @@
1
- === 0.0.1 2010-01-30
2
-
3
- * 1 major enhancement:
4
- * Initial release
5
-
6
- === 0.0.2 2010-02-02
7
-
8
- * Fixed bug that hard limit is ignored
9
- * Changed 'limit' command to 'set'
10
- * Changed param '--memory' and '-m' to '--ram' and '-r'
11
- * Fixed bug when calling 'vzlimit' without any parameters
12
- * Added help page
data/Manifest.txt DELETED
@@ -1,19 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- Rakefile
6
- bin/vzlimit
7
- config/website.yml
8
- lib/vzlimit.rb
9
- lib/vzlimit/cli.rb
10
- script/console
11
- script/destroy
12
- script/generate
13
- script/txt2html
14
- test/test_helper.rb
15
- test/test_vzlimit.rb
16
- test/test_vzlimit_cli.rb
17
- vzlimit.gemspec
18
- website/index.html
19
- website/index.html$
data/PostInstall.txt DELETED
@@ -1,7 +0,0 @@
1
-
2
- For more information on vzlimit, see http://vzlimit.rubyforge.org
3
-
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
-
data/Rakefile DELETED
@@ -1,26 +0,0 @@
1
- require 'rubygems'
2
- gem 'hoe', '>= 2.1.0'
3
- require 'hoe'
4
- require 'fileutils'
5
- require './lib/vzlimit'
6
-
7
- Hoe.plugin :newgem
8
- Hoe.plugin :website
9
- # Hoe.plugin :cucumberfeatures
10
-
11
- # Generate all the Rake tasks
12
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
- $hoe = Hoe.spec 'vzlimit' do
14
- self.developer 'Remo Fritzsche', 'dev@remofritzsche.com'
15
- self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
16
- self.rubyforge_name = self.name # TODO this is default value
17
- self.extra_deps = [['highline','>= 1.5.1'], ['rubyforge','>= 2.0.3'], ['hirb', '>= 0.2.9']]
18
-
19
- end
20
-
21
- require 'newgem/tasks'
22
- Dir['tasks/**/*.rake'].each { |t| load t }
23
-
24
- # TODO - want other tests/tasks run by default? Add them to the list
25
- # remove_task :default
26
- # task :default => [:spec, :features]
data/config/website.yml DELETED
@@ -1,2 +0,0 @@
1
- host: remofritzsche@vzlimit.rubyforge.org
2
- remote_dir: /var/www/gforge-projects/vzlimit
data/script/console DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/vzlimit.rb'}"
9
- puts "Loading vzlimit gem"
10
- exec "#{irb} #{libs} --simple-prompt"
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
data/script/txt2html DELETED
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- load File.dirname(__FILE__) + "/../Rakefile"
4
- require 'rubyforge'
5
- require 'redcloth'
6
- require 'syntax/convertors/html'
7
- require 'erb'
8
-
9
- download = "http://rubyforge.org/projects/#{$hoe.rubyforge_name}"
10
- version = $hoe.version
11
-
12
- def rubyforge_project_id
13
- RubyForge.new.configure.autoconfig["group_ids"][$hoe.rubyforge_name]
14
- end
15
-
16
- class Fixnum
17
- def ordinal
18
- # teens
19
- return 'th' if (10..19).include?(self % 100)
20
- # others
21
- case self % 10
22
- when 1: return 'st'
23
- when 2: return 'nd'
24
- when 3: return 'rd'
25
- else return 'th'
26
- end
27
- end
28
- end
29
-
30
- class Time
31
- def pretty
32
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
33
- end
34
- end
35
-
36
- def convert_syntax(syntax, source)
37
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
38
- end
39
-
40
- if ARGV.length >= 1
41
- src, template = ARGV
42
- template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
43
- else
44
- puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
45
- exit!
46
- end
47
-
48
- template = ERB.new(File.open(template).read)
49
-
50
- title = nil
51
- body = nil
52
- File.open(src) do |fsrc|
53
- title_text = fsrc.readline
54
- body_text_template = fsrc.read
55
- body_text = ERB.new(body_text_template).result(binding)
56
- syntax_items = []
57
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
58
- ident = syntax_items.length
59
- element, syntax, source = $1, $2, $3
60
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
61
- "syntax-temp-#{ident}"
62
- }
63
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
64
- body = RedCloth.new(body_text).to_html
65
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
66
- end
67
- stat = File.stat(src)
68
- created = stat.ctime
69
- modified = stat.mtime
70
-
71
- $stdout << template.result(binding)
data/test/test_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'stringio'
2
- require 'test/unit'
3
- require File.dirname(__FILE__) + '/../lib/vzlimit'
data/test/test_vzlimit.rb DELETED
@@ -1,11 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
2
-
3
- class TestVzlimit < Test::Unit::TestCase
4
-
5
- def setup
6
- end
7
-
8
- def test_truth
9
- assert true
10
- end
11
- end
@@ -1,14 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "test_helper.rb")
2
- require 'vzlimit/cli'
3
-
4
- class TestVzlimitCli < Test::Unit::TestCase
5
- def setup
6
- Vzlimit::CLI.execute(@stdout_io = StringIO.new, [])
7
- @stdout_io.rewind
8
- @stdout = @stdout_io.read
9
- end
10
-
11
- def test_print_default_output
12
- assert_match(/To update this executable/, @stdout)
13
- end
14
- end
data/vzlimit.gemspec DELETED
@@ -1,49 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{vzlimit}
5
- s.version = "0.0.1"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Remo Fritzsche"]
9
- s.date = %q{2010-01-30}
10
- s.default_executable = %q{vzlimit}
11
- s.description = %q{FIX (describe your package)}
12
- s.email = ["dev@remofritzsche.com"]
13
- s.executables = ["vzlimit"]
14
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "website/index.txt"]
15
- s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "bin/vzlimit", "config/website.yml.sample", "lib/vzlimit.rb", "lib/vzlimit/cli.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "test/test_helper.rb", "test/test_vzlimit.rb", "test/test_vzlimit_cli.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb"]
16
- s.homepage = %q{http://github.com/#{github_username}/#{project_name}}
17
- s.post_install_message = %q{PostInstall.txt}
18
- s.rdoc_options = ["--main", "README.rdoc"]
19
- s.require_paths = ["lib"]
20
- s.rubyforge_project = %q{vzlimit}
21
- s.rubygems_version = %q{1.3.5}
22
- s.summary = %q{FIX (describe your package)}
23
- s.test_files = ["test/test_helper.rb", "test/test_vzlimit.rb", "test/test_vzlimit_cli.rb"]
24
-
25
- if s.respond_to? :specification_version then
26
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
- s.specification_version = 3
28
-
29
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
- s.add_runtime_dependency(%q<highline>, [">= 1.5.1"])
31
- s.add_runtime_dependency(%q<rubyforge>, [">= 2.0.3"])
32
- s.add_development_dependency(%q<rubyforge>, [">= 2.0.3"])
33
- s.add_development_dependency(%q<gemcutter>, [">= 0.3.0"])
34
- s.add_development_dependency(%q<hoe>, [">= 2.5.0"])
35
- else
36
- s.add_dependency(%q<highline>, [">= 1.5.1"])
37
- s.add_dependency(%q<rubyforge>, [">= 2.0.3"])
38
- s.add_dependency(%q<rubyforge>, [">= 2.0.3"])
39
- s.add_dependency(%q<gemcutter>, [">= 0.3.0"])
40
- s.add_dependency(%q<hoe>, [">= 2.5.0"])
41
- end
42
- else
43
- s.add_dependency(%q<highline>, [">= 1.5.1"])
44
- s.add_dependency(%q<rubyforge>, [">= 2.0.3"])
45
- s.add_dependency(%q<rubyforge>, [">= 2.0.3"])
46
- s.add_dependency(%q<gemcutter>, [">= 0.3.0"])
47
- s.add_dependency(%q<hoe>, [">= 2.5.0"])
48
- end
49
- end
data/website/index.html DELETED
@@ -1,23 +0,0 @@
1
- <html>
2
- <head>
3
- <title>vzlimit - managing OpenVZ limits with comfort</title>
4
- <style type="text/css">
5
- body
6
- {
7
- font-family: Georgia;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <h1>vzlimit</h1>
13
- <p>A convenience way of managing OpenVZ container resource limits.</p>
14
-
15
- <h2>Commands</h2>
16
- <h3>List resource limits</h3>
17
- <p><code>vzlimit list</code></p>
18
- <h3>Set ram limit</h3>
19
- <p><code>vzlimit set <i>vpsid</i> --ram, -r <i>soft(MB)</i>:<i>hard(MB)</i></code></p>
20
- <h3>Set diskspace limit</h3>
21
- <p><code>vzlimit set <i>vpsid</i> --diskspace, -d <i>soft(MB)</i>:<i>hard(MB)</i></code></p>
22
- </body>
23
- </html>
data/website/index.html$ DELETED
@@ -1,17 +0,0 @@
1
- <html>
2
- <head>
3
- <title>vzlimit - managing OpenVZ limits with comfort</title>
4
- <style type="text/css">
5
- body
6
- {
7
- font-family: Georgia;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <h1>vzlimit</h1>
13
- <p>A relaxed way of managing resources/limits for OpenVZ.</p>
14
- <h2>Commands</h2>
15
- <h3>List all
16
- </body>
17
- </html>