rails3_artifactor 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gem.add_development_dependency "rspec", "~> 2.0.0.beta.19"
11
11
  gem.add_dependency "require_all", "~> 1.1.0"
12
12
  gem.add_dependency "sugar-high", "~> 0.2.3"
13
- gem.add_dependency 'rails3_assist', "~> 0.3.1"
13
+ gem.add_dependency 'rails3_assist', "~> 0.2.4"
14
14
 
15
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
16
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,5 +1,4 @@
1
1
  require 'rails3_assist'
2
- require 'sugar-high/module'
3
2
 
4
3
  module Rails3
5
4
  module Assist
@@ -1,6 +1,6 @@
1
1
  require 'rails3_artifactor/rspec/macro'
2
2
 
3
3
  RSpec.configure do |config|
4
- config.extend Rails3::Assist::UseMacro
5
- config.include Rails3::Assist::UseMacro
4
+ config.extend Rails3::Assist::UseMacro
5
+ config.include Rails3::Assist::UseMacro
6
6
  end
@@ -1,30 +1,47 @@
1
1
  module Rails3::Assist
2
2
  module UseMacro
3
- def assist_with *types
4
- types.each{|type| use_helper type}
3
+ def use_orm orm
4
+ class_eval do
5
+ begin
6
+ include "Rails3::Assist::Orm::#{orm.to_s.camelize}".constantize
7
+ rescue
8
+ raise ArgumentError, "Unregistered ORM library: #{orm}"
9
+ end
10
+ end
11
+ end
12
+
13
+ def assist_with *types
14
+ types.each{|type| use_helper type}
5
15
  end
6
16
  alias_method :load_helpers, :assist_with
7
17
  alias_method :use_helpers, :assist_with
8
18
 
9
- def use_helper type
19
+ def rails_assist type
10
20
  class_eval do
11
21
  begin
12
- include "Rails3::Assist::Artifact::#{type.to_s.camelize}".constantize
22
+ module_name = "Rails3::Assist::#{type.to_s.camelize}"
23
+ include module_name.constantize
13
24
  rescue
14
- raise ArgumentError, "Unregistered Rails3 helper library: #{type}"
25
+ raise ArgumentError, "Unregistered Rails3 assist library: #{type}, #{module_name}"
15
26
  end
16
27
  end
17
- end
18
- alias_method :load_helper, :use_helper
28
+ end
19
29
 
20
- def use_orm orm
30
+ def artifact_assist type
21
31
  class_eval do
22
32
  begin
23
- include "Rails3::Assist::Orm::#{orm.to_s.camelize}".constantize
33
+ module_name = "Rails3::Assist::Artifact::#{type.to_s.camelize}"
34
+ include module_name.constantize
24
35
  rescue
25
- raise ArgumentError, "Unregistered ORM library: #{orm}"
36
+ raise ArgumentError, "Unregistered Rails3 Artifact assist library: #{type}, #{module_name}"
26
37
  end
27
38
  end
28
39
  end
29
- end
40
+
41
+ def use_helper type
42
+ return rails_assist(type) if [:file, :files, :directory].include?(type)
43
+ artifact_assist(type)
44
+ end
45
+ alias_method :load_helper, :use_helper
46
+ end
30
47
  end
@@ -2,7 +2,8 @@ require 'require_all'
2
2
  require 'sugar-high/file'
3
3
  require 'sugar-high/alias'
4
4
  require 'sugar-high/regexp'
5
- require 'rails3_assist'
5
+ require 'sugar-high/module'
6
6
 
7
+ require 'rails3_artifactor/namespaces'
7
8
  require 'rails3_artifactor/artifact/base'
8
9
  require_all File.dirname(__FILE__) + '/rails3_artifactor'
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails3_artifactor}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-09-11}
12
+ s.date = %q{2010-09-13}
13
13
  s.description = %q{Helpers for handling Rails 3 artifacts in general, such as CRUD operations etc.}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
53
53
  "spec/fixtures.rb",
54
54
  "spec/fixtures/app/controllers/account_controller.rb",
55
55
  "spec/fixtures/app/helpers/account_helper.rb",
56
+ "spec/fixtures/app/mailers/account_mailer.rb",
56
57
  "spec/fixtures/app/models/account.rb",
57
58
  "spec/fixtures/app/views/account/edit.html.erb",
