olsen 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *~
2
+
data/CHANGELOG ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Please see olsen.gemspec for dependency information.
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ olsen (0.0.01)
5
+ sadie
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ dbd-mysql (0.4.4)
11
+ dbi (>= 0.4.0)
12
+ mysql
13
+ dbi (0.4.5)
14
+ deprecated (= 2.0.1)
15
+ deprecated (2.0.1)
16
+ mysql (2.8.1)
17
+ sadie (0.0.12)
18
+ dbd-mysql
19
+ dbi
20
+ mysql
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ olsen!
data/README ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake'
4
+ require 'rake/rdoctask'
5
+
6
+ task :deploy => 'inc_version' do
7
+ version = current_olsen_version
8
+ sh "git push"
9
+ sh "gem build olsen.gemspec"
10
+ sh "gem push olsen-#{version}.gem"
11
+ end
12
+
13
+ task :inc_version do
14
+ version = current_olsen_version
15
+ if (matches = version.match(/^(\d+\.\d+\.)(\d+)$/))
16
+ pre = matches[1]
17
+ post = Integer(matches[2]) + 1
18
+ version = "#{pre}#{post}"
19
+ end
20
+ fh = File.open("lib/olsen/version.rb","w")
21
+ fh.puts "class Olsen"
22
+ fh.puts ' VERSION = "' + version + '"'
23
+ fh.puts "end"
24
+ fh.close
25
+ puts "incremented olsen version to #{version}"
26
+ end
27
+
28
+ Rake::RDocTask.new do |rdoc|
29
+ rdoc.title = 'Olsen'
30
+ rdoc.rdoc_files.include('lib/**/*.rb')
31
+ rdoc.rdoc_files.include('README','TODO','CHANGELOG')
32
+ rdoc.main = 'README'
33
+ rdoc.rdoc_dir = 'rdoc'
34
+ end
35
+
36
+ def current_olsen_version
37
+ version = "0.0.0"
38
+ File.open("lib/olsen/version.rb","r").each do |line|
39
+ if matches = line.match(/version\s*\=\s*\"([^\"]+)\"/i)
40
+ version = matches[1]
41
+ break
42
+ end
43
+ end
44
+ version
45
+ end
data/TODO ADDED
File without changes
data/bin/olsen ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # run report for each input file
4
+ nomoreopts = false
5
+ ARGV.each do |infile|
6
+
7
+
8
+ puts "processing: #{infile}"
9
+
10
+ Olsen.process infile
11
+
12
+
13
+ end
14
+
@@ -0,0 +1,3 @@
1
+ class Olsen
2
+ VERSION = "0.0.2"
3
+ end
data/lib/olsen.rb ADDED
@@ -0,0 +1,44 @@
1
+ class Olsen
2
+ def self.process( job )
3
+
4
+ if ( ! defined?( job ) )
5
+ puts "job parameter was undefined. must be hash or file. returning nil."
6
+ return nil
7
+ end
8
+
9
+ if job.respond_to?( "each" )
10
+
11
+ return self._processHash( job )
12
+
13
+ elsif File.exists? job
14
+
15
+ j = Sadie::iniFileToHash( job )
16
+
17
+ if ( ! defined?( j ) )
18
+ puts "Unable to interpret job ini file: #{job}. returning nil."
19
+ return nil
20
+ end
21
+
22
+ return self._processHash( j )
23
+
24
+ end
25
+
26
+ puts "Unintelligible job param. returning nil."
27
+ return nil
28
+ end
29
+
30
+ def self._processHash( job )
31
+ # init sadie
32
+ storage = Sadie::getSadieInstance( job["parameters"] )
33
+
34
+ # set sadie-specific keys
35
+ job["sadie"].each do |key,value|
36
+ storage.set "sadie.#{key}", value
37
+ end
38
+
39
+ # call output triggers
40
+ job.["output"].each do |x,type|
41
+ storage.output type
42
+ end
43
+ end
44
+ end
data/olsen.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "olsen/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "olsen"
7
+ s.version = Olsen::VERSION
8
+ s.authors = ["Fred McDavid"]
9
+ s.email = ["fred@landmetrics.com"]
10
+ s.homepage = "http://www.landmetrics.com/Olsen"
11
+ s.summary = %q{A gem that provides olsen, a reporting tool}
12
+ s.description = %q{Olsen is a reporting tool intended to be used with Sadie.}
13
+
14
+ s.rubyforge_project = "olsen"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+
25
+ s.add_runtime_dependency "sadie"
26
+ s.extra_rdoc_files = ['README', 'CHANGELOG', 'TODO']
27
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: olsen
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Fred McDavid
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-13 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sadie
16
+ requirement: &23952480 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *23952480
25
+ description: Olsen is a reporting tool intended to be used with Sadie.
26
+ email:
27
+ - fred@landmetrics.com
28
+ executables:
29
+ - olsen
30
+ extensions: []
31
+ extra_rdoc_files:
32
+ - README
33
+ - CHANGELOG
34
+ - TODO
35
+ files:
36
+ - .gitignore
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - Rakefile
40
+ - bin/olsen
41
+ - lib/olsen.rb
42
+ - lib/olsen/version.rb
43
+ - olsen.gemspec
44
+ - README
45
+ - CHANGELOG
46
+ - TODO
47
+ homepage: http://www.landmetrics.com/Olsen
48
+ licenses: []
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project: olsen
67
+ rubygems_version: 1.8.15
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: A gem that provides olsen, a reporting tool
71
+ test_files: []