puppetize 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.
@@ -0,0 +1,4 @@
1
+ require 'fileutils'
2
+ require 'pp'
3
+ require 'puppetize/puppetize'
4
+ require 'puppetize/command_line'
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'trollop'
4
+
5
+ module Puppetize
6
+
7
+ class CommandLine
8
+
9
+ SUB_COMMANDS = %w(init build reset)
10
+
11
+ def initialize(usage_msg = nil)
12
+
13
+
14
+ opts = Trollop::options do
15
+ version "puppetize 0.0.1 (c) 2013 Breinlinger Juan Paulo"
16
+ banner <<-EOS
17
+
18
+ Puppetize is a tool to automate puppet module development
19
+
20
+ Usage:
21
+ puppetize <subcommand> [options]
22
+
23
+ where <subcommands> are:
24
+
25
+ init Initialize the environment
26
+ build Build the puppet module
27
+ reset Reset the inital state
28
+
29
+ And [options] are:
30
+
31
+ EOS
32
+
33
+
34
+ #opt :ignore, "Ignore incorrect values"
35
+ #opt :file, "Extra data filename to read in, with a very long option description like this one", :type => String
36
+ #opt :volume, "Volume level", :default => 3.0
37
+ #opt :iters, "Number of iterations", :default => 5
38
+ end
39
+
40
+
41
+ cmd = ARGV.shift # get the subcommand
42
+ cmd_opts = case cmd
43
+ when "init"
44
+ Puppetize::Controler.new.init
45
+ when "build"
46
+ Puppetize::Controler.new.build
47
+ when "reset"
48
+ Puppetize::Controler.new.reset
49
+ else
50
+ Trollop::die "Unknown subcommand #{cmd.inspect}"
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+
@@ -0,0 +1,40 @@
1
+
2
+ module Puppetize
3
+
4
+ class Controler
5
+
6
+ def initialize
7
+
8
+ # Check distribution dependency
9
+ puts "\nSorry, Distribution not supported, only redhat based at the moment \n\n" unless File.exist?('/etc/redhat-release')
10
+
11
+ # Create config dir if it doesn't exists:
12
+ @config_dir = File.join(File.expand_path('~'),'.puppetize')
13
+ FileUtils.mkdir @config_dir if Dir.glob(@config_dir).empty?
14
+
15
+ end
16
+
17
+ def init
18
+
19
+ rpm_list = %x[rpm -qa]
20
+ File.write(File.join(@config_dir,'rpmlist.db'), rpm_list)
21
+
22
+ end
23
+
24
+
25
+ def build
26
+
27
+ puts "build"
28
+
29
+ end
30
+
31
+ def reset
32
+
33
+ puts "reset"
34
+
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,6 +18,9 @@ executables:
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - lib/puppetize.rb
22
+ - lib/puppetize/puppetize.rb
23
+ - lib/puppetize/command_line.rb
21
24
  - LICENSE
22
25
  - README.md
23
26
  - bin/puppetize
@@ -27,7 +30,7 @@ licenses:
27
30
  post_install_message:
28
31
  rdoc_options: []
29
32
  require_paths:
30
- - lib
33
+ - - lib
31
34
  required_ruby_version: !ruby/object:Gem::Requirement
32
35
  none: false
33
36
  requirements: