refinerycms-generators 0.9.9 → 0.9.9.1
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/lib/gemspec.rb +1 -1
- data/lib/generators/refinery_engine/templates/app/controllers/admin/plural_name_controller.rb +6 -4
- data/lib/generators/refinery_engine/templates/features/step_definitions/singular_name_steps.rb +2 -2
- data/lib/generators/refinery_engine/templates/lib/refinerycms-plural_name.rb +4 -3
- data/refinerycms-generators.gemspec +2 -2
- metadata +3 -2
data/lib/gemspec.rb
CHANGED
data/lib/generators/refinery_engine/templates/app/controllers/admin/plural_name_controller.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
module Admin
|
2
|
+
class <%= class_name.pluralize %>Controller < Admin::BaseController
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
4
|
+
crudify :<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
|
5
|
+
:title_attribute => '<%= title.name %>'<% end %><% if plural_name == singular_name %>,
|
6
|
+
:redirect_to_url => :admin_<%= singular_name %>_index_url
|
6
7
|
<% end %>
|
7
8
|
|
9
|
+
end
|
8
10
|
end
|
data/lib/generators/refinery_engine/templates/features/step_definitions/singular_name_steps.rb
CHANGED
@@ -3,7 +3,7 @@ Given /^I have no <%= plural_name %>$/ do
|
|
3
3
|
end
|
4
4
|
|
5
5
|
<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? -%>
|
6
|
-
Given /^I (only )?have <%= plural_name %> titled "?([
|
6
|
+
Given /^I (only )?have <%= plural_name %> titled "?([^\"]*)"?$/ do |only, titles|
|
7
7
|
<%= class_name %>.delete_all if only
|
8
8
|
titles.split(', ').each do |title|
|
9
9
|
<%= class_name %>.create(:<%= title.name %> => title)
|
@@ -11,6 +11,6 @@ Given /^I (only )?have <%= plural_name %> titled "?([^"]*)"?$/ do |only, titles|
|
|
11
11
|
end
|
12
12
|
<% end -%>
|
13
13
|
|
14
|
-
Then /^I should have ([0-9]+) <%= plural_name %>?$/ do |count|
|
14
|
+
Then /^I should have ([0-9]+) <%= plural_name.to_s.gsub(/ies$/, '(ies|y)') %>?$/ do |count|
|
15
15
|
<%= class_name %>.count.should == count.to_i
|
16
16
|
end
|
@@ -10,9 +10,10 @@ module Refinery
|
|
10
10
|
config.after_initialize do
|
11
11
|
Refinery::Plugin.register do |plugin|
|
12
12
|
plugin.name = "<%= class_name.pluralize.underscore.downcase %>"
|
13
|
-
plugin.activity = {
|
14
|
-
|
15
|
-
|
13
|
+
plugin.activity = {
|
14
|
+
:class => <%= class_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
|
15
|
+
:title => '<%= title.name %>'
|
16
|
+
<% end %>}
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{refinerycms-generators}
|
3
|
-
s.version = %q{0.9.9}
|
4
|
-
s.date = %q{2011-01-
|
3
|
+
s.version = %q{0.9.9.1}
|
4
|
+
s.date = %q{2011-01-27}
|
5
5
|
s.summary = %q{Core generators for the Refinery CMS project.}
|
6
6
|
s.description = %q{Core generators for Refinery CMS including refinery_engine.}
|
7
7
|
s.homepage = %q{http://refinerycms.com}
|
metadata
CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 9
|
8
8
|
- 9
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.9.9.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Resolve Digital
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-27 00:00:00 +13:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|