procbuddy 0.0.1 → 0.0.2

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/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  gemspec.summary = "sql stored procedures in migrations"
6
6
  gemspec.description = "Provide create_proc and drop_proc in migrations. Also extends SchemaDumper to clue in about procs"
7
7
  gemspec.email = "stewbawka@gmail.com"
8
- gemspec.homepage = "http://blog.stewbawka.com""
8
+ gemspec.homepage = "http://blog.stewbawka.com"
9
9
  gemspec.authors = ["Stuart Wade"]
10
10
  end
11
11
  Jeweler::GemcutterTasks.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,11 @@
1
+ # This is required for 1.1.6 support
2
+ class Module
3
+ def alias_method_chain(target, feature)
4
+ # Strip out punctuation on predicates or bang methods since
5
+ # e.g. target?_without_feature is not a valid method name.
6
+ aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
7
+ yield(aliased_target, punctuation) if block_given?
8
+ alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target
9
+ alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}"
10
+ end
11
+ end
@@ -1,17 +1,17 @@
1
1
  module ActiveRecord
2
2
  module ConnectionAdapters
3
3
  class AbstractAdapter
4
- # Subclasses should override and return true if they support triggers.
4
+ # Subclasses should override and return true if they support procs.
5
5
  def supports_procs?
6
6
  return false
7
7
  end
8
8
 
9
- # Get a list of all triggers for the current database
9
+ # Get a list of all procs for the current database
10
10
  def procs(name = nil)
11
11
  raise NotImplementedError, "procs is an abstract method"
12
12
  end
13
13
 
14
- # Get the code for the specified trigger
14
+ # Get the code for the specified proc
15
15
  def proc_code(proc, name=nil)
16
16
  raise NotImplementedError, "proc_code is an abstract method"
17
17
  end
@@ -13,7 +13,7 @@ module ActiveRecord
13
13
 
14
14
  def proc_sp_helptext(proc, name=nil)
15
15
  q =<<-ENDSQL
16
- SELECT OBJECT_DEFINITION(OBJECT_ID('#{trigger}'));
16
+ SELECT OBJECT_DEFINITION(OBJECT_ID('#{proc}'));
17
17
  ENDSQL
18
18
 
19
19
  proc_def = select_value(q, name)
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  class SchemaDumper
3
3
 
4
- # A list of triggers which should not be dumped to the schema.
4
+ # A list of procs which should not be dumped to the schema.
5
5
  # Acceptable values are strings as well as regexp.
6
6
  # This setting is only used if ActiveRecord::Base.schema_format == :ruby
7
7
  cattr_accessor :ignore_procs
@@ -10,7 +10,7 @@ module ActiveRecord
10
10
  def trailer_with_procs(stream)
11
11
  # do nothing...we'll call this later
12
12
  end
13
- alias_method_chain :trailer, :triggers
13
+ alias_method_chain :trailer, :procs
14
14
 
15
15
  # Add procs to the end of the dump stream
16
16
  def dump_with_procs(stream)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procbuddy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stuart Wade
@@ -28,6 +28,7 @@ extensions: []
28
28
  extra_rdoc_files: []
29
29
 
30
30
  files:
31
+ - lib/core_ext/module.rb
31
32
  - lib/procbuddy/version.rb
32
33
  - lib/procbuddy/schema_dumper.rb
33
34
  - lib/procbuddy/connection_adapters/mysql_adapter.rb
@@ -39,6 +40,7 @@ files:
39
40
  - CHANGELOG
40
41
  - Rakefile
41
42
  - README
43
+ - VERSION
42
44
  has_rdoc: true
43
45
  homepage: http://blog.stewbawka.com
44
46
  licenses: []