notahat-machinist 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/machinist.rb CHANGED
@@ -31,8 +31,8 @@ module Machinist
31
31
 
32
32
  # Undef a couple of methods that are common ActiveRecord attributes.
33
33
  # (Both of these are deprecated in Ruby 1.8 anyway.)
34
- undef_method :id
35
- undef_method :type
34
+ undef_method :id if respond_to?(:id)
35
+ undef_method :type if respond_to?(:type)
36
36
 
37
37
  def object
38
38
  yield @object if block_given?
@@ -56,7 +56,15 @@ module Machinist
56
56
  @blueprints[name] = blueprint if block_given?
57
57
  @blueprints[name]
58
58
  end
59
-
59
+
60
+ def named_blueprints
61
+ @blueprints.reject{|name,_| name == :master }.keys
62
+ end
63
+
64
+ def clear_blueprints!
65
+ @blueprints = {}
66
+ end
67
+
60
68
  def make(*args, &block)
61
69
  lathe = Lathe.run(self.new, *args)
62
70
  unless Machinist::ActiveRecord.nerfed?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notahat-machinist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Yandell
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-13 00:00:00 -08:00
12
+ date: 2009-02-25 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15