bj 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/bin/bj +9 -4
  2. data/lib/bj.rb +1 -1
  3. data/lib/bj/api.rb +5 -1
  4. data/lib/bj/table.rb +9 -2
  5. metadata +1 -1
data/bin/bj CHANGED
@@ -52,12 +52,11 @@ Main {
52
52
  Bj can be installed two ways: as a gem or as a plugin.
53
53
 
54
54
  gem:
55
-
56
55
  1) $sudo gem install bj
57
- 2) bj setup ./rails_root/
56
+ 2) add "require 'bj'" to config/environment.rb
57
+ 3) bj setup
58
58
 
59
59
  plugin:
60
-
61
60
  1) ./script/plugin install http://codeforpeople.rubyforge.org/svn/rails/plugins/bj
62
61
  2) ./script/bj setup
63
62
 
@@ -86,9 +85,15 @@ Main {
86
85
 
87
86
  jobs = Bj.submit 'echo foobar', :tag => 'simple job'
88
87
 
89
- jobs = Bj.submit '/bin/cat', :stdin => 'in the hat'
88
+ jobs = Bj.submit '/bin/cat', :stdin => 'in the hat', :priority => 42
90
89
 
91
90
  jobs = Bj.submit './script/runner ./scripts/a.rb', :rails_env => 'production'
91
+
92
+ jobs = Bj.submit './script/runner /dev/stdin',
93
+ :stdin => 'p RAILS_ENV',
94
+ :tag => 'dynamic ruby code'
95
+
96
+ jobs Bj.submit array_of_commands, :priority => 451
92
97
 
93
98
  when jobs are run, they are run in RAILS_ROOT. various attributes are
94
99
  available *only* once the job has finished. you can check whether or not a
data/lib/bj.rb CHANGED
@@ -3,7 +3,7 @@ unless defined? Bj
3
3
  #
4
4
  # constants and associated attrs
5
5
  #
6
- Bj::VERSION = "0.0.1" unless
6
+ Bj::VERSION = "0.0.2" unless
7
7
  defined? Bj::VERSION
8
8
  def self.version() Bj::VERSION end
9
9
 
@@ -30,10 +30,14 @@ class Bj
30
30
  #
31
31
  # jobs = Bj.submit 'echo foobar', :tag => 'simple job'
32
32
  #
33
- # jobs = Bj.submit '/bin/cat', :stdin => 'in the hat'
33
+ # jobs = Bj.submit '/bin/cat', :stdin => 'in the hat', :priority => 42
34
34
  #
35
35
  # jobs = Bj.submit './script/runner ./scripts/a.rb', :rails_env => 'production'
36
36
  #
37
+ # jobs = Bj.submit './script/runner /dev/stdin', :stdin => 'p RAILS_ENV', :tag => 'dynamic ruby code'
38
+ #
39
+ # jobs = Bj.submit array_of_commands, :priority => 451
40
+ #
37
41
  # when jobs are run, they are run in RAILS_ROOT. various attributes are
38
42
  # available *only* once the job has finished. you can check whether or not
39
43
  # a job is finished by using the #finished method, which simple does a
@@ -226,11 +226,18 @@ class Bj
226
226
  t.column "cast" , :text
227
227
  end
228
228
 
229
- add_index table.table_name, %w[ hostname key ], :unique => true
229
+ begin
230
+ add_index table.table_name, %w[ hostname key ], :unique => true
231
+ rescue Exception
232
+ STDERR.puts "WARNING: your database does not support unique indexes on text fields!?"
233
+ end
230
234
  end
231
235
 
232
236
  define_method(:down) do
233
- remove_index table.table_name, :column => %w[ hostname key ]
237
+ begin
238
+ remove_index table.table_name, :column => %w[ hostname key ]
239
+ rescue Exception
240
+ end
234
241
  drop_table table.table_name
235
242
  end
236
243
  }
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: bj
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
6
+ version: 0.0.2
7
7
  date: 2007-12-12 00:00:00 -07:00
8
8
  summary: bj
9
9
  require_paths: