boochtek-rails-crud_actions 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +15 -0
- data/PostInstall.txt +3 -0
- data/README.rdoc +62 -0
- data/Rakefile +28 -0
- data/features/development.feature +13 -0
- data/features/steps/common.rb +194 -0
- data/features/steps/env.rb +6 -0
- data/lib/rails-crud_actions.rb +93 -0
- data/rails-crud_actions.gemspec +38 -0
- data/spec/rails-crud_actions_spec.rb +11 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- data/tasks/rspec.rake +21 -0
- data/tmp/tests.out +0 -0
- metadata +89 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
features/development.feature
|
2
|
+
features/steps/common.rb
|
3
|
+
features/steps/env.rb
|
4
|
+
History.txt
|
5
|
+
lib/rails-crud_actions.rb
|
6
|
+
Manifest.txt
|
7
|
+
PostInstall.txt
|
8
|
+
rails-crud_actions.gemspec
|
9
|
+
Rakefile
|
10
|
+
README.rdoc
|
11
|
+
spec/rails-crud_actions_spec.rb
|
12
|
+
spec/spec.opts
|
13
|
+
spec/spec_helper.rb
|
14
|
+
tasks/rspec.rake
|
15
|
+
tmp/tests.out
|
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
= rails-crud_actions
|
2
|
+
|
3
|
+
* http://github.com/boochtek/rails-crud_actions
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Provides default CRUD actions for a Rails controller.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Provides default CRUD actions for a Rails controller.
|
12
|
+
* Simply include the module, for simpler debugging.
|
13
|
+
* Allows overriding the actions.
|
14
|
+
* Provides the 7 CRUD actions provided by Rails scaffolding, plus 'delete'.
|
15
|
+
* Delete displays a page confirming that the user wants to delete an item.
|
16
|
+
|
17
|
+
== SYNOPSIS:
|
18
|
+
|
19
|
+
class UsersController < ApplicationController
|
20
|
+
include BoochTek::Rails::CrudActions
|
21
|
+
crud_model = Person # OPTIONAL: would have defaulted to User for the UsersController.
|
22
|
+
def index
|
23
|
+
# Can provide an overrided version of an action.
|
24
|
+
end
|
25
|
+
after_filter :only => :show do
|
26
|
+
# Can extend the functionality of the default version of an action. Can also use before_filter or around_filter.
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
== REQUIREMENTS:
|
31
|
+
|
32
|
+
* Rails (actually, ActionController)
|
33
|
+
* Will probably work with any version of Rails, but I've tested with Rails 2.2 and above.
|
34
|
+
|
35
|
+
== INSTALL:
|
36
|
+
|
37
|
+
* sudo gem install boochtek-rails-crud_actions -s http://gems.github.com
|
38
|
+
|
39
|
+
== LICENSE:
|
40
|
+
|
41
|
+
(The MIT License)
|
42
|
+
|
43
|
+
Copyright (c) 2009 BoochTek, LLC
|
44
|
+
|
45
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
46
|
+
a copy of this software and associated documentation files (the
|
47
|
+
'Software'), to deal in the Software without restriction, including
|
48
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
49
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
50
|
+
permit persons to whom the Software is furnished to do so, subject to
|
51
|
+
the following conditions:
|
52
|
+
|
53
|
+
The above copyright notice and this permission notice shall be
|
54
|
+
included in all copies or substantial portions of the Software.
|
55
|
+
|
56
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
57
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
58
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
59
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
60
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
61
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
62
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
|
2
|
+
require File.dirname(__FILE__) + '/lib/rails-crud_actions'
|
3
|
+
|
4
|
+
# Generate all the Rake tasks
|
5
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
6
|
+
$hoe = Hoe.new('rails-crud_actions', BoochTek::Rails::CrudActions::VERSION) do |p|
|
7
|
+
p.developer('Craig Buchek', 'craig@boochtek.com')
|
8
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
9
|
+
p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
10
|
+
p.rubyforge_name = p.name
|
11
|
+
# p.extra_deps = [
|
12
|
+
# ['activesupport','>= 2.0.2'],
|
13
|
+
# ]
|
14
|
+
p.extra_dev_deps = [
|
15
|
+
['newgem', ">= #{::Newgem::VERSION}"]
|
16
|
+
]
|
17
|
+
|
18
|
+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
19
|
+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
20
|
+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
21
|
+
p.rsync_args = '-av --delete --ignore-errors'
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'newgem/tasks' # load /tasks/*.rake
|
25
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
26
|
+
|
27
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
28
|
+
# task :default => [:spec, :features]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Development processes of newgem itself (rake tasks)
|
2
|
+
|
3
|
+
As a Newgem maintainer or contributor
|
4
|
+
I want rake tasks to maintain and release the gem
|
5
|
+
So that I can spend time on the tests and code, and not excessive time on maintenance processes
|
6
|
+
|
7
|
+
Scenario: Generate RubyGem
|
8
|
+
Given this project is active project folder
|
9
|
+
And 'pkg' folder is deleted
|
10
|
+
When task 'rake gem' is invoked
|
11
|
+
Then folder 'pkg' is created
|
12
|
+
And file with name matching 'pkg/*.gem' is created else you should run "rake manifest" to fix this
|
13
|
+
And gem spec key 'rdoc_options' contains /--mainREADME.rdoc/
|
@@ -0,0 +1,194 @@
|
|
1
|
+
def in_project_folder(&block)
|
2
|
+
project_folder = @active_project_folder || @tmp_root
|
3
|
+
FileUtils.chdir(project_folder, &block)
|
4
|
+
end
|
5
|
+
|
6
|
+
def in_home_folder(&block)
|
7
|
+
FileUtils.chdir(@home_path, &block)
|
8
|
+
end
|
9
|
+
|
10
|
+
Given %r{^a safe folder} do
|
11
|
+
FileUtils.rm_rf @tmp_root = File.dirname(__FILE__) + "/../../tmp"
|
12
|
+
FileUtils.mkdir_p @tmp_root
|
13
|
+
FileUtils.mkdir_p @home_path = File.expand_path(File.join(@tmp_root, "home"))
|
14
|
+
@lib_path = File.expand_path(File.dirname(__FILE__) + '/../../lib')
|
15
|
+
Given "env variable $HOME set to '#{@home_path}'"
|
16
|
+
end
|
17
|
+
|
18
|
+
Given %r{^this project is active project folder} do
|
19
|
+
Given "a safe folder"
|
20
|
+
@active_project_folder = File.expand_path(File.dirname(__FILE__) + "/../..")
|
21
|
+
end
|
22
|
+
|
23
|
+
Given %r{^env variable \$([\w_]+) set to '(.*)'} do |env_var, value|
|
24
|
+
ENV[env_var] = value
|
25
|
+
end
|
26
|
+
|
27
|
+
def force_local_lib_override(project_name = @project_name)
|
28
|
+
rakefile = File.read(File.join(project_name, 'Rakefile'))
|
29
|
+
File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
|
30
|
+
f << "$:.unshift('#{@lib_path}')\n"
|
31
|
+
f << rakefile
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def setup_active_project_folder project_name
|
36
|
+
@active_project_folder = File.join(@tmp_root, project_name)
|
37
|
+
@project_name = project_name
|
38
|
+
end
|
39
|
+
|
40
|
+
Given %r{'(.*)' folder is deleted} do |folder|
|
41
|
+
in_project_folder do
|
42
|
+
FileUtils.rm_rf folder
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
When %r{^'(.*)' generator is invoked with arguments '(.*)'$} do |generator, arguments|
|
47
|
+
@stdout = StringIO.new
|
48
|
+
FileUtils.chdir(@active_project_folder) do
|
49
|
+
if Object.const_defined?("APP_ROOT")
|
50
|
+
APP_ROOT.replace(FileUtils.pwd)
|
51
|
+
else
|
52
|
+
APP_ROOT = FileUtils.pwd
|
53
|
+
end
|
54
|
+
run_generator(generator, arguments.split(' '), SOURCES, :stdout => @stdout)
|
55
|
+
end
|
56
|
+
File.open(File.join(@tmp_root, "generator.out"), "w") do |f|
|
57
|
+
@stdout.rewind
|
58
|
+
f << @stdout.read
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
When %r{run executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
63
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
64
|
+
in_project_folder do
|
65
|
+
system "#{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
When %r{run project executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
70
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
71
|
+
in_project_folder do
|
72
|
+
system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
When %r{run local executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
77
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
78
|
+
executable = File.expand_path(File.join(File.dirname(__FILE__), "/../../bin", executable))
|
79
|
+
in_project_folder do
|
80
|
+
system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
When %r{^task 'rake (.*)' is invoked$} do |task|
|
85
|
+
@stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
|
86
|
+
FileUtils.chdir(@active_project_folder) do
|
87
|
+
system "rake #{task} --trace > #{@stdout} 2> #{@stdout}"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
Then %r{^folder '(.*)' (is|is not) created} do |folder, is|
|
92
|
+
in_project_folder do
|
93
|
+
File.exists?(folder).should(is == 'is' ? be_true : be_false)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
Then %r{^file '(.*)' (is|is not) created} do |file, is|
|
98
|
+
in_project_folder do
|
99
|
+
File.exists?(file).should(is == 'is' ? be_true : be_false)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
Then %r{^file with name matching '(.*)' is created} do |pattern|
|
104
|
+
in_project_folder do
|
105
|
+
Dir[pattern].should_not be_empty
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
Then %r{gem file '(.*)' and generated file '(.*)' should be the same} do |gem_file, project_file|
|
110
|
+
File.exists?(gem_file).should be_true
|
111
|
+
File.exists?(project_file).should be_true
|
112
|
+
gem_file_contents = File.read(File.dirname(__FILE__) + "/../../#{gem_file}")
|
113
|
+
project_file_contents = File.read(File.join(@active_project_folder, project_file))
|
114
|
+
project_file_contents.should == gem_file_contents
|
115
|
+
end
|
116
|
+
|
117
|
+
Then %r{^output same as contents of '(.*)'$} do |file|
|
118
|
+
expected_output = File.read(File.join(File.dirname(__FILE__) + "/../expected_outputs", file))
|
119
|
+
actual_output = File.read(@stdout)
|
120
|
+
actual_output.should == expected_output
|
121
|
+
end
|
122
|
+
|
123
|
+
Then %r{^(does|does not) invoke generator '(.*)'$} do |does_invoke, generator|
|
124
|
+
actual_output = File.read(@stdout)
|
125
|
+
does_invoke == "does" ?
|
126
|
+
actual_output.should(match(/dependency\s+#{generator}/)) :
|
127
|
+
actual_output.should_not(match(/dependency\s+#{generator}/))
|
128
|
+
end
|
129
|
+
|
130
|
+
Then %r{help options '(.*)' and '(.*)' are displayed} do |opt1, opt2|
|
131
|
+
actual_output = File.read(@stdout)
|
132
|
+
actual_output.should match(/#{opt1}/)
|
133
|
+
actual_output.should match(/#{opt2}/)
|
134
|
+
end
|
135
|
+
|
136
|
+
Then %r{^output (does|does not) match \/(.*)\/} do |does, regex|
|
137
|
+
actual_output = File.read(@stdout)
|
138
|
+
(does == 'does') ?
|
139
|
+
actual_output.should(match(/#{regex}/)) :
|
140
|
+
actual_output.should_not(match(/#{regex}/))
|
141
|
+
end
|
142
|
+
|
143
|
+
Then %r{^contents of file '(.*)' (does|does not) match \/(.*)\/} do |file, does, regex|
|
144
|
+
in_project_folder do
|
145
|
+
actual_output = File.read(file)
|
146
|
+
(does == 'does') ?
|
147
|
+
actual_output.should(match(/#{regex}/)) :
|
148
|
+
actual_output.should_not(match(/#{regex}/))
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
Then %r{^all (\d+) tests pass} do |expected_test_count|
|
153
|
+
expected = %r{^#{expected_test_count} tests, \d+ assertions, 0 failures, 0 errors}
|
154
|
+
actual_output = File.read(@stdout)
|
155
|
+
actual_output.should match(expected)
|
156
|
+
end
|
157
|
+
|
158
|
+
Then %r{^all (\d+) examples pass} do |expected_test_count|
|
159
|
+
expected = %r{^#{expected_test_count} examples?, 0 failures}
|
160
|
+
actual_output = File.read(@stdout)
|
161
|
+
actual_output.should match(expected)
|
162
|
+
end
|
163
|
+
|
164
|
+
Then %r{^yaml file '(.*)' contains (\{.*\})} do |file, yaml|
|
165
|
+
in_project_folder do
|
166
|
+
yaml = eval yaml
|
167
|
+
YAML.load(File.read(file)).should == yaml
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
Then %r{^Rakefile can display tasks successfully} do
|
172
|
+
@stdout = File.expand_path(File.join(@tmp_root, "rakefile.out"))
|
173
|
+
FileUtils.chdir(@active_project_folder) do
|
174
|
+
system "rake -T > #{@stdout} 2> #{@stdout}"
|
175
|
+
end
|
176
|
+
actual_output = File.read(@stdout)
|
177
|
+
actual_output.should match(/^rake\s+\w+\s+#\s.*/)
|
178
|
+
end
|
179
|
+
|
180
|
+
Then %r{^task 'rake (.*)' is executed successfully} do |task|
|
181
|
+
@stdout.should_not be_nil
|
182
|
+
actual_output = File.read(@stdout)
|
183
|
+
actual_output.should_not match(/^Don't know how to build task '#{task}'/)
|
184
|
+
actual_output.should_not match(/Error/i)
|
185
|
+
end
|
186
|
+
|
187
|
+
Then %r{^gem spec key '(.*)' contains \/(.*)\/} do |key, regex|
|
188
|
+
in_project_folder do
|
189
|
+
gem_file = Dir["pkg/*.gem"].first
|
190
|
+
gem_spec = Gem::Specification.from_yaml(`gem spec #{gem_file}`)
|
191
|
+
spec_value = gem_spec.send(key.to_sym)
|
192
|
+
spec_value.to_s.should match(/#{regex}/)
|
193
|
+
end
|
194
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
module BoochTek
|
5
|
+
module Rails
|
6
|
+
module CrudActions
|
7
|
+
VERSION = '0.0.2'
|
8
|
+
class << self
|
9
|
+
def included(base)
|
10
|
+
base.extend ClassMethods
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module ClassMethods
|
15
|
+
def crud_model=(model)
|
16
|
+
@@current_model = (model.class == Class) ? model : model.constantize
|
17
|
+
end
|
18
|
+
end
|
19
|
+
# This implementation based on http://blog.boldr.fr/posts/datamapper-0-9-avec-rails
|
20
|
+
#before_filter :new_item, :only => [:new, :create]
|
21
|
+
#before_filter :find_item, :only => [:show, :edit, :update, :delete, :destroy]
|
22
|
+
#before_filter :find_items, :only => [:index]
|
23
|
+
#before_filter :fill_item, :only => [:create, :update]
|
24
|
+
# TODO: after_filters for finding default views.
|
25
|
+
# TODO: Filtering of items visible to a user.
|
26
|
+
# TODO: Complex filtering of index, for searching. (Similar to Justin's solution.)
|
27
|
+
# TODO: User-specifed model or collection.
|
28
|
+
# TODO: Pagination.
|
29
|
+
# TODO: Automatic rendering of a default page. (Separate module/gem.)
|
30
|
+
def index
|
31
|
+
end
|
32
|
+
|
33
|
+
def show
|
34
|
+
end
|
35
|
+
|
36
|
+
def new
|
37
|
+
end
|
38
|
+
|
39
|
+
def edit
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete
|
43
|
+
end
|
44
|
+
|
45
|
+
def create
|
46
|
+
save_or_render 'new'
|
47
|
+
end
|
48
|
+
|
49
|
+
def update
|
50
|
+
save_or_render 'edit'
|
51
|
+
end
|
52
|
+
|
53
|
+
def destroy
|
54
|
+
@current_item.destroy
|
55
|
+
respond_to do |format|
|
56
|
+
format.html { redirect_to(self.send("#{current_model.table_name.singularize}_index_url")) }
|
57
|
+
format.xml { head :ok }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
protected
|
62
|
+
|
63
|
+
def new_item
|
64
|
+
@current_item = current_model.new
|
65
|
+
end
|
66
|
+
|
67
|
+
def find_item
|
68
|
+
@current_item = current_model[params[:id]]
|
69
|
+
end
|
70
|
+
|
71
|
+
def find_items
|
72
|
+
@current_items = current_model.all
|
73
|
+
end
|
74
|
+
|
75
|
+
def fill_item
|
76
|
+
@current_item.attributes = params[:item]
|
77
|
+
end
|
78
|
+
|
79
|
+
def save_or_render(action)
|
80
|
+
if @current_item.save
|
81
|
+
redirect_to @current_item
|
82
|
+
else
|
83
|
+
render :action => action
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def current_model
|
88
|
+
@@current_model ||= controller_name.singularize.camelize.constantize
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{rails-crud_actions}
|
5
|
+
s.version = "0.0.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Craig Buchek"]
|
9
|
+
s.date = %q{2009-01-25}
|
10
|
+
s.description = %q{Provides default CRUD actions for a Rails controller.}
|
11
|
+
s.email = ["craig@boochtek.com"]
|
12
|
+
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
|
13
|
+
s.files = ["features/development.feature", "features/steps/common.rb", "features/steps/env.rb", "History.txt", "lib/rails-crud_actions.rb", "Manifest.txt", "PostInstall.txt", "rails-crud_actions.gemspec", "Rakefile", "README.rdoc", "spec/rails-crud_actions_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rspec.rake", "tmp/tests.out"]
|
14
|
+
s.has_rdoc = true
|
15
|
+
s.homepage = %q{http://github.com/boochtek/rails-crud_actions}
|
16
|
+
s.post_install_message = %q{PostInstall.txt}
|
17
|
+
s.rdoc_options = ["--main", "README.rdoc"]
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.rubyforge_project = %q{rails-crud_actions}
|
20
|
+
s.rubygems_version = %q{1.3.1}
|
21
|
+
s.summary = %q{Provides default CRUD actions for a Rails controller.}
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
+
s.specification_version = 2
|
26
|
+
|
27
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
+
s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
|
29
|
+
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
|
30
|
+
else
|
31
|
+
s.add_dependency(%q<newgem>, [">= 1.2.3"])
|
32
|
+
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
33
|
+
end
|
34
|
+
else
|
35
|
+
s.add_dependency(%q<newgem>, [">= 1.2.3"])
|
36
|
+
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
37
|
+
end
|
38
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
data/tmp/tests.out
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: boochtek-rails-crud_actions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Craig Buchek
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-01-25 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: newgem
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.2.3
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: hoe
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.8.0
|
32
|
+
version:
|
33
|
+
description: Provides default CRUD actions for a Rails controller.
|
34
|
+
email:
|
35
|
+
- craig@boochtek.com
|
36
|
+
executables: []
|
37
|
+
|
38
|
+
extensions: []
|
39
|
+
|
40
|
+
extra_rdoc_files:
|
41
|
+
- History.txt
|
42
|
+
- Manifest.txt
|
43
|
+
- PostInstall.txt
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- features/development.feature
|
47
|
+
- features/steps/common.rb
|
48
|
+
- features/steps/env.rb
|
49
|
+
- History.txt
|
50
|
+
- lib/rails-crud_actions.rb
|
51
|
+
- Manifest.txt
|
52
|
+
- PostInstall.txt
|
53
|
+
- rails-crud_actions.gemspec
|
54
|
+
- Rakefile
|
55
|
+
- README.rdoc
|
56
|
+
- spec/rails-crud_actions_spec.rb
|
57
|
+
- spec/spec.opts
|
58
|
+
- spec/spec_helper.rb
|
59
|
+
- tasks/rspec.rake
|
60
|
+
- tmp/tests.out
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://github.com/boochtek/rails-crud_actions
|
63
|
+
post_install_message: PostInstall.txt
|
64
|
+
rdoc_options:
|
65
|
+
- --main
|
66
|
+
- README.rdoc
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
80
|
+
version:
|
81
|
+
requirements: []
|
82
|
+
|
83
|
+
rubyforge_project: rails-crud_actions
|
84
|
+
rubygems_version: 1.2.0
|
85
|
+
signing_key:
|
86
|
+
specification_version: 2
|
87
|
+
summary: Provides default CRUD actions for a Rails controller.
|
88
|
+
test_files: []
|
89
|
+
|