bookie_accounting 1.0.0 → 1.1.0

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/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
data/Rakefile CHANGED
@@ -11,12 +11,12 @@ RSpec::Core::RakeTask.new(:spec) do |task|
11
11
  task.pattern = 'spec/*_spec.rb'
12
12
  end
13
13
 
14
- task :docs do
14
+ task :rdoc do
15
15
  system("rdoc rdoc lib")
16
16
  end
17
17
 
18
- desc "Build RPM and dependencies (intended for IBEST internal use)"
19
- task :rpm_deps do
18
+ desc "Build RPM and dependencies (intended for University of Idaho IBEST internal use)"
19
+ task :rpm_deps => [:build] do
20
20
  require 'erb'
21
21
  require 'yaml'
22
22
 
@@ -27,9 +27,6 @@ task :rpm_deps do
27
27
  :gem_file => "bookie_accounting-#{Bookie::VERSION}.gem",
28
28
  :license => 'MIT',
29
29
  :skip_deps => Set.new(['sqlite3']),
30
- },
31
- 'bundler' => {
32
-
33
30
  },
34
31
  'spreadsheet' => {
35
32
  :has_binaries => true,
@@ -136,7 +133,7 @@ def build_rpms(modules_to_build)
136
133
  end
137
134
  end
138
135
 
139
- msg = `rpmbuild -bb #{spec_filename}`
136
+ msg = `rpmbuild -ba #{spec_filename}`
140
137
  unless $?.success?
141
138
  puts msg
142
139
  exit 1
data/TODO ADDED
@@ -0,0 +1 @@
1
+
@@ -33,7 +33,7 @@ config = Bookie::Config.new(config_file)
33
33
  config.connect
34
34
 
35
35
  if drop
36
- STDOUT.write "Are you sure? This will destroy all tables in the database. "
36
+ STDOUT.write "Are you sure? This will destroy all tables in the database. (YES/NO): "
37
37
  response = nil
38
38
  until response
39
39
  response = STDIN.gets.chomp
data/bin/bookie-send CHANGED
@@ -18,6 +18,7 @@ require 'bookie/sender'
18
18
  config_file = '/etc/bookie/config.json'
19
19
  will_create = false
20
20
  will_decommission = false
21
+ will_undo = false
21
22
  system_start_time = nil
22
23
  system_hostname = nil
23
24
  system_end_time = nil
@@ -29,6 +30,10 @@ opts = OptionParser.new do |opts|
29
30
  config_file = file
30
31
  end
31
32
 
33
+ opts.on('-u', '--undo', String, "undo a previous send operation (file must be specified)") do
34
+ will_undo = true
35
+ end
36
+
32
37
  opts.on("--create [TIME]",
33
38
  "Create an entry for this system, recording the given time as its start time") do |time|
34
39
  will_create = true
@@ -59,7 +64,11 @@ fail("No operation specified") unless filename || will_create || will_decommissi
59
64
 
60
65
  if filename
61
66
  sender = Bookie::Sender.new(config)
62
- sender.send_data(filename)
67
+ if will_undo
68
+ sender.undo_send(filename)
69
+ else
70
+ sender.send_data(filename)
71
+ end
63
72
  end
64
73
 
65
74
  if will_decommission
@@ -17,11 +17,14 @@ Gem::Specification.new do |gem|
17
17
  gem.version = Bookie::VERSION
18
18
 
19
19
  gem.add_dependency('activerecord')
20
- #For some reason, this is needed for Ruby 1.8.7 using RVM on CentOS.
21
- #To do: remove when no longer needed
22
- #gem.add_dependency('mysql2')
20
+ gem.add_dependency('json')
21
+ #We need this because Bundler has no concept of optional dependencies
22
+ #and complains about using non-dependency gems.
23
+ #To do: figure out how to remove (file issue?)
24
+ gem.add_dependency('mysql2')
23
25
  gem.add_dependency('pacct')
24
26
  gem.add_dependency('spreadsheet')
27
+ gem.add_development_dependency('bundler')
25
28
  gem.add_development_dependency('mocha')
26
29
  gem.add_development_dependency('rspec')
27
30
  gem.add_development_dependency('sqlite3')