58
59
  "spec/fixtures/app/views/account/show.html.erb",
@@ -60,6 +61,7 @@ Gem::Specification.new do |s|
60
61
  "spec/rails3_artifactor/artifact/base_spec.rb",
61
62
  "spec/rails3_artifactor/artifact/crud/controller_spec.rb",
62
63
  "spec/rails3_artifactor/artifact/crud/helper_spec.rb",
64
+ "spec/rails3_artifactor/artifact/crud/mailer_spec.rb",
63
65
  "spec/rails3_artifactor/artifact/crud/migration_spec.rb",
64
66
  "spec/rails3_artifactor/artifact/crud/model_spec.rb",
65
67
  "spec/rails3_artifactor/artifact/crud/observer_spec.rb",
@@ -129,18 +131,18 @@ Gem::Specification.new do |s|
129
131
  s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.19"])
130
132
  s.add_runtime_dependency(%q<require_all>, ["~> 1.1.0"])
131
133
  s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.3"])
132
- s.add_runtime_dependency(%q<rails3_assist>, ["~> 0.3.1"])
134
+ s.add_runtime_dependency(%q<rails3_assist>, ["~> 0.2.4"])
133
135
  else
134
136
  s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.19"])
135
137
  s.add_dependency(%q<require_all>, ["~> 1.1.0"])
136
138
  s.add_dependency(%q<sugar-high>, ["~> 0.2.3"])
137
- s.add_dependency(%q<rails3_assist>, ["~> 0.3.1"])
139
+ s.add_dependency(%q<rails3_assist>, ["~> 0.2.4"])
138
140
  end
139
141
  else
140
142
  s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.19"])
141
143
  s.add_dependency(%q<require_all>, ["~> 1.1.0"])
142
144
  s.add_dependency(%q<sugar-high>, ["~> 0.2.3"])
143
- s.add_dependency(%q<rails3_assist>, ["~> 0.3.1"])
145
+ s.add_dependency(%q<rails3_assist>, ["~> 0.2.4"])
144
146
  end
145
147
  end
146
148
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-11 00:00:00 +02:00
17
+ date: 2010-09-13 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -74,9 +74,9 @@ dependencies:
74
74
  - !ruby/object:Gem::Version
75
75
  segments:
76
76
  - 0
77
- - 3
78
- - 1
79
- version: 0.3.1
77
+ - 2
78
+ - 4
79
+ version: 0.2.4
80
80
  type: :runtime
81
81
  version_requirements: *id004
82
82
  description: Helpers for handling Rails 3 artifacts in general, such as CRUD operations etc.
@@ -125,6 +125,7 @@ files:
125
125
  - spec/fixtures.rb
126
126
  - spec/fixtures/app/controllers/account_controller.rb
127
127
  - spec/fixtures/app/helpers/account_helper.rb
128
+ - spec/fixtures/app/mailers/account_mailer.rb
128
129
  - spec/fixtures/app/models/account.rb
129
130
  - spec/fixtures/app/views/account/edit.html.erb
130
131
  - spec/fixtures/app/views/account/show.html.erb
@@ -132,6 +133,7 @@ files:
132
133
  - spec/rails3_artifactor/artifact/base_spec.rb
133
134
  - spec/rails3_artifactor/artifact/crud/controller_spec.rb
134
135
  - spec/rails3_artifactor/artifact/crud/helper_spec.rb
136
+ - spec/rails3_artifactor/artifact/crud/mailer_spec.rb
135
137
  - spec/rails3_artifactor/artifact/crud/migration_spec.rb
136
138
  - spec/rails3_artifactor/artifact/crud/model_spec.rb
137
139
  - spec/rails3_artifactor/artifact/crud/observer_spec.rb
@@ -153,8 +155,6 @@ files:
153
155
  - spec/rails3_artifactor/base/crud/update_spec.rb
154
156
  - spec/rails3_artifactor/base/file_name_spec.rb
155
157
  - spec/spec_helper.rb
156
- - spec/fixtures/app/mailers/account_mailer.rb
157
- - spec/rails3_artifactor/artifact/crud/mailer_spec.rb
158
158
  has_rdoc: true
159
159
  homepage: http://github.com/kristianmandrup/rails3_artifact_helper
160
160
  licenses: []